Skip to content

docs(#7042): say the budget kill sweeps, best effort, and why - #7064

Open
waynesun09 wants to merge 1 commit into
mainfrom
docs-7042-terminate-wording
Open

docs(#7042): say the budget kill sweeps, best effort, and why#7064
waynesun09 wants to merge 1 commit into
mainfrom
docs-7042-terminate-wording

Conversation

@waynesun09

Copy link
Copy Markdown
Member

Follow-up to #7049 (ADR 0105). Docs only.

The budget-and-deadline docs said the runner "terminates the agent's processes" at the budget. What the code does is end the exec and run the stray-process sweep, which is best effort by its own contract. OpenShell has no per-exec kill by design: an exec's processes are not expected to exit with the caller, and a runner that reuses one sandbox across execs owns their cleanup (NVIDIA/OpenShell#3159 was closed as expected usage, not as a refused feature).

Refs #7042.

The budget-and-deadline docs said the runner "terminates the agent's
processes" at the budget. What the code does is end the exec and run the
stray-process sweep, which is best effort by its own contract: OpenShell
has no per-exec kill by design, an exec's processes are not expected to
exit with the caller (NVIDIA/OpenShell#3159, closed as expected usage,
not as a refused feature). Align run.md and the harness reference with
the rule bullet that already said so, and add a short note to ADR 0105
connecting its #3159 citation to that reading. The console blocks are
real output and stay as pasted.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Clarify best-effort timeout process cleanup

📝 Documentation 🕐 Less than 10 minutes

Grey Divider

AI Description

• Clarifies timeout cleanup as a best-effort sweep, not guaranteed process termination.
• Documents OpenShell's intentional process lifecycle contract and runner cleanup ownership.
• Aligns CLI, harness reference, and ADR wording without changing runtime behavior.
Diagram

graph TD
  Budget["Budget expires"] -->|"triggers"| Exec["End iteration exec"] -->|"then"| Sweep["Best-effort sweep"] -->|"before"| Output["Extract agent output"]
  OpenShell["OpenShell contract"] -->|"requires cleanup"| Sweep
Loading
High-Level Assessment

The documentation-only correction is the appropriate approach: it aligns all user-facing references with existing behavior while preserving ADR 0105's decision. Changing the cleanup implementation or adding per-exec process termination would be a separate behavioral and architectural decision.

Files changed (3) +15 / -7

Documentation (3) +15 / -7
0105-timed-out-iteration-ends-the-run.mdExplain OpenShell cleanup ownership in ADR 0105 +6/-0

Explain OpenShell cleanup ownership in ADR 0105

• Adds a dated note explaining that OpenShell processes intentionally outlive exec callers. It identifies the runner's sweep as best-effort cleanup without modifying the ADR's decision.

docs/ADRs/0105-timed-out-iteration-ends-the-run.md

run.mdCorrect timeout cleanup guarantees in CLI documentation +8/-6

Correct timeout cleanup guarantees in CLI documentation

• Replaces guaranteed process-termination claims with the actual best-effort stray-process sweep. It also links OpenShell issue #3159 and explains why the runner owns sandbox cleanup.

docs/cli/run.md

harness-reference.mdAlign timeout_minutes behavior with best-effort cleanup +1/-1

Align timeout_minutes behavior with best-effort cleanup

• Updates the 'timeout_minutes' reference to state that budget expiry ends the iteration and performs a best-effort sweep of remaining sandbox processes.

docs/reference/harness-reference.md

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 6, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 4:07 PM UTC · Completed 4:20 PM UTC

Commit: e80704f · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.88

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Site preview

Preview: https://ec603eff-site.fullsend-ai.workers.dev

Commit: e80704f8453819481e7d6970e3a173446a0684cc

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Sep 6, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Pure documentation PR touching 3 actively-maintained files with 22 lines changed, clear issue linkage, no security or CI risk — routine but warrants a standard review pass due to active churn on the affected docs.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Low

  • [internal-consistency] docs/ADRs/0105-timed-out-iteration-ends-the-run.md:94 — The appended Note says "The sweep above is that cleanup, and it is best effort", but the Decision section at line 51 says "The runner first terminates the agent's processes in the sandbox." The only occurrences of "sweep" in the Decision are at line 55 (describing OLD behavior) and line 56 ("validation sweep", a different concept). The Note's referent is therefore ambiguous, and the terminology ("terminates" vs. "sweeps"/"best effort") is inconsistent within the ADR. The PR author has acknowledged this is intentional (Decision text is untouched per ADR immutability conventions), but the tension may confuse readers.

  • [naming-convention] docs/cli/run.md:129 — The qualifier "best effort" is formatted inconsistently across the PR's changes. Line 129 uses the comma form ("sandbox, best effort."), while line 181 and harness-reference.md line 146 use the parenthetical form ("sandbox (best effort)"). The difference is partially defensible — at line 129 "best effort" ends the sentence so the comma form reads naturally as an adverbial modifier, whereas mid-sentence the parenthetical avoids parsing ambiguity — but adopting the parenthetical form everywhere would be slightly cleaner for scannability.

Note (2026-09-06): [NVIDIA/OpenShell#3159](https://github.com/NVIDIA/OpenShell/issues/3159)
was closed as expected usage rather than a refused feature: an exec's processes
are not expected to exit with the caller, and a runner that reuses one sandbox
across execs owns their cleanup. The sweep above is that cleanup, and it is

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] internal-consistency

The appended Note says 'The sweep above is that cleanup, and it is best effort', but the Decision section at line 51 says 'The runner first terminates the agent's processes in the sandbox.' The Note's referent is ambiguous and the terminology is inconsistent within the ADR. Acknowledged as intentional (Decision text untouched per ADR immutability), but may confuse readers.

Comment thread docs/cli/run.md
every iteration it tells the agent when that will happen, through two environment variables set on
every runtime (claude, pi, codex):
is spent the runner ends the iteration and sweeps the processes the agent left running in the
sandbox, best effort. Before every iteration it tells the agent when that will happen, through two

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] naming-convention

The qualifier 'best effort' is formatted inconsistently: line 129 uses comma form ('sandbox, best effort.') while line 181 and harness-reference.md line 146 use parenthetical form ('sandbox (best effort)'). The comma form is defensible at end-of-sentence but adopting parenthetical everywhere would be cleaner.

Suggested fix: Change line 129 from 'sandbox, best effort.' to 'sandbox (best effort).' to match the other two occurrences.

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant