Commit 4019fc5
authored
fix(desktop): open side conversations without a settled turn (#4508)
The Desktop side conversation forked the main session eagerly at mount, and only through the latest settled turn. During a session's first turn there is no settled turn, so the panel failed with "无法创建侧边对话,请稍后重试。" and stayed unusable until that turn finished.
The fork now happens on the first send, and the conversation-copy boundary can express an empty copy. `sourceTurnId` becomes optional on the copy shape; an absent value means "copy no messages", and it is accepted only for the `side_conversation` intent, enforced both at the Runtime Host protocol decoder and at the persistence lineage invariant. An empty copy inherits the source model, cwd and permission mode and records `parentSessionId`, but carries over no messages, runs, events or in-progress Todo, and fabricates no `branchOfTurnId`. `session.revision.create` still requires `sourceTurnId`, so revisions stay through-turn only and their fingerprints are unchanged.
Because the composer is live from the first frame, the "preparing" busy-tab pipeline (loading frame, `aria-busy`, drag and close disabling) has no remaining producer and is removed as part of the change. The CLI opens an empty side conversation instead of erroring, matching Desktop.
`RUNTIME_HOST_COMPATIBILITY_EPOCH` is bumped for the optional-field wire shape. No on-disk migration is needed: released versions persisted `sourceTurnId`, which is still a valid shape, so existing sessions and in-flight copy leases load unchanged.
Downgrade note: a header written by this build for an empty copy omits `sourceTurnId`, and an older release reading it throws `malformed fields`. The compatibility epoch does not cover the downgrade direction and the repo has no downgrade contract, so this is recorded as a known consequence rather than a guarded path.
Fixes #4507
Generated-by: Claude Code1 parent 898b86d commit 4019fc5
36 files changed
Lines changed: 943 additions & 562 deletions
File tree
- apps/desktop
- e2e
- src
- main
- __tests__
- renderer
- features/workbar
- controller
- tools/side-chat
- ui
- locales
- styles/workbar
- docs
- packages
- cli/src
- __tests__
- core/src
- runtime-host/src
- __tests__
- protocol
- server
- storage/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
404 | 412 | | |
405 | 413 | | |
406 | 414 | | |
| |||
416 | 424 | | |
417 | 425 | | |
418 | 426 | | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | 427 | | |
427 | 428 | | |
428 | 429 | | |
| |||
449 | 450 | | |
450 | 451 | | |
451 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
452 | 460 | | |
453 | 461 | | |
454 | 462 | | |
| |||
Lines changed: 31 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
102 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
103 | 117 | | |
104 | 118 | | |
105 | 119 | | |
| |||
130 | 144 | | |
131 | 145 | | |
132 | 146 | | |
133 | | - | |
134 | | - | |
135 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
136 | 159 | | |
137 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
138 | 164 | | |
139 | 165 | | |
140 | 166 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
0 commit comments