Repository navigation
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Fixes #48999. The |
|
This is the right policy shape for #51343's problem 1 (renew while a human wait is pending, explicit Stop still interrupts) — thanks for including the tests. One heads-up, no action needed: I'm planning to propose a config surface on top of this shape — per-tool wait timeouts, where 0 means never expires — as a follow-up issue, so the renewal policy stays yours and the customization is a layer above it. Happy to help with rebase/testing. |
Issue for this PR
Closes #48999
Type of change
What does this PR do?
The location inactivity sweep interrupts sessions after an hour without durable activity. Waiting for a question or permission answer produces no durable activity, so an unanswered request can be cancelled while the user is away.
Before interrupting owners, check the cached location for pending forms or permissions. If either exists, renew its deadline and leave the original request alive. Protect the whole location so another session waiting for that answer is not interrupted either.
Explicit Stop still works. Locations without pending requests still expire, including stalled executions. An unanswered request retains the location's services in memory. This does not add restart persistence or synchronise new request creation with the eviction check.
Related: anomalyco/opencode#46509: fix(core): preserve approvals across location cleanup. This patch targets the current
v2sweep, which interrupts executions before invalidating the location.How did you verify your code works?
The new wait tests fail without the fix. With it, a question survives 12 simulated hours and accepts its original answer. Tests also cover permission waits, explicit Stop, shared locations, one to three stalled executions, and work admitted during cleanup.
The permission test uses a minimal permission-service fixture; the form and execution services are real. The existing permission suite also passes.
From
packages/core:bun run test test/location-activity.test.ts test/location-layer.test.ts test/permission.test.ts test/form.test.ts146 passed, 2 skipped. Package typecheck, repository-wide
bun run check(35 tasks), and formatting checks passed.Screenshots / recordings
Not a UI change.
Checklist