Fixed
A chat's Max Turns and Effort are now stored with the chat (#81)
The sessions table kept mode, agent_mode and model, but never the other two dials. Reopening a chat therefore had nothing to restore: the turn budget fell back to the value hardcoded in the markup (50) and Effort carried over from whichever tab was open before it.
It was reported against chats created from Kanban tasks, but that part was incidental — a task's chat is an ordinary chat, and every existing chat behaved this way.
Two new columns (max_turns, effort), added by ALTER TABLE on an existing database. A chat that has no stored value falls back to the configured default from the 7.10 defaults chain — project override, then global, then built-in — rather than to the last chat you had open. That is what the report expected to see.
Every door that creates or copies a chat now carries the dials: new chat, fork, compact, and JSON import. Import validates them first — that file is user-supplied, so max_turns: 900 arrives as easily as a real export, and it would have gone to the engine verbatim.
Also fixed along the way
Seven review rounds on this one change; the following were found and fixed before release:
- The stored effort value was conflated with the CLI flag.
autois a real stored choice meaning "pass no--effort", and the two need separate spellings or one overwrites the other. - Both replay paths — idle-interrupt and interrupted-recovery — rebuilt their run options from the global defaults, clobbering the dials the chat had just stored.
- The client never sent the
autosentinel, so choosing Auto was indistinguishable from choosing nothing. - The defaults cache did not record which project it held, so a chat could inherit the previously open project's overrides.
- A background tab that was generating could lose its accumulated output if you switched tabs at the wrong moment during a chat load.
- Fast project switching could let a slow earlier response overwrite a newer one in the defaults cache, leaving the wrong project's badges on screen.
- Opening a chat immediately after a page refresh could resolve to the global defaults instead of the project's, because the project list had not arrived yet — the same symptom as the original report, on one chat per page load.
Verification
npm test — 68 files, 2327 assertions, green in a CI-equivalent Linux container (Node 20).