You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: request_human_input crashes uncaught when an approval is already pending on the thread — expected conflict surfaced as a plain server Error (5 events, 08-07→08-12) #3111
Source: GlitchTip sweep of demo.tale.dev, 2026-08-31. Related-but-distinct precedents: #2056 (closed — raw backend Errors reach the chat approval/human-input cards with no actionable message), #2767 (open — human-input pause banner), #2079 (closed — todo_list field validation).
Evidence
TALE-PROJECT-10N — Uncaught Error: Cannot create approval: another approval is already pending on this thread. Wait for the existing approval to be resolved before creating a new one. — 5 events, 2026-08-07T21:40:54Z → 2026-08-12T13:27:13Z. Stack: agent_tools/human_input/internal_mutations.ts:137 (createHumanInputRequest mutation) → approvals/helpers.ts:288 (createApproval). Both modules are private-overlay (the public tree's convex/approvals/ carries only policy/validators).
Context: the 08-12T13:27Z event sits inside the same session window as the empty-response chat-turn failures (TALE-PROJECT-113, 13:02→13:30Z) — consistent with an agent retrying a turn and re-issuing its human-input request against a still-pending approval.
Read
The one-pending-approval-per-thread invariant is fine; the failure mode isn't. When an agent turn (or a double-fired tool call / retried mutation) requests human input while an approval is already pending, createApproval throws a plain uncaught Error: it records an error-level GlitchTip event for an expected conflict, and — exactly the pattern #2056 documented — an unstructured plain Error gives the client and the agent nothing actionable, so the turn dies instead of converging on the existing request.
Fix direction
Make it a structured expected conflict: throw ConvexError (e.g. code APPROVAL_ALREADY_PENDING, carrying the pending approval id) instead of a plain Error.
Better: make createHumanInputRequest idempotent for this case — if a pending approval exists on the thread, return/attach to it rather than erroring, so a retried agent turn converges.
Requesting human input on a thread that already has a pending approval yields a structured refusal or the existing request — never an uncaught plain Error.
TALE-PROJECT-10N stays flat; an agent that double-requests human input recovers instead of failing the turn.
Closing as obsolete. The throw exists nowhere at v0.5.58. Chat's ask_question is off the wire, the automation ask_human door is idempotent (INSERT … ON CONFLICT … WHERE status='pending' DO UPDATE in backend/domains/automations/ask-shim.ts, migration 0082), and the connector approval gate is idempotent per operation (backend/domains/approvals/gate.ts).
Activity
yannickmonney commentedon Sep 27, 2026
Closing as obsolete. The throw exists nowhere at v0.5.58. Chat's
ask_questionis off the wire, the automationask_humandoor is idempotent (INSERT … ON CONFLICT … WHERE status='pending' DO UPDATEinbackend/domains/automations/ask-shim.ts, migration 0082), and the connector approval gate is idempotent per operation (backend/domains/approvals/gate.ts).