Skip to content

fix(cli): harden ACP/Codex event handling - #211

Merged
tiann merged 1 commit into
tiann:mainfrom
Lihengwannafly:pr/cli-fixes
Feb 25, 2026
Merged

fix(cli): harden ACP/Codex event handling#211
tiann merged 1 commit into
tiann:mainfrom
Lihengwannafly:pr/cli-fixes

Conversation

@Lihengwannafly

Copy link
Copy Markdown
Contributor

What / Why

Make CLI event handling more robust across ACP/Codex streams (missing turn ids, out-of-order tool events, inconsistent payload shapes) and prevent duplicated “reasoning” text caused by repeated delta notifications.

Changes

  • Harden ACP parsing/conversion (audience/kind/tool-name fallbacks; ordering + trailing update handling).
  • Codex app-server integration hardening (config + remote launcher guardrails; safer handling of terminal lifecycle events without turn_id).
  • App-server event conversion improvements, including deduping identical consecutive deltas to avoid duplicated tokens in the UI.
  • Add/extend Vitest coverage for the above behaviors.

Tests

  • cd cli && bun run test
  • cd cli && bun run typecheck

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • No issues found.

Questions

  • For the consecutive-delta dedupe in cli/src/codex/utils/appServerEventConverter.ts:321, do we have an upstream guarantee that identical consecutive deltas are duplicates (not legitimate repeated tokens/output)? If not, should we gate dedupe on a sequence/offset field instead of content equality?

Summary

  • No issues found in the diff.

Testing

  • Not run (automation)

@tiann
tiann merged commit 10f7e14 into tiann:main Feb 25, 2026
2 checks passed
Unintendedz referenced this pull request in Unintendedz/hapii Mar 3, 2026
Co-authored-by: Lihengwannafly <Lihengwannafly@users.noreply.github.com>
jasonczc added a commit to jasonczc/haqi that referenced this pull request Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants