Repository navigation
Conversation
… list /model now offers the current generation: claude-opus-5-5 (default), claude-fable-5-2, claude-sonnet-5-5 and claude-haiku-5-5. Previously saved or DCI_AI_MODEL ids keep working (accepted with a warning).
taltultc
left a comment
There was a problem hiding this comment.
🔴 Customer switching
After set_customer_context, the CLI changes the system prompt and resends the previous signed thinking block. Fable 5.2 rejects the next request with HTTP 400, and Opus 5.5 can too. Please keep the prompt stable, return the new customer in the tool result, and add a regression test. Anthropic’s prefix-check rules
|
@taltultc Fixing. Will be in the next commit |
Opus 5.5 and the Fable models bind each thinking block to the top-level system prompt. The session re-rendered the prompt's context tail on every request, so after set_customer_context the next request replayed a thinking block under a changed prompt and failed with HTTP 400. The tail is now frozen at the conversation's first request. The agent's switch is reported in the set_customer_context result, and context changes from /customer or a re-login are appended to the next user message.
| s.freezeSystemTailLocked() | ||
| history := append([]anthropic.MessageParam{}, s.history...) | ||
| model := s.model | ||
| tail := s.systemTail |
There was a problem hiding this comment.
🔴 If a user runs /customer while a turn is running, the agent keeps working for the rest of that turn as if the old tenant were active. Its commands already run against the new one. The context-change check now runs only in composeUserMessageLocked, which fires once per question. params() resends the frozen tail on every tool round. Fix: run the same check before each round in runTurn. On a change, add the "Session context update" text block to the user message that carries the tool results (ai_session.go:576), so the change is announced within the turn.
Why this was flagged
The TUI does not block verbs during a turn. submit() sends to runVerb, and the "customer" case (ai_tui.go:1672-1690) writes the saved context and calls ClearCustomerOverride while the turn is in flight. Every later run_dci_command child in that turn runs against the new tenant, because EffectiveCustomer reads the file (ai_tools.go:216). The tool_result sent to the model holds only outcome.Data with no tenant tag (ai_session.go:746). The tenant is attached only to the TUI event. runTurn calls s.params() on each of up to aiMaxToolRounds=16 rounds (ai_session.go:530). Before this change, each call re-rendered aiVolatileSystem with the current customer, so the model saw the switch on its next round. Now params() resends the frozen systemTail. The update is added only on the user's next question (ai_session.go:431). For the rest of the turn the model reports the new tenant's data as the old tenant's. A re-login mid-turn (refreshAuthState, ai_tui.go:722) behaves the same way.
Verification: On the base commit, params() re-rendered the volatile tail on every request, so each tool round showed the model the current tenant. Now params() sends tail := s.systemTail, which is rendered once and never re-rendered. The context check runs only in composeUserMessageLocked, and the tool-result user message in runTurn (ai_session.go:576) gets no such check.
Finding ID: f-185a92f4
Summary
claude-opus-5→claude-opus-5-5(applies to everyone, including doers on DoiT-provided access)./modellist replaced with the current generation:claude-opus-5-5,claude-fable-5-2,claude-sonnet-5-5,claude-haiku-5-5.ai_settings.jsonorDCI_AI_MODELstill work (unknownclaude-*ids are accepted with a warning).Compatibility
Requests don't send
thinkingor a forcedtool_choice, which the 5.5 models reject; themediumeffort default already matches Opus 5.5's API default.Test plan
go vet .go test .