#908

HIL: approved gated action runs but its approval card never settles (send_notification path)

Openaryanranderiyaopened 3mo ago

Summary

Approving a gated send_notification sends the notification, but the conversation's approval_request card stays pending indefinitely and no result message is ever delivered.

User-visible symptom: you approve an action, the action happens, and on reload the UI still shows it awaiting your approval.

Found by the new hil eval suite (PR #907), which drives the real interrupt() gate end to end.

Reproduction

Verified by hand against a live API, not inferred:

conv: 64fe5873-… | card status: pending | gated tool: send_notification
POST /api/v1/approvals/{id}/decision  ->  200 {"success":true}
  t+3s   cards=['pending']  msgs=2  notifications=1
  t+6s   cards=['pending']  msgs=2  notifications=1
  …unchanged every 3s…
  t+60s  cards=['pending']  msgs=2  notifications=1

notifications=1 confirms the action ran. cards=['pending'] and a message count frozen at 2 confirm neither the card settle nor the result message was ever persisted.

Why it is path-specific

The identical flow with a gated create_tracked_todo settles to approved in ~3–6s:

tool_calls: ['call_executor','search_todo_context','read','create_tracked_todo']
end_state:  {'cards': ['pending','approved'], 'todos_containing': 1}

So this is not a polling artefact and not a too-short timeout.

Where to start (hypothesis, NOT verified)

  • app/services/hil/bridge.py publish_decision writes the settled card to the stream the run is on now
  • app/agents/core/background/result_delivery.py / executor_capture.drain_executor_tool_data persist a queued run's tool_data

One of those two is not happening for this path. Root cause has deliberately not been guessed at.

Eval coverage

hil-notify-approve in apps/api/scripts/evals/data/hil/approval_gate.yaml asserts cards: [approved] and is red on purpose, tagged known-defect with this reproduction inline. The assertion was deliberately not weakened — it is the only signal pointing at this bug.

Related

Separate issue on the same cases: on flash-class models the agent often never calls the gated tool at all (loops on get_notification_preferences/read_manual), so no card exists to decide on. Different problem, different owner.

Activity

0

No activity yet.