fix(frontend): request_input renders its form again after the transcript replay - #5859
Conversation
…ipt replay
The client-tool branch of the durable-record replay adapter was never
written ('v1 scope: HITL approvals only'), so a parked request_input
replayed as a bare tool part with no data-render sibling; the dispatcher
matched neither axis and fell through to UnhandledClientTool, which
auto-settled {status: not_handled}. The LIVE render was fine - the
watermark reset at turn end made hydration adopt the server transcript
seconds later, which is why the form flipped to 'Not handled' after
parking.
- transcriptToMessages (oss + agenta-chat parity copies): replay a parked
client_tool interaction as the tool part plus its render hint.
- registry: request_input resolves by tool NAME as the second dispatch
axis (same as request_connection), covering transcripts persisted
before the hint existed.
- agentApprovalResume: request_input joins CLIENT_TOOL_NAMES.
Proven against the real 17 records of the failing session: renderKind
undefined -> elicitation, and each half of the fix independently restores
dispatch. 158/244/215/338 tests pass across the four packages; tsc,
eslint, prettier clean.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
📝 WalkthroughSummary by CodeRabbit
WalkthroughParked ChangesClient-tool replay and resume
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant DurableTranscript
participant transcriptToMessages
participant replayClientTool
participant MessageParts
DurableTranscript->>transcriptToMessages: client_tool interaction_request
transcriptToMessages->>replayClientTool: client-tool payload
replayClientTool->>MessageParts: update or synthesize tool part
replayClientTool->>MessageParts: append data-render when hinted
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Railway Preview Environment
Updated at 2026-08-10T10:52:50.373Z |
Mahmoud's regression: an agent calls
request_inputwith a schema, and instead of the question form the chat shows "Not handled by this client."Root cause — not a broken renderer, a missing replay branch
The live render worked. The durable-record replay adapter (
transcriptToMessages) had never implemented the client-tool branch (// v1 scope: HITL approvals only), so when the record watermark reset at turn end and hydration adopted the server transcript, the parkedrequest_inputcame back as a bare tool part without itsdata-renderhint. The dispatcher matched neither axis and fell through to the auto-settling "not handled" fallback. That is why the form appeared to work, then flipped seconds after the turn parked.The fix
request_inputresolves by tool name as the second dispatch axis (the same axisrequest_connectionalready uses) — covers transcripts persisted before hints existed.request_inputjoinsCLIENT_TOOL_NAMESin the approval-resume path.No parser change needed —
parseElicitationPayloadalready handles theoneOfoptions andx-ag-stepper; pinned with the verbatim payload from the failing session.Verification
Replayed the REAL 17 records of the failing session through the actual code: before →
renderKind: undefined(unhandled), after →elicitation+ElicitationWidget. Each fix half independently restores dispatch. 158 + 244 + 215 + 338 tests pass across the four touched packages; new tests pin the replay, both dispatch axes, and the verbatim stepper payload.Live repro
New chat on a build-kit agent → ask it to build a PR reviewer → the stepper form must appear AND still be a form 5-10s after the turn parks (the adoption tick that used to break it).