Commit 4e6ee27
authored
🤖 fix: don't persist compaction model as workspace AI settings (#1259)
## Problem
When compaction is triggered with a specific model (e.g., `/compact -m
openai:gpt-4.1-mini`), the backend was incorrectly persisting that model
to the workspace's AI settings, overwriting the user's preferred model.
After compaction completed, the workspace would be set to use the
compaction model instead of the model the user had selected.
## Root Cause
Regression introduced in 1ae0377 (#1203) which added a "safety net" to
persist AI settings from `sendMessage`/`resumeStream` for cross-device
consistency. This safety net didn't account for compaction requests
which intentionally use a different (often cheaper/faster) model.
cc @tomaskoubek (regressor)
## Fix
Skip persisting AI settings when:
- `sendMessage` is called with `muxMetadata.type ===
"compaction-request"`
- `resumeStream` is called with `options.mode === "compact"`
## Testing
- Added IPC test verifying compaction requests don't override workspace
AI settings
- Existing `updateAISettings` test still passes
---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking:
`high`_1 parent c836a85 commit 4e6ee27
File tree
2 files changed
+81
-34
lines changed- src/node/services
- tests/ipc
2 files changed
+81
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
959 | 959 | | |
960 | 960 | | |
961 | 961 | | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
962 | 989 | | |
963 | 990 | | |
964 | 991 | | |
| |||
1275 | 1302 | | |
1276 | 1303 | | |
1277 | 1304 | | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
1293 | | - | |
1294 | | - | |
| 1305 | + | |
1295 | 1306 | | |
1296 | 1307 | | |
1297 | 1308 | | |
| |||
1405 | 1416 | | |
1406 | 1417 | | |
1407 | 1418 | | |
1408 | | - | |
1409 | | - | |
1410 | | - | |
1411 | | - | |
1412 | | - | |
1413 | | - | |
1414 | | - | |
1415 | | - | |
1416 | | - | |
1417 | | - | |
1418 | | - | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
| 1419 | + | |
1425 | 1420 | | |
1426 | 1421 | | |
1427 | 1422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 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 | + | |
51 | 103 | | |
0 commit comments