[codex] support request_user_input app-server events#874
Conversation
chenhg5
left a comment
There was a problem hiding this comment.
APPROVED — clean integration of Codex request_user_input into the existing AskUserQuestion flow.
Review Summary
Solid implementation: routes the new item/tool/requestUserInput server request type through the same EventPermissionRequest + pendingApprovals channel pipeline already used for other Codex approval flows. No new abstractions needed — the existing card/text rendering path just works.
✅ appServerRequestUserInputQuestions() — correct mapping; trims whitespace, skips empty questions, maps options faithfully.
✅ handleRequestUserInput() — mirrors handlePermissionsApproval pattern correctly: registers channel, emits event, waits in goroutine, cleans up, writes JSON-RPC response.
✅ 5-minute timeout with ctx.Done() fallback — both deny correctly. No goroutine leak.
✅ appServerRequestUserInputAnswerValues() handles string / []string / []any / map / struct — the recursive case for nested map is clever and handles Codex's own response shape.
✅ appServerRequestUserInputResponseFromResult() — only populates answers on "allow"; empty map on deny is the right behaviour.
✅ Test coverage: emit event, answer delivery, timeout, deny path all covered. Plus core-level AskUserQuestion rendering tests.
CI all green. LGTM.
07b5ec8 to
bda816a
Compare
bda816a to
b764816
Compare
Summary
item/tool/requestUserInputserver requests.AskUserQuestionpermission flow.answers[question_id].answersresponse shape.Why
Codex app-server exposes a user-input request method, but cc-connect currently treats it as an unknown server request. This lets Codex ask interactive questions through the same platform UI path already used by
AskUserQuestion, without changing Claude Code behavior.Validation
Passed:
go test ./agent/codex -run 'TestAppServerSession_HandleRequestUserInput' -count=1go test ./core -run 'TestProcessInteractiveEvents_AskUserQuestionFromAgent|TestSendAskQuestionPrompt|TestHandlePendingPermission_AskUserQuestion|TestResolveAskQuestionAnswer|TestBuildAskQuestionResponse' -count=1go test ./agent/claudecode -run 'TestParseUserQuestions|TestSummarizeInput_AskUserQuestion' -count=1go test ./agent/codex -count=1go test ./agent/claudecode -count=1go test ./platform/feishu -count=1git diff --checkAlso ran
go test ./... -count=1; local full-suite did not pass for issues outside this PR's scope:cmd/cc-connectandwebsetup fail becauseweb/distis not generated locally.corepath expectation tests under macOS/private/var,daemonlaunchd status, and one Codex runtime-config timing test. The Codex timing test passes when run directly with the new Codex tests.