Repository navigation
fix(web,myra): chat shows pending approvals inline; a parked approval no longer aborts Myra's run (CL-8493) - #896
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Chat page answers approvals.
ApprovalRowmoved out ofworkbench-room-page.tsxintoapps/web/src/chat/approval-row.tsx; the room page imports it unchanged.chat-thread-page.tsx's transcript now callsusePendingApprovals(tenantId)and renders the asks raised by this chat's agent — filtered onagentAddress === chat.agent.liveAddress— inline above the composer.PendingApprovalcarriesagentAddress(already on the stockApprovalResponse) so the filter needs no extra read. The existing SSE inbox subscription now invalidatestenantKeys.pendingApprovalsalongside the chat scope, and approve/deny already invalidate it inonSuccess.Myra's run survives a parked approval. Her step no longer sets a
timeout;buildMyraWorkflow'sMyraWorkflowInputdropsturnTimeoutMsand its positive-integer guard, andASSISTANT_TURN_TIMEOUT_MSis gone frommyra-deploy.ts(both the JSON projection and the bundle build input).Why
A step's
timeoutis an execution budget that stays armed across an approval park.vendor/intx/workflow/src/runtime/run.ts(~1491) is explicit: "Each input park below disarms it before waiting and re-arms a fresh budget on resume; the approval park stays armed." So the 2-minute budget kept counting while therun_shellask sat pending,stepAbort.abort()fired, and the step failed with{"message":"aborted"}, failing the run and releasing the deployment. The approval itself never expires on its own — the stock row hadtimeoutAt: null, the documented hold-indefinitely case — so the step timer was the only clock.timeoutis optional onStepPrimitive(definition/primitives.ts:84) andarmStepTimerinstalls no timer when it is undefined, so omitting it is the supported unbounded shape rather than a large magic number. That matches upstream's own long-lived warm agent:~/abklabs/interchange/tests/workflow-deploy/fixtures/single-step-mail-inbox-agent.tsbuilds thetriggers: "unbounded"mail-triggered step as a barestep({ agent })with no timeout, andsingle-step-mail-interactive-turns.test.tsservices multiple turns on that one run. The old "a wedged inference call would hang a run forever" rationale is not worth aborting every human-in-the-loop turn; an outer cancellation still aborts the step independently of the timer.What a decision returns to the agent: a resolve is a control signal, not a step outcome.
hub-api/src/routes/approvals.tsenqueues a signal keyed on the approval'scorrelationId, andworkflow-host/src/adapters/step-invoker.ts(buildSendMessage, ~719) delivers approve and reject back to the parked reactor as a correlatedInboundMessage. So a denial resumes the same turn as tool-level feedback — the reject route's optionalmessageis described upstream as "feedback to the agent" — it is not a step failure. Atimeout/expiredapproval status would likewise come back through the gate; withtimeoutAt: nullno such deadline is set today.Verified
bunx tsc -p apps/web --noEmit,bun run typecheck,bun run lint,bun run fmt,apps/webbun run build+bun test ./src(582 pass),agents/myrabun run build+bun test ./src(3 pass).agents/myra/src/definition.test.tsswapped its timeout pin for the inverse assertion — the step must carry no timeout. Genuine red/green: it fails against the old definition and is the regression guard for this fix.Not verified
No live run: the dev stack was not started, so the parked-approval-then-approve path was not exercised end to end against a real sidecar, and the chat approval card was not seen rendered in a browser. The reasoning above is read off the vendored runtime and upstream's fixtures.