Repository navigation
Conversation
…ative Anthropic's June 15 2026 billing split moves the Agent SDK (@anthropic-ai/claude-agent-sdk) — which is what claude-code-action invokes under the hood — to a metered Agent-SDK credit pool. Interactive Claude Code in a terminal stays on the flat Pro/Max subscription. This adds an alternative composite action that runs the official `claude` binary inside `script(1)` and uses a Stop hook to detect turn end. - interactive/action.yaml: new composite action mirroring action.yaml's inputs/outputs. Stop hook → success sentinel, StopFailure → failure sentinel, supervisor polls both plus process exit plus timeout. Pre-seeds workspace trust in ~/.claude.json so interactive `claude` doesn't block on the first-run dialog. Plugins installed via `claude plugin install` against this action's own checkout. - generator: `claude-interactive` joins KNOWN_HARNESSES as a sibling of `claude`; routes the agent_step macro to max-sixty/tend/interactive@<ver>. Keeps Claude-shaped auth secrets and /tend-ci-runner:NAME slash syntax. - smoke test: .github/workflows/interactive-smoke.yaml is a dispatch-only workflow that runs the in-tree action against a trivial Bash-tool prompt. Validates the parts the local spike couldn't (`claude plugin install` non-interactively on Ubuntu with OAuth env auth, install.sh recipe end-to-end). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
tend-agent
left a comment
There was a problem hiding this comment.
Two places outside this diff still gate on cfg.harness == "claude" rather than membership in CLAUDE_FAMILY_HARNESSES. With harness: claude-interactive, both fall into the else (Codex) branch and emit Codex-shaped behavior — breaking the "input-shape parity with action.yaml" claim once an adopter flips the config (or runs tend init --with-install-test / tend check).
generator/src/tend/workflows.py — generate_install_test
if cfg.harness == "claude":
harness_envs = (
f" CLAUDE_OAUTH: ${{{{ secrets.{cfg.claude_token_secret} }}}}\n"
...
)
harness_check = '"$CLAUDE_OAUTH$ANTHROPIC_KEY"'
else:
harness_envs = (
f" CODEX_AUTH: ${{{{ secrets.{cfg.codex_auth_json_secret} }}}}\n"
...
)
harness_check = '"$CODEX_AUTH$OPENAI_KEY"'With harness: claude-interactive, the generated tend-install-test.yaml checks for CODEX_AUTH_JSON/OPENAI_API_KEY secrets that the adopter doesn't have, so the install-test workflow fails noisily on a correctly-configured repo.
generator/src/tend/checks.py — run_all_checks
engine_auth_secrets = (
[cfg.claude_token_secret, cfg.anthropic_api_key_secret]
if cfg.harness == "claude"
else [cfg.openai_key_secret, cfg.codex_auth_json_secret]
)
...
if cfg.harness == "claude":
results.append(check_claude_auth(repo, cfg))
else:
results.append(check_codex_auth(repo, cfg))uvx tend check against a harness: claude-interactive repo runs check_codex_auth, complaining about absent Codex secrets and reporting Claude OAuth as "extra/unallowed" via check_repo_secret_allowlist.
Fix is mechanical — swap each cfg.harness == "claude" for cfg.harness in CLAUDE_FAMILY_HARNESSES (already imported / defined in config.py). The install-test snapshot test would also catch this if parameterized over ["claude", "claude-interactive", "codex"] instead of ["claude", "codex"] (test_install_test_workflow_regtest in generator/tests/test_generate.py).
Happy to push a fix commit if you'd like.
Other notes (not blocking, flagging for awareness):
- The action's
Pin CLAUDE.md to base branch (fork PRs)step pins onlyCLAUDE.md.claude-code-actionadditionally restores.claude/,.mcp.json,.claude.json,.gitmodules,.ripgreprcfrom base on fork PRs — the comment in this action calls this out as a known gap. Worth flagging indocs/security-model.mdbefore any adopter flips apull_request_targetworkflow toclaude-interactive, given the RCE surface in.claude/. claude-interactive-session-logs*is a new artifact-name shape.plugins/install-tend/skills/debug-tend-run/SKILL.mdcurrently enumerates onlyclaude-session-logs*andcodex-session-logs-*— fine to defer until the cutover, but worth a follow-up.
Reviewer caught two `cfg.harness == "claude"` checks outside the diff that would mis-classify `claude-interactive` as Codex: - `generate_install_test` (workflows.py) → produced an install-test workflow asserting CODEX_AUTH_JSON / OPENAI_API_KEY presence instead of CLAUDE_CODE_OAUTH_TOKEN / ANTHROPIC_API_KEY. - `run_all_checks` (checks.py) → invoked check_codex_auth and treated the Claude OAuth secret as an unallowed extra in the secret allowlist. Both now use `cfg.harness in CLAUDE_FAMILY_HARNESSES`. The install-test regtest is parameterized over claude-interactive; the new snapshot is byte-identical to the claude one. A new test in test_checks.py asserts run_all_checks emits claude-auth (not codex-auth) and that the secret allowlist passes under claude-interactive. Also adds a security-model.md paragraph noting the interactive harness does not yet restore the RCE-relevant config files (.claude/, .mcp.json, …) that claude-code-action restores on fork PRs — adopters should not flip a pull_request_target workflow to claude-interactive until parity is restored. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Fixed in 4b92c13. Both gates now use
Test coverage:
Also added a Holding off on the
|
|
Confirmed the fix lands cleanly:
Agreed on deferring the |
…on PRs (#611) ## Why Three follow-ups to #609. All scoped to the `interactive` harness (opt-in via `harness: claude-interactive`); nothing in the existing `claude` or `codex` paths changes. ## What **1. Fix the onboarding block (the actual smoke-test blocker).** First smoke run on `main` (https://github.com/max-sixty/tend/actions/runs/26488447138) timed out at 300s with 0 turns. The supervisor's transcript dump showed `claude` blocked at the theme picker: "Choose the text style that looks best with your terminal". The workspace-trust pre-seed in #609 didn't cover the broader onboarding flow. This commit sets `hasCompletedOnboarding`, `lastOnboardingVersion` (matched to the installed claude version), `theme`, and the per-project trust + onboarding keys — `claude` reaches the prompt-processing loop immediately. **2. Security parity for fork PRs.** Replace the `CLAUDE.md`-only pin with the full RCE-vector restoration that `claude-code-action` does today: `.claude/`, `.mcp.json`, `.claude.json`, `.gitmodules`, `.ripgreprc`, `CLAUDE.md`, `CLAUDE.local.md`, `.husky`. Same path list and ordering as `restore-config.ts` in `anthropics/claude-code-action`. Runs on all PR events (including PR-comment `issue_comment`), snapshots PR-authored versions to `.claude-pr/` for optional review inspection (added to `.git/info/exclude`), deletes before fetching to keep an attacker-controlled `.gitmodules` out of git's `recurse-submodules` code path, then `git checkout origin/<base> -- <path>` and `git reset` to unstage. `docs/security-model.md` updated. **3. `debug-tend-run` skill: recognize the new artifact.** Lists `claude-interactive-session-logs*` alongside the existing patterns and notes the typescript log (`tend-claude.log`) shipped at the artifact root for cases where the JSONL is incomplete (session aborted before Stop). ## Test plan - [x] 248 generator tests pass (no generator changes here, but rerun green) - [x] `pre-commit` passes on all modified files - [ ] Re-run `interactive-smoke` workflow after merge — confirm Stop hook fires, turns > 0 - [ ] Eventually: exercise the restore step on a real fork PR (this PR is same-repo, so the restore is a no-op on its own CI) Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
## Why Lets adopters trial a new harness on a single workflow without flipping the whole bot. Concrete use case: try `harness: claude-interactive` on `nightly` while keeping PR review / mention on the production `claude` harness. Trial-safe rollout for the interactive harness added in #609 / #611. ## What - `WorkflowConfig` gains an optional `harness` field. `Config.load` validates the value is a known harness and (cross-family only) compatible with the top-level model. - Same-family overrides (claude ↔ claude-interactive) share the model set, no compatibility error. - Cross-family overrides (codex → claude/claude-interactive with a codex model name like `gpt-5.5`, or vice versa with a per-workflow model unset) fail at config load with a clear message: "workflows.X.harness 'claude' is incompatible with the top-level model 'gpt-5.5'… Cross-family per-workflow harness overrides require setting `model:` per-workflow too, or changing the top-level model." - `workflows.py`: a new `_effective_cfg(cfg, wf)` helper returns `cfg` unchanged when there's no override, or `dataclasses.replace(cfg, harness=wf.harness)` otherwise. Each generator function (review, mention, triage, ci-fix, scheduled, notifications) calls it once and passes the effective config to both the template and `default_prompt`. No template changes — `agent_step` still reads `cfg.harness` from whatever `cfg` it gets. - Tests: per-workflow override targets only the named workflow (sibling workflows keep the top-level harness), unknown harness rejected, cross-family model mismatch rejected, same-family override loads cleanly. ## Example ```yaml bot_name: tend-agent harness: claude # Trial the interactive harness on nightly only — review/mention/triage # stay on the SDK-based claude harness until we're confident. workflows: nightly: harness: claude-interactive ``` ## Test plan - [x] 252 tests pass (4 new); existing snapshots untouched - [x] `pre-commit run --all-files` passes --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
## Why Cut the 0.1.2 release so consumer repos (and tend's own nightly regen) pick up the new `claude-interactive` harness and per-workflow `harness`/`model` overrides. ## What's new since 0.1.1 **New `claude-interactive` harness** (`max-sixty/tend/[email protected]`) — opt-in alternative to the released `claude` harness. PTY-supervised interactive `claude` via `script(1)`, end-of-turn detected through Stop/StopFailure hooks. Built as the trial path ahead of Anthropic's June 15 billing split between Agent-SDK metering and the flat Claude Code subscription. Smoke tested end-to-end on tend itself. PRs: #609, #611, #613, #614, #615, #616. **Per-workflow `harness` / `model` override** — adopters can flip a single workflow to a different harness or model without changing `.config/tend.yaml` defaults. #612. **Skill refinements** — nightly upstream-bot rebases (#605), running-in-ci PR bar (#604) and recheck (#573), env-filter loophole fix (#599), authorAssociation warning (#600), review-gates Gate 1 (#602). **Bug fix** — mention queue-delay now uses `comment.updated_at` so edit events report accurately (#595). ## Compatibility Released `claude` harness path is byte-identical; `claude-interactive` is strictly additive and opt-in. Consumer repos that don't touch `harness:` see no change beyond the new skill text and the mention-edit fix.
Why
Anthropic's June 15 2026 billing split puts
@anthropic-ai/claude-agent-sdkon a metered Agent-SDK credit pool.anthropics/claude-code-action(which tend wraps today) callsquery()from that SDK under the hood — so today'sharness: claudepath is exactly what's being metered. Interactive Claude Code in a terminal stays on the flat Pro/Max subscription. This PR adds aharness: claude-interactivepath that runs the officialclaudebinary in a PTY supervisor instead. Nothing changes forharness: claudeusers (or for tend's own workflows) until someone flips the config.What's added
interactive/action.yaml— new composite action, sibling ofcodex/action.yaml. Mirrorsaction.yaml's inputs/outputs for drop-in swappability. Runsclaude --permission-mode bypassPermissions "$PROMPT"insidescript(1)for PTY allocation. A Stop hook in.claude/settings.local.jsonwrites a sentinel file when the model finishes a turn; aStopFailurehook writes a separate sentinel for rate-limit / auth / server errors. The supervisor polls both, plus process exit and a timeout, then terminates cleanly with SIGTERM/SIGKILL. Pre-seeds workspace trust in~/.claude.jsonso interactiveclaudedoesn't block on the first-run dialog (the partclaude -pskips automatically). Plugins install viaclaude plugin installagainst this action's own checkout.Generator wiring (
config.py,templates/macros.yaml.j2,tests/test_generate.py) —claude-interactivejoinsKNOWN_HARNESSESas a sibling ofclaude. Theagent_stepmacro grows a three-way branch for the action ref (max-sixty/tend@,max-sixty/tend/interactive@,max-sixty/tend/codex@). Claude-shaped auth secrets and/tend-ci-runner:NAMEslash syntax are preserved via a newCLAUDE_FAMILY_HARNESSES = {"claude", "claude-interactive"}constant. Four new tests cover the routing..github/workflows/interactive-smoke.yaml— dispatch-only smoke test that exercises the new action viauses: ./interactiveagainst a trivial Bash-tool prompt. Validates the parts the local spike could not cover:claudeinstall on a fresh Ubuntu runner, plugin install non-interactively with OAuth env auth, Stop hook firing on Linux. Fork-guarded; defaults tosonnetfor cheap iteration.How it detects turn end
Verified in a local spike (
Stopfires once per turn in interactive mode, even with tool use, and the process stays alive afterward). Five-line state machine: success sentinel → exit 0; failure sentinel → exit 1 with::error::; premature process exit → exit with the child's code; timeout → exit 1.What's deferred
allowed_bots/allowed_non_write_usersenforcement — was claude-code-action's JS layer; primary gating already happens in generated workflowif:conditions. TODO in the action.harness:only for now. Flippingharness: claude-interactiveswitches everything; a per-workflow knob would let nightly trial in isolation if that's wanted.claude-interactiveworkflow YAML — would mint a dozen new.outfiles; the four routing tests cover the surface that matters.harness: claudecontinues to be tend's own setting and the default. This PR adds the path; flipping it is a follow-up.Test plan
pre-commit runpasses on all modified filesStophook semantics underscript(1)claude-ppost-merge confirms end-to-end on a real GHA runner