Skip to content

fix(codex): count structured selections as human turns - #553

Open
gadzbi123 wants to merge 1 commit into
awslabs:v2from
gadzbi123:fix/codex-request-user-input-human-turn
Open

fix(codex): count structured selections as human turns#553
gadzbi123 wants to merge 1 commit into
awslabs:v2from
gadzbi123:fix/codex-request-user-input-human-turn

Conversation

@gadzbi123

Copy link
Copy Markdown

Summary

  • mint the existing HUMAN_TURN audit event after answered Codex request_user_input calls
  • keep typed UserPromptSubmit handling unchanged
  • pin the generated PostToolUse matcher and regenerate all distributions

This fixes approval and interview gates rejecting a structured selection until the user types a second acknowledgment.

Testing

  • bun test tests/unit/t150-codex-packaging.test.ts tests/unit/t132-hooks-doc-count-sync.test.ts tests/unit/t68-version-changelog-sync.test.ts
  • bun scripts/package.ts --check
  • full unit runner: 138/140 files passed; t140 and t142 could not load the optional @anthropic-ai/claude-agent-sdk dependency in this checkout

@apackeer

apackeer commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Thanks, Kacper. This addresses a real Codex gap: structured request_user_input selections still do not mint the human-turn evidence that typed prompts do, so the direction remains useful.

This path needs to preserve the framework's responsibility split: the LLM supplies the knowledge and context needed to present the question, the human supplies judgment by making a selection, and deterministic code verifies and records that decision. The current wiring collapses the last two responsibilities: PostToolUse proves only that the tool returned, but the adapter ignores tool_response and appends HUMAN_TURN unconditionally as though a human had decided.

Codex can return {} in headless mode, and #681 documents cancelled or automatically resolved questions arriving as completed-looking responses. Because HUMAN_TURN authorizes approval and interview gates, the adapter must require an explicit, nonempty human selection and reject empty, cancelled, dismissed, timed-out, auto-resolved, error, and malformed responses.

Adapter-level tests should cover those cases, a genuine selection, duplicate delivery minting exactly once, no active workflow state, and one real approval/interview path. #692 overlaps the downstream non-answer checks but does not add this Codex registration, so the two pieces need to land coherently.

The upgrade note also needs to tell Codex users to re-run the hook-trust step. There is no need to rebase this stale branch or resolve its old version slot; maintainers can port the corrected change and handle regeneration and versioning.

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