GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(chat): 支持携带当前工作区改动分叉并修复历史继承与并发安全 by uiliugang · Pull Request #170 · uiliugang/t3code

Conversation

@uiliugang

@uiliugang uiliugang commented Nov 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Owner

改动

从回复分叉可选择复用当前工作树,或携带当前 checkout 的改动创建独立工作树。历史回复仍引用原始会话历史,但目录、父关系和设置来自当前会话,避免误用祖先工作区。

  • 通过可选服务端能力位启用新工作树分叉;旧服务端保留原地分叉。
  • 二进制补丁文件保留暂存、未暂存及非 UTF-8 内容,固定 Git 补丁配置,限制大小并校验 symlink,避免写出目标目录。
  • 从实际 checkout HEAD 创建工作树,兼容父分支改名,保留 symbolic baseline 和显式模型、运行模式选择;沿用最终 dispatch 权限上限。
  • 准备失败清理未使用目标与多仓资源;清理失败保留准备记录,重试恢复部分 index,未绑定 root 不复制主目录脏文件。
  • 以不可变 run fork 祖先关系校验 source/workspace 锁顺序,防止 child A 与 parent B 反向持锁死锁;兼容中间 side chat 转正后的历史。删除与继承 fork 串行化。
  • 移动端查询上移到路由层;按操作权限隐藏分叉入口;忙碌期间保留可见的禁用按钮和加载状态。

已按 ponytail-review 复核原 12 条发现及最终完整分支差异。重复实现建议部分采纳,保留协议与生命周期不同的单仓、多仓及侧聊路径。已合入 main 的 UI PR168 和安全 PR171:保留 ChatView 详情去重与快捷键、ThreadFeed 空态翻译和 fork 行为,以及安全权限分类、服务锁内复查和移动测试配置。

验证

  • 修复提交的 ./vp run check:changed --concurrency 1:format、lint、knip、graphql、39 包 typecheck、31 文件 921 项测试、13 项 React Compiler 检查通过。
  • 集成后 ChatView 浏览器、BranchToolbar 逻辑与 uiLocale:3 文件 83/83 通过。
  • 三方集成后 T3_MOBILE_TEST_PLATFORM=android ./vp test run apps/mobile/src/lib/filePreview.test.ts apps/mobile/src/features/settings/components/ProjectRepositoriesEditor.test.tsx:90/90 通过;未为旧 CI 失败盲加 mock。
  • 三方集成后 ChatView.browser、BranchToolbar.logic、uiLocale、RpcAuthorization、ProjectService、project/http 六文件 131/131 通过。
  • 最终三方 head 9535dd80f0a3f348a5d86920ce6116f0d21523f0 的 ./vp run check:changed --concurrency 1 退出 0:format、lint、knip、graphql、39 包 typecheck、31 文件 925/925、React Compiler 13/13 全部通过。
  • Web:隔离服务、独立 Playwright Chromium 验证祖先回复的两种分叉、当前 checkout 暂存/未暂存/未跟踪内容、改名父分支 baseline、busy 工具栏及 390px 窄屏;main 集成后重跑通过,pageerror 为空。
  • Android emulator-5554:native compatibility 通过;独立 agent-device 会话与 Metro,真实操作两种分叉,数据库和文件精确断言通过。busy 禁用及只读权限隐藏入口有截图、无障碍树与授权记录。无真实 provider 消费,自己的设备会话与 Metro 已关闭。

边界

未验证 iOS、Windows 实际文件锁、多环境断网。清理失败通过故障注入测试。Android 验收后 main 对 ThreadFeed 的合入仅空态翻译,不改变已验收的 fork 交互。

旧 head 的 CI 失败不视为放行;最终 head 的完整 CI、PR 合并与发布由父任务统一确认。本任务不 watch、不合并、不发布。

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
liugang59 @claude
feat(chat): 支持会话分叉直接复用当前工作树或携带改动分叉到新工作树
e6d6e2f
参考 ZCode 会话分叉模型优化分叉体验:原地分叉继承同一 workspace 修订时不再被父会话或同谱系子任务的仓库占用检查误拦截;同时在 Web 和移动端 Git 项目的回复分叉入口提供双目的地菜单,支持直接复用当前目录/工作树或从当前 HEAD 创建携带已暂存、未暂存与未跟踪改动的独立新工作树。

Co-Authored-By: Claude Code <[email protected]>
@github-actions

github-actions Bot commented Nov 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Other scenarios

All 64 scenario measurements match main.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded 10.5 KiB 10.5 KiB 0 B (0.0%) 12.7 KiB ✅
Codex short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn running, cold open HTTP decoded 281.7 KiB 281.7 KiB 0 B (0.0%) 302.7 KiB ✅
Codex long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Codex long turn running, history page HTTP decoded 92.4 KiB 92.4 KiB 0 B (0.0%) 107.4 KiB ✅
Codex long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Codex long turn finished, cold open HTTP decoded 381.5 KiB 381.5 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, socket cold open WebSocket decoded 381.6 KiB 381.6 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, work page HTTP decoded 186.2 KiB 186.2 KiB 0 B (0.0%) 200.2 KiB ✅
Codex long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Codex idle thread resume WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell snapshot HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Codex fleet shell subscribe WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Codex fleet shell resume check rows 0 0 0 0 ✅
Codex stale shell reload HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex stale shell reload rows 27 27 0 (0.0%) 27 ✅
Codex stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Codex stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex stale todo list cold open HTTP decoded 72.4 KiB 72.4 KiB 0 B (0.0%) 83.0 KiB ✅
Codex stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Codex stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅
Claude short turn resume WebSocket decoded 10.6 KiB 10.6 KiB 0 B (0.0%) 12.7 KiB ✅
Claude short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn running, cold open HTTP decoded 283.3 KiB 283.3 KiB 0 B (0.0%) 302.7 KiB ✅
Claude long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Claude long turn running, history page HTTP decoded 93.4 KiB 93.4 KiB 0 B (0.0%) 107.4 KiB ✅
Claude long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Claude long turn finished, cold open HTTP decoded 384.2 KiB 384.2 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, socket cold open WebSocket decoded 384.3 KiB 384.3 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, work page HTTP decoded 188.1 KiB 188.1 KiB 0 B (0.0%) 200.2 KiB ✅
Claude long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Claude idle thread resume WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell snapshot HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Claude fleet shell subscribe WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Claude fleet shell resume check rows 0 0 0 0 ✅
Claude stale shell reload HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude stale shell reload rows 27 27 0 (0.0%) 27 ✅
Claude stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Claude stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude stale todo list cold open HTTP decoded 73.4 KiB 73.4 KiB 0 B (0.0%) 83.0 KiB ✅
Claude stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Claude stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅

Baseline: cf554f5 · PR result: 0b1c62b · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

liugang59 added 3 commits November 17, 2026 03:59
liugang59
修复历史会话分叉的工作区继承、安全复制与并发清理并补充回归
8247138
liugang59
合入主分支并保留界面快捷键与会话分叉修复
67123b1
liugang59
合入安全权限分类与锁内复查修复并保留会话分叉逻辑
9535dd8
@uiliugang uiliugang changed the title feat(chat): 支持会话分叉直接复用当前工作树或携带改动分叉到新工作树 feat(chat): 支持携带当前工作区改动分叉并修复历史继承与并发安全 Nov 16, 2026
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 16, 2026
liugang59
test(workspace): 显式设置冲突夹具身份并校验未合并索引
0b1c62b
修复无全局 Git 身份的 CI 环境中 merge 提前退出、未建立冲突的问题。补充退出码和索引前置断言,避免把夹具失败误报为携带改动逻辑失败。
@uiliugang

uiliugang commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

已修复最终 CI 的 Test Server 6 失败,提交 0b1c62b。根因是冲突夹具的 git merge 未指定身份,在无 Git 身份的 runner 上提前失败,未生成预期冲突。现显式提供测试身份,并断言退出码和未合并索引。禁用全局/系统 Git 配置并开启 user.useConfigOnly 后,旧版同样失败,修复后携带改动与清理重试 8/8 通过;增量 check:changed 全通过(3 包类型、4 测试、format/lint/knip/graphql)。仅测试文件变化,产品逻辑及此前 Web/Android 验收不变。继续等待新 head 的完整 CI,通过前不合并。

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@uiliugang
uiliugang merged commit 2b4e3af into main Nov 16, 2026
30 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XXL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@uiliugang
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.