Skip to content

(bug) An unmatched out-of-band approval answer evicts the parked session #5596

Description

@mmabrouk

An approval answered out of band that matches no parked gate destroys the live session that was
waiting, and the run falls back to a slow cold rebuild.

I expect an answer that matches nothing to be refused, leaving the parked session alone.

Steps to reproduce

  1. Run an agent until it parks on a tool that needs approval. The runner keeps the session alive
    for five minutes.
  2. Answer that approval twice, or answer it after the session has re-parked on a different gate.
    A double click, an HTTP retry, or a second click racing the row's pending to resolved
    transition all produce this.
  3. The second answer matches no parked gate. The runner logs an eviction and tears the live
    session down:
[keepalive] approval-mismatch ... ; evict + cold
  1. The run is rebuilt from scratch instead of resuming from the parked process.

Why it matters now

The policy is old: anything the approval branch cannot match evicts and degrades to cold. It
rarely fired because the only client answering approvals was the playground, which always matched.
Now that answering from an inbox, a webhook or a script is supported (#5593), the traffic that
triggers it is ordinary.

Suggested shape

When the request carries an approval reply and no parked gate matches it, return an error and
leave the session parked, instead of evicting.

Notes

Raised in review of #5593.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions