Repository navigation
Commit 49b3642
fix(server): fork notice follows a first /compact and native replacement (#1864)
## Problem
A conversation fork's notice tells its agent which thread it is.
It missed the agent in two cases:
- **Compact:** native `/compact` carries no notice
- **Then:** the next turn treats it as delivered
- **Replacement:** legacy runs suppress it
Legacy runs are accepted runs with no recorded native id.
## Change
- **New:** `conversationForkNoticeOwedFork`
- **Owed:** until a non-compact run carries it
- **Legacy runs:** as `nativeThreadHasTurns`
- **Hook:** one call in `ProviderTurnStartService`
- **Compact command:** still sent unchanged
## Scope and approval
Closes #1668
Fix in the fork: human decision.
Known limits disclosed in #1667.
**Not changed:** a fork's very first `/compact` is refused before start; a fork copies no messages to compact.
The reachable case is a first `/compact` on a fresh native thread; the compact test drives it.
## Close conditions
- [ ] **Compact:** notice follows a first `/compact`
- [ ] **Replacement:** notice after native replacement
- [ ] **Tests:** both cases covered
## Verification
New `ConversationForkNotice.fork.integration.test.ts`: one test per case, draining the effect worker, no sleeps.
- [x] **Before fix:** 2/2 fail, notice missing
- [x] **After fix:** `vp test run` → exit 0 (4/4)
- [x] `vp run --filter t3 typecheck → exit 0`
- [x] `vp run fork:ci → exit 0`
- [x] `vp run check:changed → exit 1`: 2/5012 tests, both unrelated
- `markdownPipeline` browser test: load flake, passes alone
- `GitManager` CLAUDE.md test: local global gitignore; passes with `GIT_CONFIG_GLOBAL=/dev/null`
```text
× follows a first /compact on a fresh native thread, leaving the command unchanged
× reaches a replacement native thread despite legacy accepted attempts
AssertionError: expected 'Context handoff (full_thread_summary)…' to include '[T3 Code conversation fork:'
```
Claude Opus 5.5, Claude Code in T3 Code.
## Fork trailers
Squashes:
- c4ed8bb fix(server): fork notice follows a first /compact and native replacement (#1864) (#1864)
- 2927ac8 fixup! fix(server): fork notice follows a first /compact and native replacement (#1864) (#1864)
Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: yes
Co-authored-by: donjor <[email protected]>1 parent c20d6ef commit 49b3642
3 files changed
Lines changed: 415 additions & 2 deletions
File tree
- apps/server/src/orchestration-v2
- testkit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
1379 | 1380 | | |
1380 | 1381 | | |
1381 | 1382 | | |
1382 | | - | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
1383 | 1389 | | |
1384 | 1390 | | |
1385 | 1391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
2 | 6 | | |
3 | 7 | | |
4 | 8 | | |
| |||
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
67 | 106 | | |
68 | 107 | | |
69 | 108 | | |
| |||
0 commit comments