Repository navigation
fix(tui): clear flagship conversation context over stdio - #3650
Conversation
Request changes
One thing to fix before merge: Smaller: while the reset is in flight the UI shows nothing at all — no spinner, no "working" line — because this path skips the per-turn state reset every other turn does. Harmless when the agent answers in milliseconds, but a wedged agent looks frozen for the full 20-second timeout. Real-world evidenceNo 🔍 Technical details🟡
|
# Conflicts: # hub/agents/gaia/npm/CHANGELOG.md
|
Verdict: Approve with suggestions The acknowledged round-trip design is sound: Python clears history and emits 🟡 The new stdio sentinel is undocumented in the SPEC — the wire-protocol contract is incomplete
🔍 Technical details
The new sentinel belongs in a parallel paragraph — the protocol guarantee (null-byte-delimited, out-of-band, never forwarded to the LLM, acknowledged by
|
amd#3699 moved TTFT off the model and onto the event, so clearing reset two fields that no longer exist — the package did not build. Mirrors startTurn instead: the step count and the pre-scan card flag. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Verdict: Approve The Test coverage is thorough: the Python unit test verifies model/skill/permission state survives the clear; the subprocess integration test runs a real Python process and checks turn isolation; and the Go tests cover the acknowledgment protocol, the "agent not yet started" early-exit, and both No blocking issues found. 🔍 Technical detailsOne observation (not blocking): The |
Main's allowlist fixes (amd#3593) keep refusing under this branch's ask-first model: each guard it added is tagged as an outright refusal, so none of them turns into a yes/no prompt. The /agents switch (amd#3987) and the conversation-clear test (amd#3650) now use the full-access names, and a saved-default notice is shown once rather than again on every switch.
Summary
The TUI now clears the flagship's actual conversation and waits for acknowledgment before removing the visible transcript.
Why
Previously
/clearerased only the screen; prior instructions still influenced the next task.Linked issue
Closes #3636
Changes
Adds an acknowledged stdio reset while preserving the running process, model, skills and permission state. Failed resets retain the transcript and show an error.
Test plan
python -m pytest hub/agents/gaia/python/tests/test_stdio.py -q— 67 passed.go test ./internal/client ./internal/ui/chatandgo vet ./internal/client ./internal/ui/chat— passed.Evidence
The new regression failed before the fix because prior instructions remained in context. A real Python stdin/stdout subprocess handles two turns, a reset and a fresh turn; the fresh turn sees no old history. Go tests cover the transport acknowledgment and UI success/failure state. Inference is deterministic in this contract test; live model quality and rendered terminal screenshots were not evaluated.
Checklist
Compatibility follow-up
Legacy subprocess and mock connections retain screen clearing with an explicit notice that agent context is unchanged. Canonical resets show progress while awaiting acknowledgement.
gaia-clear.exe chat --subprocess mock-clear.exe --query before-clear-marker --control-port 8819, followed by/clearvia the control API, displayed:The process exited cleanly via Ctrl+C. Canonical context-reset evidence remains the real Python stdio round trip described above.