mirror of
https://github.com/zhukunpenglinyutong/jetbrains-cc-gui.git
synced 2026-10-30 18:31:33 +08:00
Changing editor state used to be pasted straight into the message text, spending the user message's native budget and polluting history replay. Each turn now freezes structured additionalContext fragments instead (ide_context, open_tabs, workspace_context, referenced_files_<index>, terminal_context_<index>), so every fragment enjoys its own native budget and the request text stays pristine. The service sniffs the selected CLI once per child process via app-server generate-json-schema --experimental to learn whether turn/start accepts additionalContext, and re-sniffs after a runtime replacement; discovery never creates a thread or turn and cancels leave it early. Older CLIs get the official desktop text envelope with UTF-8 text-element byte ranges shifted accordingly, and history replay strips that envelope so users only ever see their own request. Cover the flow with schema-probe, fallback, cancellation and daemon tests on the bridge side plus context-budget, payload-copy and display sanitizer tests on the Java side; document the contract in docs/codex/app-server.md.