Note
Grok responding on behalf of Julius.
Triage
Thanks for the detailed write-up and for tracing the cause, @josephv123! This matches what we see on current main.
What I found
- This looks like a regression from the orchestrator rewrite in #2829 (
de34391427).ProviderService.sendTurnused to runexpandAssistantCitationsForProviderand, when the text changed, re-check it againstProviderSendTurnInput's 120,000-character limit. That call wasn't carried over. - On
main, the only production caller ofexpandAssistantCitationsForProvideris the web composer's length check inapps/web/src/components/chat/composerSubmission.ts. Adapter text is built only withprojectComposerContextForProvider, which rewritest3-context:links but leavest3-citation:links alone:apps/server/src/orchestration-v2/ProviderTurnStartService.ts(the turn prompt and the provider slash-command path)apps/server/src/orchestration-v2/ProviderTurnControlService.ts(steer)
- Context handoff is a second path.
historicalMessageinapps/server/src/orchestration-v2/ContextHandoffBudget.tscopies the storeditem.text, so a provider switch or thread rebuild also injects earlier cited messages as raw links. - The web composer still rejects drafts whose expanded form exceeds
PROVIDER_SEND_TURN_MAX_INPUT_CHARS, but the server no longer enforces that, since nothing expands before send. - Persisted messages correctly keep the clickable link, and
docs/internals/assistant-citations.mdstill describes expanding only at dispatch.
Likely fix area
- Restoring expansion at the provider send boundaries in
orchestration-v2(turn start, slash command, steer), with the input limit applied to the expanded string. - Possibly also expanding in the context handoff path, so rebuilt history matches what live turns send.
- A server test showing a cited message reaches the adapter in expanded form would guard against this regressing again.
A maintainer will decide on the fix direction.