Skip to content

Native supervision adoption and guarded cold restore - #2

Open
olety wants to merge 3 commits into
review/factory-deployed-base-ab54835bfrom
factory/native-supervision-20260906
Open

Native supervision adoption and guarded cold restore#2
olety wants to merge 3 commits into
review/factory-deployed-base-ab54835bfrom
factory/native-supervision-20260906

Conversation

@olety

@olety olety commented Sep 7, 2026

Copy link
Copy Markdown
Member

Scope

Native atomic supervision adoption with stable session UUID/task custody, current-parent family permissions, CAS/idempotent durable ledger, and controlled cold restore. Preserves current owner identities and accepted events. Adds guarded no-force mode for the new runtime.

Validation

  • 120 focused tests covered: combined117PASS/3FAIL, then only3failures passed with documented native Python environment and serial process startup. Original errors retained; no timeout increase.
  • Exact installed .10 supervisor AND worker -> candidate cold restore process rehearsal passed. Independent process sentinel survives; stable UUIDs/handles/accepted messages/events/alias routing proved.
  • npm run check passed.
  • Resident parent metadata copy bug found by real restore test and corrected.

Activation

Source only. No live restart, reparent, install or product-job termination. One-time old .10 transition requires verified natural dependent-job drain/checkpoint and required reviews/package. New no-force capability fence is preserved. The old .10 internal forced-completion branch is documented, not hidden.

Review base

Uses exact deployed source review base ab54835, not stale fork main. No factory settlement edits included; those are independent PR1.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Essentials

Run ID: 42be4711-351b-41de-99e6-8b4f4cf83774

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Touches daemon protocol version, RLM topology authority, signed adoption, and update-restart coordination—errors could mis-route families or leave checkpoints in an ambiguous fenced state.

Overview
Introduces signed, CAS-guarded RLM supervision adoption so resident sessions can be reparented in place: the spawn ledger gains v2 atomic adopt records (filesystem lock + rename), daemon protocol v8 with supervision_snapshot / adopt_supervision, Ed25519 owner verification, and in-worker runtime commits (prepareRlmChildTransfer, topology updates) without recreating child tasks or messages. Family catalogs, parent resolution, and agent messaging now treat the ledger as authoritative over stale header metadata, including after adoption or restore.

Adds capability-gated no-force daemon update checkpoints (no_force_update_restart): workers must prove idle/safe sessions (including Python kernel custody probes) before a cold manifest is written; restore aliases remap old activeSessionIds, manifests are fsync’d, and forced worker kill / continuation prompts are skipped unless --force. CLI gains daemon supervision and wires default package updates to no-force restart when not forcing.

Reviewed by Cursor Bugbot for commit 5a2986a. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_7a6fc782-c525-4452-b7c7-97681c7e97d4)

@olety

olety commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

/agentic_review
Review exact 2b40535. Focus atomic reparent ownership/CAS/durable retry, current-parent cancellation and family permissions, cold restore queue/event/task alias custody, fail-closed no-force behavior. No live activation. Exact old .10 transition conditions documented in PR.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Adopt native supervision with guarded no-force cold restore

✨ Enhancement 🐞 Bug fix 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Atomically adopts supervision topology while preserving session identities, tasks, messages, and
 permissions.
• Adds capability-gated no-force checkpoints and verified cold restore aliases without forced
 termination.
• Hardens ledger durability and validates cross-version process continuity.
Diagram

sequenceDiagram
    actor Owner
    participant CLI as Daemon CLI
    participant Coord as Restart Coordinator
    participant Sup as Daemon Supervisor
    participant Worker as Session Worker
    participant Runtime as Resident Sessions
    participant Ledger as RLM Ledger
    participant Restore as Successor Daemon
    Owner->>CLI: Sign adoption request
    CLI->>Sup: Snapshot or adopt
    Sup->>Worker: Verify capability and route
    Worker->>Ledger: CAS atomic adoption
    Worker->>Runtime: Commit custody and topology
    Coord->>Sup: Prepare no-force restart
    Sup->>Worker: Fence and checkpoint
    Worker->>Runtime: Verify idle process custody
    Worker-->>Sup: Durable manifest
    Sup-->>Coord: Identities and aliases
    Coord->>Restore: Start cold restore
    Restore->>Runtime: Rehydrate preserved sessions
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Recreate adopted sessions
  • ➕ Simplifies in-memory parent ownership changes.
  • ➕ Avoids transferring active child-run bookkeeping between owners.
  • ➖ Changes runtime identities and risks losing stable task handles.
  • ➖ Requires replay or migration of accepted messages and active event custody.
  • ➖ Introduces provider and kernel restart side effects.
2. Rewrite session parent metadata
  • ➕ Makes transcript headers directly reflect the latest topology.
  • ➕ Reduces reliance on a separate authoritative ledger overlay.
  • ➖ Mutates historical session artifacts and admission provenance.
  • ➖ Cannot atomically update multiple files and live runtimes across processes.
  • ➖ Makes retries, rollback, and crash recovery substantially harder.

Recommendation: Keep the PR's append-only, CAS-protected ledger adoption with a synchronous resident custody commit. It best preserves existing identities and accepted work while providing idempotent retries, explicit authorization, fail-closed compatibility fencing, and durable rollback through inverse batches; recreating sessions or rewriting transcript metadata would weaken continuity and atomicity.

Files changed (27) +3490 / -115

Enhancement (14) +1245 / -109
daemon-command.tsExpose supervision snapshot and adoption commands +22/-0

Expose supervision snapshot and adoption commands

• Adds CLI support for requesting supervision snapshots and submitting signed adoption requests from JSON files.

packages/coding-agent/src/cli/daemon-command.ts

daemon-update-restart.tsPersist durable cold-restore alias mappings +78/-3

Persist durable cold-restore alias mappings

• Adds validated active-session alias sidecars for native restoration and strengthens atomic JSON writes with file and directory fsync. Introduces the internal no-force coordinator flag.

packages/coding-agent/src/cli/daemon-update-restart.ts

agent-session-runtime.tsCommit adopted parent metadata in place +8/-0

Commit adopted parent metadata in place

• Adds an in-memory commit operation that changes a resident session's parent coordinates without rebuilding its runtime.

packages/coding-agent/src/core/agent-session-runtime.ts

agent-session.tsTransfer live child custody and enforce safe checkpoints +159/-35

Transfer live child custody and enforce safe checkpoints

• Transfers retained and running RLM child bookkeeping between resident parents while preserving terminal-event ownership. Adds topology prompt refreshes and comprehensive no-force busy-state checks without interrupting work.

packages/coding-agent/src/core/agent-session.ts

repl-manager.tsReport kernel process custody and checkpoint blockers +37/-0

Report kernel process custody and checkpoint blockers

• Tracks queued executions and exposes kernel PID and lifecycle blockers used to reject unsafe no-force checkpoints.

packages/coding-agent/src/core/kernel/repl-manager.ts

shared.tsExtend kernel custody inspection contract +2/-0

Extend kernel custody inspection contract

• Adds process identity and no-force blocker fields to the shared kernel client interface.

packages/coding-agent/src/core/kernel/shared.ts

ipython.tsValidate Python custody without replacing kernels +61/-1

Validate Python custody without replacing kernels

• Refreshes RLM environment values before each user cell. Adds bounded inspection for background tasks, threads, scheduled callbacks, and child processes before no-force checkpoints.

packages/coding-agent/src/core/tools/ipython.ts

daemon-mode.tsAdopt resident topology and fence no-force checkpoints +235/-25

Adopt resident topology and fence no-force checkpoints

• Coordinates signed ledger adoption with same-worker runtime custody commits and makes ledger topology authoritative for routing and family permissions. Adds worker-wide runtime and process-custody checks for guarded restart manifests.

packages/coding-agent/src/modes/daemon/daemon-mode.ts

daemon-supervisor.tsGuard supervision publication and no-force worker shutdown +135/-14

Guard supervision publication and no-force worker shutdown

• Requires every resident worker to support the v2 ledger before adoption, resolves verified restore aliases, and aggregates no-force checkpoints. Uncertain commits retain admission fences and never fall back to forced worker termination.

packages/coding-agent/src/modes/daemon/daemon-supervisor.ts

daemon-worker-protocol.tsPropagate no-force mode through worker transactions +2/-2

Propagate no-force mode through worker transactions

• Adds the optional no-force marker to worker prepare and commit commands so mode mismatches fail closed.

packages/coding-agent/src/modes/daemon/daemon-worker-protocol.ts

rlm-ledger.tsAdd atomic CAS-protected supervision ledger adoption +243/-21

Add atomic CAS-protected supervision ledger adoption

• Introduces v2 adoption records, filesystem writer serialization, topology revisions, idempotent receipts, and atomic rename publication. Replay validates revisions and old-edge state while preserving original admission parents.

packages/coding-agent/src/modes/daemon/rlm-ledger.ts

rlm-supervision.tsValidate and plan supervision topology changes +185/-0

Validate and plan supervision topology changes

• Defines signed batch request and receipt types and computes complete topology updates. Rejects stale parents, cycles, cross-root moves, collisions, invalid identities, and depth-limit violations before publication.

packages/coding-agent/src/modes/daemon/rlm-supervision.ts

supervision-authorization.tsAuthorize adoption with owner-held Ed25519 keys +16/-0

Authorize adoption with owner-held Ed25519 keys

• Verifies normalized supervision requests against the configured owner public key without accepting request-supplied key material.

packages/coding-agent/src/modes/daemon/supervision-authorization.ts

package-manager-cli.tsCoordinate capability-gated no-force cold restores +62/-8

Coordinate capability-gated no-force cold restores

• Carries no-force mode through preparation and restoration, rejects legacy downgrade paths, and verifies restored identities, messages, and action IDs. Incomplete restores retain their native checkpoint for recovery.

packages/coding-agent/src/package-manager-cli.ts

Tests (11) +2206 / -1
daemon-no-force-supervisor.test.tsTest supervisor no-force commit fencing +83/-0

Test supervisor no-force commit fencing

• Verifies unsupported workers are rejected before preparation, uncertain commits preserve the fence, and successful commits use only no-signal worker shutdown.

packages/coding-agent/test/daemon-no-force-supervisor.test.ts

daemon-protocol.test.tsTest protocol capability gates for no-force restart +18/-1

Test protocol capability gates for no-force restart

• Confirms legacy update commands remain compatible while no-force requests require protocol 8, schema 30, and the new capability.

packages/coding-agent/test/daemon-protocol.test.ts

exact-predecessor-bootstrap.test.tsRehearse cold restore from the exact deployed predecessor +535/-0

Rehearse cold restore from the exact deployed predecessor

• Runs the installed predecessor supervisor and worker through a natural checkpoint and restores them into the new runtime. Verifies UUIDs, aliases, events, jobs, topology, and an independent process survive without forced termination.

packages/coding-agent/test/exact-predecessor-bootstrap.test.ts

native-supervision-faux-extension.tsProvide deterministic model boundaries for process tests +52/-0

Provide deterministic model boundaries for process tests

• Registers a faux provider that can pause at and resume from an externally controlled natural model boundary.

packages/coding-agent/test/fixtures/native-supervision-faux-extension.ts

native-supervision-old-worker.tsSimulate an incompatible resident worker +112/-0

Simulate an incompatible resident worker

• Provides a protocol-7 worker fixture used to prove old ledger readers are fenced before v2 adoption publication.

packages/coding-agent/test/fixtures/native-supervision-old-worker.ts

kernel-no-force-checkpoint.test.tsTest kernel checkpoint blocker reporting +23/-0

Test kernel checkpoint blocker reporting

• Covers unstarted kernels and busy execution, host-request, repair, and teardown states.

packages/coding-agent/test/kernel-no-force-checkpoint.test.ts

native-supervision-process.test.tsExercise native adoption and restore across real processes +515/-0

Exercise native adoption and restore across real processes

• Tests concurrent adoption CAS, incompatible-reader fencing, lost-response idempotency, pending delivery preservation, stable aliases, and no-force cold restore with an independent sentinel process.

packages/coding-agent/test/native-supervision-process.test.ts

native-supervision-runtime.test.tsVerify in-place resident custody transfer +288/-0

Verify in-place resident custody transfer

• Confirms adoption preserves runtime objects, task handles, queued work, and terminal events while updating parent permissions and future kernel depth. Also covers authorization and resident preflight failures.

packages/coding-agent/test/native-supervision-runtime.test.ts

package-self-update-daemon.test.tsTest no-force self-update coordinator behavior +54/-0

Test no-force self-update coordinator behavior

• Ensures old daemons and uncertain preparations fail before shutdown, no legacy downgrade occurs, and supported no-force coordination avoids package installation.

packages/coding-agent/test/package-self-update-daemon.test.ts

rlm-supervision-adoption.test.tsTest atomic supervision ledger semantics +310/-0

Test atomic supervision ledger semantics

• Covers large topology plans, CAS and authorization failures, idempotent replay, inverse rollback, competing writers, publication failure, and torn-tail recovery.

packages/coding-agent/test/rlm-supervision-adoption.test.ts

worker-no-force-checkpoint.test.tsTest worker runtime and process custody checkpoints +216/-0

Test worker runtime and process custody checkpoints

• Validates Python background-work inspection, busy model refusal, process-journal failures, commit-time rechecks, mode mismatch rejection, and queued action preservation.

packages/coding-agent/test/worker-no-force-checkpoint.test.ts

Documentation (1) +3 / -0
native-supervision-ledger.mdDocument native supervision and guarded cold restore +3/-0

Document native supervision and guarded cold restore

• Adds release notes for signed atomic adoption, no-force checkpoints, stable aliases, and corrected parent routing.

packages/coding-agent/.changes/native-supervision-ledger.md

Other (1) +36 / -5
daemon-protocol.tsVersion native supervision and no-force protocol capabilities +36/-5

Version native supervision and no-force protocol capabilities

• Advances protocol and schema versions, declares native supervision and no-force capabilities, and adds their commands and manifest fields. Compatibility rules prevent unsupported peers from receiving these operations.

packages/coding-agent/src/modes/daemon/daemon-protocol.ts

@qodo-code-review

qodo-code-review Bot commented Sep 7, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. No-force restarts cannot be launched ✓ Resolved 🐞 Bug ≡ Correctness
Description
launchDaemonUpdateRestartCoordinator has no no-force option and never includes
DAEMON_UPDATE_RESTART_NO_FORCE_FLAG in the coordinator subprocess arguments, while
package-manager-cli only consumes that flag after the subprocess has already started. Normal
update callers therefore always start the coordinator without no-force mode, so the new custody
checks and guarded cold restore are unavailable outside a manual invocation of internal-only flags.
Code

packages/coding-agent/src/package-manager-cli.ts[R282-285]

+		if (arg === DAEMON_UPDATE_RESTART_NO_FORCE_FLAG) {
+			restartNoForce = true;
+			continue;
+		}
Evidence
The added parser recognizes the internal no-force flag, but the existing coordinator-launch API
exposes no corresponding option and its argv construction omits the flag. Both production callers
use that launcher, so neither can activate the conditional no-force behavior in the coordinator.

packages/coding-agent/src/package-manager-cli.ts[282-285]
packages/coding-agent/src/package-manager-cli.ts[1499-1521]
packages/coding-agent/src/cli/daemon-update-restart.ts[143-149]
packages/coding-agent/src/cli/daemon-update-restart.ts[625-633]
packages/coding-agent/src/modes/interactive/interactive-mode.ts[8974-8979]
packages/coding-agent/src/package-manager-cli.ts[1669-1674]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The no-force restart flag is parsed only inside the coordinator process, but the normal launcher never passes that flag to its coordinator subprocess. As a result, standard update flows cannot select the new no-force checkpoint path.

## Issue Context
Add a no-force field to the coordinator-launch options, append the internal flag when requested, and pass it from the caller that initiates a no-force update. Preserve the existing default behavior when it is absent.

## Fix Focus Areas
- packages/coding-agent/src/cli/daemon-update-restart.ts[143-149]
- packages/coding-agent/src/cli/daemon-update-restart.ts[625-633]
- packages/coding-agent/src/package-manager-cli.ts[282-285]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Customers see an internal changelog entry ✓ Resolved 📘 Rule violation ⚙ Maintainability ⭐ New
Description
The new bullet describes update launch forwarding, checkpoint fences, and `kernel custody
probes` rather than a user-visible behavior or outcome. It also joins the forwarding fix and
probe-settlement handling in one entry, so release-note readers receive two implementation changes
as a single opaque item.
Code

packages/coding-agent/.changes/native-supervision-ledger.md[4]

+- Fixed no-force update launch forwarding and retained checkpoint fences until timed-out kernel custody probes settle.
Evidence
Compliance rule 2918948 requires each changed bullet to describe a user-visible outcome and not
combine distinct changes. The focused line instead documents internal forwarding, checkpoint fences,
and kernel probe settlement in one bullet.

Rule 2918948: Changelog entries use flat dash bullets with past-tense verb prefixes
packages/coding-agent/.changes/native-supervision-ledger.md[4-4]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Rewrite the changelog bullet as one user-visible outcome, avoiding internal implementation terminology and multiple changes joined by `and`.

## Issue Context
The fragment must use flat dash bullets beginning with an allowed past-tense verb, and each bullet must describe one user-visible behavior or outcome.

## Fix Focus Areas
- packages/coding-agent/.changes/native-supervision-ledger.md[4-4]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Timed-out checks delay later work ✓ Resolved 🐞 Bug ☼ Reliability
Description
assertNoForceUpdateCustody races an explicitly non-abortable kernel execution against a
five-second timeout without cancelling or draining the execution when the timeout wins. When
preparation consequently unwinds and releases its input and kernel pauses, the serialized request
can continue outside the checkpoint fence and delay subsequent user cells.
Code

packages/coding-agent/src/core/tools/ipython.ts[R377-380]

+			const result = await Promise.race([
+				manager.execute(`exec(${JSON.stringify(code)}, {})`, { internal: true }),
+				new Promise<never>((_, reject) => {
+					timeout = setTimeout(
Evidence
The custody method deliberately starts manager.execute without an abort signal and only clears the
timer after Promise.race, so timeout rejection does not settle the execution. ReplKernelManager
keeps every execution pending until its eventual finally, while update-preparation cancellation
releases all queue, input, and kernel pause handles.

packages/coding-agent/src/core/tools/ipython.ts[376-390]
packages/coding-agent/src/core/kernel/repl-manager.ts[859-864]
packages/coding-agent/src/modes/daemon/daemon-mode.ts[7066-7068]
packages/coding-agent/src/modes/daemon/daemon-mode.ts[7157-7179]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A timed-out Python custody check remains queued or running because its execution promise is neither cancelled nor drained. Ensure the failed no-force preparation does not release its checkpoint pauses until this internal request has settled, without interrupting unrelated user execution.

## Issue Context
Kernel executions are serialized and remain counted until their promise settles. The update-preparation failure path currently releases all acquired pauses immediately.

## Fix Focus Areas
- packages/coding-agent/src/core/tools/ipython.ts[376-390]
- packages/coding-agent/src/modes/daemon/daemon-mode.ts[7066-7068]
- packages/coding-agent/src/modes/daemon/daemon-mode.ts[7157-7176]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 9 rules
✅ REVIEW.md
Review mode: 🧠 Deep: The latest push changes several independent update, daemon-fencing, kernel-custody, and CLI forwarding paths with concurrency-sensitive cleanup behavior, making redundant review materially valuable.

Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 5a2986a

Results up to commit 2b40535 🧠 Deep


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. No-force restarts cannot be launched ✓ Resolved 🐞 Bug ≡ Correctness
Description
launchDaemonUpdateRestartCoordinator has no no-force option and never includes
DAEMON_UPDATE_RESTART_NO_FORCE_FLAG in the coordinator subprocess arguments, while
package-manager-cli only consumes that flag after the subprocess has already started. Normal
update callers therefore always start the coordinator without no-force mode, so the new custody
checks and guarded cold restore are unavailable outside a manual invocation of internal-only flags.
Code

packages/coding-agent/src/package-manager-cli.ts[R282-285]

+		if (arg === DAEMON_UPDATE_RESTART_NO_FORCE_FLAG) {
+			restartNoForce = true;
+			continue;
+		}
Evidence
The added parser recognizes the internal no-force flag, but the existing coordinator-launch API
exposes no corresponding option and its argv construction omits the flag. Both production callers
use that launcher, so neither can activate the conditional no-force behavior in the coordinator.

packages/coding-agent/src/package-manager-cli.ts[282-285]
packages/coding-agent/src/package-manager-cli.ts[1499-1521]
packages/coding-agent/src/cli/daemon-update-restart.ts[143-149]
packages/coding-agent/src/cli/daemon-update-restart.ts[625-633]
packages/coding-agent/src/modes/interactive/interactive-mode.ts[8974-8979]
packages/coding-agent/src/package-manager-cli.ts[1669-1674]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The no-force restart flag is parsed only inside the coordinator process, but the normal launcher never passes that flag to its coordinator subprocess. As a result, standard update flows cannot select the new no-force checkpoint path.

## Issue Context
Add a no-force field to the coordinator-launch options, append the internal flag when requested, and pass it from the caller that initiates a no-force update. Preserve the existing default behavior when it is absent.

## Fix Focus Areas
- packages/coding-agent/src/cli/daemon-update-restart.ts[143-149]
- packages/coding-agent/src/cli/daemon-update-restart.ts[625-633]
- packages/coding-agent/src/package-manager-cli.ts[282-285]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Timed-out checks delay later work ✓ Resolved 🐞 Bug ☼ Reliability
Description
assertNoForceUpdateCustody races an explicitly non-abortable kernel execution against a
five-second timeout without cancelling or draining the execution when the timeout wins. When
preparation consequently unwinds and releases its input and kernel pauses, the serialized request
can continue outside the checkpoint fence and delay subsequent user cells.
Code

packages/coding-agent/src/core/tools/ipython.ts[R377-380]

+			const result = await Promise.race([
+				manager.execute(`exec(${JSON.stringify(code)}, {})`, { internal: true }),
+				new Promise<never>((_, reject) => {
+					timeout = setTimeout(
Evidence
The custody method deliberately starts manager.execute without an abort signal and only clears the
timer after Promise.race, so timeout rejection does not settle the execution. ReplKernelManager
keeps every execution pending until its eventual finally, while update-preparation cancellation
releases all queue, input, and kernel pause handles.

packages/coding-agent/src/core/tools/ipython.ts[376-390]
packages/coding-agent/src/core/kernel/repl-manager.ts[859-864]
packages/coding-agent/src/modes/daemon/daemon-mode.ts[7066-7068]
packages/coding-agent/src/modes/daemon/daemon-mode.ts[7157-7179]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A timed-out Python custody check remains queued or running because its execution promise is neither cancelled nor drained. Ensure the failed no-force preparation does not release its checkpoint pauses until this internal request has settled, without interrupting unrelated user execution.

## Issue Context
Kernel executions are serialized and remain counted until their promise settles. The update-preparation failure path currently releases all acquired pauses immediately.

## Fix Focus Areas
- packages/coding-agent/src/core/tools/ipython.ts[376-390]
- packages/coding-agent/src/modes/daemon/daemon-mode.ts[7066-7068]
- packages/coding-agent/src/modes/daemon/daemon-mode.ts[7157-7176]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread packages/coding-agent/src/core/tools/ipython.ts
Comment thread packages/coding-agent/src/package-manager-cli.ts
@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e3cb60e9-1ea6-43d3-9e2c-a9c6bdc819a6)

@olety

olety commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

/agentic_review
Exact updated head 66b3f2a. Both prior bugs fixed with tests-first evidence: actual launcher/caller noForce forwarding; timed-out custody probes retain owned transaction fences until settlement, no abort/user interruption.110distinctaffectedtests/checkPASS. Review the changed implementation and regression evidence; no live activation.

Comment thread packages/coding-agent/.changes/native-supervision-ledger.md Outdated
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 66b3f2a

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_840a1ff7-9337-4821-aabb-fff869a3f52c)

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