Skip to content

interactive harness: fix onboarding block, restore RCE-vector config on PRs - #611

Merged
max-sixty merged 1 commit into
mainfrom
interactive-onboarding
May 27, 2026
Merged

max-sixty merged 1 commit into
mainfrom
interactive-onboarding

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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

  • 248 generator tests pass (no generator changes here, but rerun green)
  • 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)

…on PRs

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.

1. Pre-seed full Claude onboarding state, not just workspace trust.
   First smoke-test run on a fresh GHA runner timed out at the theme
   picker — `claude` shows "Choose the text style…" before the input
   loop, which the trust-dialog-only seed didn't cover. Now sets
   hasCompletedOnboarding, lastOnboardingVersion, theme, plus the
   per-project keys; the session reaches prompt processing immediately.

2. Replace the CLAUDE.md-only fork-PR pin with the full RCE-vector
   restore: .claude/, .mcp.json, .claude.json, .gitmodules, .ripgreprc,
   CLAUDE.md, CLAUDE.local.md, .husky — same path list as
   claude-code-action's restore-config.ts. Runs on all PR events
   (pull_request_target, _review, _review_comment, and PR-comment
   issue_comment), snapshots PR-authored versions to .claude-pr/ for
   optional review-skill inspection, deletes before fetching to keep an
   attacker-controlled .gitmodules out of git's recurse-submodules path,
   then checks out from base and unstages. security-model.md updated
   to reflect parity is now in place.

3. debug-tend-run skill: claude-interactive-session-logs* added to the
   harness artifact list, with a note that the artifact ships the PTY
   typescript (tend-claude.log) alongside the session JSONLs.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 6463eaa into main May 27, 2026
6 checks passed
@max-sixty
max-sixty deleted the interactive-onboarding branch May 27, 2026 03:27
@max-sixty max-sixty mentioned this pull request May 27, 2026
2 tasks done
max-sixty added a commit that referenced this pull request May 27, 2026
## 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]>
@max-sixty max-sixty mentioned this pull request May 27, 2026
max-sixty added a commit that referenced this pull request May 27, 2026
## 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.
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.

2 participants