Repository navigation
fix(codex): keep status summaries out of intermediate messages - #2041
techotaku39 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Review mode: initial
Requirement — Pass
Keeping status summaries in final answers addresses the reported premature status rows and misleading intermediate completion states.
Evidence
- Issue #2037 documents commentary footers followed by further tool activity and a final-answer footer.
- At the base commit, cli/src/modules/common/sessionSummaryInstruction.ts:52 requests a footer after every response; web/src/components/AssistantChat/messages/NotifySummaryText.tsx:136 checks message completion without distinguishing final answers.
Approach — Pass
Clarifying the instruction and filtering explicitly intermediate messages during conversion addresses both generation and downstream ingestion without changing the wire contract.
Evidence
- cli/src/modules/common/sessionSummaryInstruction.ts:52 restricts emission to the final answer.
- cli/src/codex/utils/assistantText.ts:5 reuses the existing footer parser only for commentary and partial_answer phases.
- cli/src/codex/utils/appServerEventConverter.ts:1007 and cli/src/codex/utils/codexEventConverter.ts:506 apply filtering before message emission; shared projection uses the app-server converter for both live events and history.
Code — Reviewed
Reviewed the entire fixed-head merge-base diff and relevant surrounding conversion, deduplication, replay, and parsing code. No actionable defects found. Missing or unknown phases and already stored messages retain their documented behavior.
No reportable code issues found.
Testing
Not run (automation; PR code execution is prohibited).
- Added regression coverage exercises intermediate footer removal, footer-only suppression, final-answer preservation, duplicate events, and live/history equivalence.
- Observed CI: integration and windows-codex-mcp succeeded; test and pr-review remained in progress.
- The PR reports passing typecheck, build, focused tests, replay, and acceptance checks. These were not independently executed; review remained read-only.
HAPI Bot
Summary
Codex can emit
AGENT_NOTIFY_SUMMARYin progress messages while the turn continues, causing multiple status rows before the final answer.commentaryandpartial_answermessages during live app-server and transcript conversion, preserving progress prose.Validation
bun typecheck— passed.bun run build— passed.bun run --cwd cli test -- src/codex/utils/appServerEventConverter.test.ts src/codex/utils/codexEventConverter.test.ts src/codex/shared/projection.test.ts src/modules/common/sessionSummaryInstruction.test.ts— 141 passed. The initial regression run failed on the previous implementation.bun run --cwd web test -- src/components/AssistantChat/messages/NotifySummaryText.test.tsx src/components/AssistantChat/messages/assistantCopyText.test.ts— 16 passed.pwsh -NoProfile -File .\scripts\Invoke-HapiTaskPlaywright.ps1 -Name fix-notify-summary-final-only -Suite Root terminal-wrap-fidelity.spec.ts— 2 passed.git diff --check— passed.Limitations
Messages with missing or unknown phases retain existing behavior. Already stored Hub messages are not rewritten. The updated instruction takes effect when injected into new or resumed sessions.
Related Issues
Fixes #2037
AI Disclosure
Implemented and tested with OpenAI Codex using GPT-6.1 Sol.