Commit 4a66207
authored
🤖 fix: make compact-continue reliable and unify send options (#196)
Surface bug: After `/compact -c`, user message appeared but no stream
started and no error artifacts were visible in AIView.
## Root causes
1. **Options mismatch**: `buildSendMessageOptions` read raw localStorage
strings instead of using JSON parser, sometimes producing
invalid/missing model. When model was invalid, backend added user
message then returned error without throwing, causing silent failure (no
stream, no UI error).
2. **Racy re-triggering**: `useAutoCompactContinue` effect could fire
multiple times during state settlement after `replaceHistory`, causing
flaky behavior and occasional duplicate sends.
## Fix
- **Unified options building**: `buildSendMessageOptions` now delegates
to `getSendOptionsFromStorage` (single source of truth with proper JSON
parsing) ensuring valid model/toolPolicy/thinking options always
supplied.
- **Made auto-continue idempotent**: Added per-workspace guard that
fires once per compaction completion and resets when state clears,
preventing races.
## Files changed
- `src/hooks/useSendMessageOptions.ts`: Use `getSendOptionsFromStorage`
- `src/hooks/useAutoCompactContinue.ts`: Add idempotency guard
## Testing
1. Create history in any workspace
2. Run: `/compact -c "Keep going"`
3. When summary appears, auto-continue should:
- Send your continue message with correct model/mode/thinking
- Start streaming assistant reply
4. Verify with different models/thinking levels
_Generated with `cmux`_1 parent b3d113a commit 4a66207
File tree
2 files changed
+39
-38
lines changed- src/hooks
2 files changed
+39
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
24 | | - | |
25 | | - | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
42 | 59 | | |
43 | 60 | | |
44 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 7 | + | |
13 | 8 | | |
14 | 9 | | |
15 | 10 | | |
| 11 | + | |
16 | 12 | | |
17 | 13 | | |
18 | 14 | | |
| |||
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 66 | + | |
| 67 | + | |
77 | 68 | | |
78 | 69 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 70 | + | |
87 | 71 | | |
0 commit comments