Skip to content

[codex] preserve active background delegations during idle GC - #2254

Merged
EKKOLearnAI merged 1 commit into
mainfrom
agent/preserve-background-delegation-gc
Jul 28, 2026
Merged

[codex] preserve active background delegations during idle GC#2254
EKKOLearnAI merged 1 commit into
mainfrom
agent/preserve-background-delegation-gc

Conversation

@EKKOLearnAI

Copy link
Copy Markdown
Owner

Summary

  • skip Agent Bridge idle-session GC while a session owns a running or finalizing background delegation
  • fall back to worker task telemetry if the durable delegation registry cannot be queried
  • add regression coverage for durable registry state and the worker-state fallback

Refs #2253

Why

The bridge considered only the parent session's running flag and last_used_at. Once the foreground turn ended, a healthy background delegation could outlive the 30-minute session idle timeout, causing GC to destroy the parent session and interrupt its background work.

Impact

Long-running background delegations now keep their owning bridge session alive. Once no active background work remains, normal idle cleanup resumes. This PR intentionally does not change interrupted/cancelled notification delivery.

Validation

  • npm run test -- tests/server/agent-bridge-python-concurrency.test.ts (37 passed)
  • npm run harness:check
  • git diff --check

@EKKOLearnAI
EKKOLearnAI marked this pull request as ready for review July 28, 2026 11:52
@EKKOLearnAI
EKKOLearnAI merged commit 59049a5 into main Jul 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant