Repository navigation
feat(acp-registry): Registry agents write generated text - #36514
juliusmarminge wants to merge 1 commit into
Conversation
ACP Registry instances rejected every text generation request, so a thread on a Registry agent could not title itself with its own model. Each request now runs in a hidden ACP session that cancels every permission request and is deleted afterwards. For thread titles, the thread's native session is passed along; when the agent negotiated session/fork, the hidden session forks it so the agent reuses the context it already has. The thread's own session is never deleted. Registry instances also join the text generation fallback order. Co-authored-by: Raisal P Wardana <IEatCodeDaily@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| ); | ||
| // Never delete the source: only the sessions opened here. | ||
| const forget = (sessionId: string) => | ||
| Effect.addFinalizer(() => runtime.deleteSession(sessionId).pipe(Effect.ignore)); |
There was a problem hiding this comment.
🟠 High server/textGeneration.ts:50
If an ACP agent advertises session deletion but never answers session/delete, this finalizer waits forever, so Effect.scoped never completes and the three-minute request timeout cannot return; the agent process remains retained. deleteSession has no deadline, and finalizers run uninterruptibly, so bound this cleanup independently, as the probe cleanup does.
- Effect.addFinalizer(() => runtime.deleteSession(sessionId).pipe(Effect.ignore));
+ Effect.addFinalizer(() =>
+ runtime.deleteSession(sessionId).pipe(
+ Effect.timeoutOrElse({ duration: "5 seconds", orElse: () => Effect.void }),
+ Effect.ignore,
+ ),
+ );🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @packages/provider-acp-registry/src/server/textGeneration.ts around line 50:
If an ACP agent advertises session deletion but never answers `session/delete`, this finalizer waits forever, so `Effect.scoped` never completes and the three-minute request timeout cannot return; the agent process remains retained. `deleteSession` has no deadline, and finalizers run uninterruptibly, so bound this cleanup independently, as the probe cleanup does.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosNo All 64 scenario measurements
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — Registry agents can now generate application text, including through automatic provider fallback, and reuse thread context for titles. The default-routing change requires human review; a separate blocking finding also identifies potentially unbounded session cleanup. Needs human approval because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
ACP Registry instances implement text generation in a hidden session that cancels permission requests and is deleted afterwards; thread titles pass the thread's native session so an agent with session/fork forks it instead of starting cold; Registry joins the text generation fallback order; ACP user docs updated. A separate capability that needs the maintainer's call on ACP execution behavior.
Supersedes #34725. The change is @IEatCodeDaily's; their commits are kept.
Layer 2 of 2, on top of #36513.