Skip to content

fix(agents): retain completed exec process owner - #169302

Merged
steipete merged 1 commit into
mainfrom
codex/exec-owner-retention-20261011
Oct 11, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/exec-owner-retention-20261011

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes completed background commands disappearing from the Processes panel when a session uses global scope.

User Impact

Finished commands remain visible to their owning agent until normal process retention expires. Notification routing is still released at completion; no configuration or migration is required.

Why This Change Was Made

Terminal cleanup erased the process's frozen agent owner along with temporary notification routing. Global process observation requires that owner. Preserve it by deleting the erroneous cleanup line instead of introducing a second lookup or fallback.

Evidence

The strengthened runtime regression failed on the original code in all four terminal routing paths, then passed after the repair. It exercises actual execution settlement and verifies that the same process incarnation remains observable to its global owner and is hidden from another agent. Cleanup failure and notification ordering regressions remain green.

Focused execution cleanup and observation suites: 22 tests passed, 57.511 seconds wall time (47.98 seconds Vitest duration, dominated by compiled-worker preparation; test bodies completed in milliseconds). Production delta: -1 line. Fresh independent Codex review through P2: scoped-clean. Exact-head hosted production/test types, lint, guards, ratchets and security-fast passed. The duplicate local type sweep was stopped with exit130 after those hosted results completed; its partial results are not a full local pass.

Separate live reliability baseline at cbb31aa: real OpenAI file work, thread isolation and subagent synthesis passed 3/3, with two isolated scenario workers. This is campaign context, not candidate-head proof for the process repair.

CI run38166950786 attempt1 has five inherited ordinary exec-notification fixture failures and one fail-fast-cancelled sibling. An independent frozen-baseline replay reproduced exactly the same five failures (6 passes/5 failures, wall137.66s). Their causal owner sources are identical in CI base ad83ee1 and tested merge92d129b5bdb61745e1b4affeb790d625e49781c1. These fixtures were left behind by the session-event admission migration and provide no initialized destination. Notification runs before this PR’s changed cleanup line. Landing uses the repository’s attributed inherited-failure admin route; failed or cancelled coverage is not presented as passing. The retired passive notification fallback remains removed.

@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 11, 2026 19:11
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves the agent owner of completed background commands while releasing their notification routing.

Example: Agent main finishes a background command in global scope.

  • Before: The completed command disappears because terminal cleanup removes the agent identity required for global observation.
  • After: The command remains visible to main during normal retention and remains hidden from agent other.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct owner repair with meaningful runtime-boundary coverage; supplied validation remains harness-based rather than shipped-entry-point proof.
Proof confidence 🦐 gold shrimp (3/6) The supplied maintainer-authored classification places this PR outside the ordinary contributor proof gate; inspected coverage exercises runtime settlement and observation with mocked process I/O, while the separate live baseline explicitly excludes this repair.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Recently completed background commands disappear from the Processes panel for sessions using global scope.
Reason: This restores the established process inspection contract through the existing owner; the supplied maintainer classification and prior feature history establish direction.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a current-main process visibility defect with a focused change, and no introduced correctness or security defect was found.

Priority: P2
Reviewed head: bb225b47b08c7d72a4bc84a16533afc1b61d96dd

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Candidate-head execution through a real Gateway and Processes panel in global scope is not supplied; the body reports the focused regression failing before the repair and passing afterward.
Agent review details

How this fits together

Exec runtime registers process records, terminal settlement releases execution context, and the Gateway supplies authorized process summaries to the Processes panel.

flowchart LR
  A[Agent exec request] --> B[Exec runtime]
  B --> C[Process registry]
  B --> D[Terminal settlement]
  D --> C
  C --> E[Scoped process observation]
  E --> F[Gateway authorization and response]
  F --> G[Processes panel]
Loading

Technical review

Best possible solution:

Retain the admission-time agent identity on the existing process record while continuing to release notification routing and apply normal retention.

Do we have a high-confidence way to reproduce the issue?

Yes: current-main settlement clears agentId on the retained record, and the global observation predicate then excludes it; no target code was executed during this read-only review.

Is this the best way to solve the issue?

Yes: removing the erroneous deletion repairs the producer while preserving the existing observation owner, notification ordering, and retention policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7bf555adcaef.

Provenance checked

  • Terminal context cleanup changes intended behavior with a stated reason (9ccfc7d: Release captured notification routing after task settlement and notification handling, including recovery failures.)
  • Terminal cleanup regression expectations keeps the original intent (9ccfc7d: Protect routing release and notification ordering; the changed expectations preserve those contracts while distinguishing the frozen process owner.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9ccfc7d adds src/agents/bash-tools.exec-settlement.ts:62 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9ccfc7d1bea2; files: src/agents/bash-tools.exec-settlement.ts)
  • Shakker: Raw commit e25a981 adds src/agents/bash-process-observation.ts:32 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e25a98150544; files: src/agents/bash-process-observation.ts)

PR surface

Source -1, Tests +11. Total +10 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 0 1 -1
Tests 1 15 4 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 15 5 +10

Review metrics

Metric Value Why it matters
Production versus test LOC Production +0/-1; tests +15/-4 The owner repair simplifies production code and extends an existing regression with observable ownership and incarnation checks.

Labels

Label changes:

  • add P2: Completed process inspection is broken for global scope, with limited blast radius and no loss of the retained process output itself.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Completed process inspection is broken for global scope, with limited blast radius and no loss of the retained process output itself.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 11, 2026, 3:16 PM ET / 19:16 UTC.

@steipete
steipete merged commit 8fc0910 into main Oct 11, 2026
195 of 200 checks passed
@steipete
steipete deleted the codex/exec-owner-retention-20261011 branch October 11, 2026 19:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant