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
- Run an agent until it parks on a tool that needs approval. The runner keeps the session alive
for five minutes.
- 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.
- The second answer matches no parked gate. The runner logs an eviction and tears the live
session down:
[keepalive] approval-mismatch ... ; evict + cold
- 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.
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
for five minutes.
A double click, an HTTP retry, or a second click racing the row's pending to resolved
transition all produce this.
session down:
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.