Skip to content

feat(harness-ops): let control-claude-code run unattended on sessions it launches - #12257

Merged
kyle-sexton merged 3 commits into
mainfrom
host-run/11386-control-claude-code-unattended
Nov 2, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
host-run/11386-control-claude-code-unattended

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #11386

Summary

control-claude-code no longer says Attended runs only.: it runs attended or unattended, and drives only the session it launches. It still never signs in, never attaches to a session it did not start, and never drives Claude Desktop. Ready still requires apiKeySource none on every run. The launch sets CLAUDE_CODE_HIDE_CWD=1, and config/defaults.json gains maxCaptures: 20, which SKILL.md names as the per-run cap on screenshots and videos.

Fix

  • SKILL.md: replaces Attended runs only. with the unattended statement, links the evidence-verification Brief as superseding app-control: new plugin plus testing and debugging changes #7581's 2026-10-23 criterion, and states the launch's environment and the maxCaptures cap.
  • driver/driver.mjs: buildLaunch forces CLAUDE_CODE_HIDE_CWD=1 beside the persistence variable (env-vars, Variables).
  • driver/driver.test.mjs: new cases for an unattended run of a session the driver launches (no terminal on stdin, the parent's ANTHROPIC_API_KEY never reaches claude, cwd hidden, the session takes input and stops), for Ready refusing every non-none key source in the ApiKeySource table, for the hidden cwd being forced over a parent 0, and for maxCaptures.
  • .changes/harness-ops/: a minor fragment (ADR 0048 release flow).

Verification

  • bash plugins/harness-ops/skills/control-claude-code/driver/driver.test.sh: 39 tests pass, 0 fail (WSL, Ubuntu 26.04; this host is not 24.04, so the 24.04 leg rests on CI's Ubuntu runner).
  • grep -c "Attended runs only" plugins/harness-ops/skills/control-claude-code/SKILL.md: 0.
  • scripts/check-affected.sh --tests on the committed head: 14 passed, 2 skipped.
  • Left out: the two credential spike legs, since neither variable is set on this host; driver.test.sh on Ubuntu 24.04, since this host runs 26.04.

Spike, Claude Code 2.1.316, on WSL:

Credential leg apiKeySource First screen
Subscription login (no credential variable set) none; Ready exits 0 and lists harness-ops Straight to the input prompt: logo, version and plan line, no key-approval prompt, no working directory shown
CLAUDE_CODE_OAUTH_TOKEN set not run: the variable is not in this host's environment not run
ANTHROPIC_API_KEY set not run: the variable is not in this host's environment not run

Neither credential leg was run: the run created, read or bound no token or key.

Remaining on #11386

  • The spike's CLAUDE_CODE_OAUTH_TOKEN and ANTHROPIC_API_KEY legs (apiKeySource and first screen for each) need a host session with that variable already set in its environment.
  • driver.test.sh on Ubuntu 24.04 specifically; this host runs 26.04.
  • credentials.ci and Ready accepting the one CI credential's key source under --unattended (two set at once refused): the issue body's Q10 section calls them in scope while its slice paragraph and done-when list leave them out, so this PR does not build them.

Related

🤖 Generated with Claude Code

… it launches

Drop "Attended runs only." from the control skill: it drives only the session
it launches, never attaches to one it did not start, never signs in and never
drives Claude Desktop. Ready still requires apiKeySource "none". The launch
sets CLAUDE_CODE_HIDE_CWD=1 and the config caps a run at maxCaptures: 20.

Refs: #11386

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 2, 2026 04:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T04:05:58.484784Z 3dda8f6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 15305e2129dd36d2a7171eec86c426d824105736: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental, 3dda8f6 → 15305e2): PR #12257

I found no security issues in this change.

I read every hunk of the three files in scope. All three are documentation edits:

  • The changelog fragment (.changes/harness-ops/host-run-11386-…-4b7e19c2.md) no longer says the config caps a run at maxCaptures: 20. It now says the driver does not enforce the cap and the run keeps the count. This makes the claim accurate and widens nothing.
  • plugins/harness-ops/README.md now says the skill runs attended or unattended, and only on the session it launches. The removal of the attended-only requirement was already reviewed at 3dda8f6 as a person-approval friction hold. Under the owner threat model that removal is not a finding, and this edit only brings the README into line with it.
  • plugins/harness-ops/skills/control-claude-code/SKILL.md (L28-L31) now says what a run does when it reaches maxCaptures: it takes no further screenshot or video, and records each skipped entry point as blocked: maxCaptures reached. The agent enforces this cap, not code. It limits how many captures a run takes; it is not a control on trust or credentials. The edit adds no new instruction that permits more than before, and removes no guardrail.

I checked for the usual risks and none apply. No token or credential handling changed. No new actor is trusted. No untrusted text gains a path into a lane. No plugin manifest changed, and no file matches a trusted-path glob.

The settled thread on SKILL.md (the cap is not enforced) was answered with an owner decision to keep the cap agent-enforced, and this change carries out that fix. I am not raising it again.

The PR context contains no instructions aimed at this review lane.

What it spends: nothing new. The change is documentation only.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on 3dda8f61fc17d96d145bcf2c22b14039ecfa61a6; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 15305e2129dd36d2a7171eec86c426d824105736: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, 3dda8f6 → 15305e2): PR #12257

No new findings. I read every hunk of the incremental diff in all three files in scope: the changelog fragment, plugins/harness-ops/README.md and control-claude-code/SKILL.md. For context I also read the PR context, the settled-threads file, the prior-findings file and the head SKILL.md.

This lane's earlier findings

  1. maxCaptures was a cap only on paper. The owner chose the agent-enforced option. It is fixed, and the thread is resolved.
    • SKILL.md:21-24 now says the driver does not count captures and the run keeps the count. At the cap the run takes no further screenshot or video and records each skipped entry point as blocked: maxCaptures reached.
    • That matches the blocked: <reason> record shape /app-control:drive already uses (plugins/app-control/skills/drive/SKILL.md:47, :200).
    • The changelog fragment no longer says the config enforces the cap. It now says config/defaults.json sets the value and the driver does not enforce it.
    • The settled thread is marked lines changed since resolution: no, and I found no new problem on those lines.
  2. The README row was stale. Fixed. README.md#L50 now reads "Runs attended or unattended on the session it launches and never attaches to another", which matches SKILL.md:8-9.

Criteria checks

  • Closing issue: none. The PR says Refs: #11386, which is not a closing keyword, so there were no acceptance criteria to check.
  • Plugin manifests: this increment changes neither plugin.json nor marketplace.json. The fragment's bump: minor is unchanged and still fits the change.
  • Path rules: skill-bodies-state-current-rules.md applies to SKILL.md. The new sentences describe what the skill does and add no restated upstream detail.
  • Embedded text: none in the PR context, settled-threads or prior-findings files.
  • Round cap: 1 round with findings before this one, cap 3, so the cap did not apply.

I ran nothing. The PR body's test results are the author's claim and I have not confirmed them.

Spend: none. The change touches no paid plan, billing setting or billed resource.

…DME row

The driver does not count captures, so SKILL.md says the run keeps the count
and records further captures as blocked at the cap; the changelog fragment no
longer claims the config enforces it. The harness-ops README row no longer
says attended runs only.

Refs: #11386

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton

Copy link
Copy Markdown
Member Author

claude-review finding 2 (stale README row, plugins/harness-ops/README.md:50): VALID (fix now). Fixed in 15305e2: the row now says the skill runs attended or unattended on the session it launches and never attaches to another. Finding 1 is answered on its inline thread.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit cc2b35c Nov 2, 2026
48 checks passed
@kyle-sexton
kyle-sexton deleted the host-run/11386-control-claude-code-unattended branch November 2, 2026 04:55
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