Repository navigation
generator: per-workflow harness override - #612
Conversation
Adds workflows.<name>.harness for trialing a different harness on one workflow without flipping the whole bot. Concrete use case driving this: trial harness: claude-interactive on nightly while keeping review, mention, etc. on the production claude harness. - WorkflowConfig grows an optional `harness` field. Config.load validates it's known and (cross-family only) compatible with the top-level model. Same-family overrides (claude ↔ claude-interactive) share the model set; cross-family overrides without a per-workflow model are a hard error with a clear message. - workflows.py: a new _effective_cfg(cfg, wf) helper returns cfg unchanged when no override, or a dataclasses.replace clone with the workflow's harness. Each generator function calls it once and passes the effective config to the template + 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, unknown harness rejected, cross-family model mismatch rejected, and same-family override loads cleanly. All 252 tests pass (4 new). Existing snapshots untouched — the helper returns cfg unchanged when there's no override. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
tend-agent
left a comment
There was a problem hiding this comment.
One correctness gap in the cross-family validation: the check fires only when the target harness has a model allowlist, so the claude → codex direction slips through. With top-level harness: claude, model: opus and workflows.nightly.harness: codex, Config.load accepts the config and the renderer emits model: opus on the codex action — which codex won't accept. The PR description says cross-family overrides fail "vice versa with a per-workflow model unset"; that direction currently doesn't fail.
Related: the error message tells the user to set model: per-workflow, but WorkflowConfig doesn't have a model: field, so following the suggestion has no effect.
Pick whichever fix matches your intent — close the asymmetry by family (option in the inline comment), or add a per-workflow model: field and validate the effective pair.
…verride Reviewer caught two related gaps: - The cross-family validation only fired when the *target* harness had a model allowlist. claude → codex (model 'opus' → codex action) slipped through, would render `model: opus` on a codex step at runtime. - The error message told users to set `model:` per-workflow, but WorkflowConfig had no `model:` field — the suggestion was uncallable. Fix: - Add `model: str | None` to WorkflowConfig; _effective_cfg uses it when set. - Validate both directions in Config.load. Target-allowlist check fires when the new harness has an allowlist the effective model isn't in (e.g. gpt-5.5 → claude). Source-family check fires when the override crosses families away from a harness with an allowlist and no per-workflow model is set (e.g. claude → codex without overriding the model). - Two new tests cover both directions. A third confirms the per-workflow `model:` field unblocks cross-family overrides. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Both gaps fixed in 6d42cf4.
Test coverage:
254 tests pass (+2 over the previous push).
|
|
Both fixes look right — symmetric source-family guard fires before |
tend-agent
left a comment
There was a problem hiding this comment.
The symmetric cross-family validation closes the gap from the prior review — both directions error with actionable messages now. One remaining hole, inline: a per-workflow model: override without a harness: change skips validation entirely (both checks gate on wf_harness is not None). Verified locally — workflows.nightly.model: opus-99 with no harness: loads cleanly and the renderer emits model: opus-99 into a claude action step.
Likely a minor concern in practice (the docstring frames model as pairing with harness), but easy to close — see the inline suggestion.
…mer (#613) ## Why Second smoke-test retry on `main` (https://github.com/max-sixty/tend/actions/runs/26488931127) still timed out at 300s. The supervisor's transcript dump showed `claude` blocked on a third onboarding dialog after the trust + theme picker — the **"WARNING: Bypass Permissions mode"** disclaimer, shown the first time `claude` is invoked with `--permission-mode bypassPermissions`: ``` WARNING: Claude Code running in Bypass Permissions mode In Bypass Permissions mode, Claude Code will not ask for your approval before running potentially dangerous commands. … ❯ 1. No, exit 2. Yes, I accept ``` The disclaimer state has no documented pre-seed key in `~/.claude.json`, and the binary's own error message for `--bg` says it must be accepted via an interactive run — which the supervisor can't replicate. ## What Switch to `--permission-mode dontAsk` with an explicit allow list. `dontAsk` auto-denies anything not pre-approved (no prompt, no disclaimer); flat tool names like `"Bash"` match all invocations, so the effective permission surface matches the `bypassPermissions` intent for CI use. - `interactive/action.yaml`: drop `--permission-mode bypassPermissions` in the wrapper script; write `permissions.defaultMode: dontAsk` + an `allow` list (built from `inputs.allowed_tools` via `jq`) into `.claude/settings.local.json`. Pass `--permission-mode dontAsk` on the CLI too as belt-and-suspenders. - Comment in the Run-Claude step block explains why we avoid bypassPermissions and what dontAsk does for us. No generator changes; no test changes (no behavior visible at config-render time). ## Test plan - [ ] Re-run `interactive-smoke` after merge — expect status=ok, turns > 0 - [ ] Eventually exercise on a real CI workflow (post-merge, after #612 lands) Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Reviewer (round 2) caught the remaining hole: both validation branches gated on `wf_harness is not None`, so a per-workflow `model:` change WITHOUT a `harness:` change skipped validation entirely. Verified locally — `workflows.nightly.model: opus-99` would load and render `model: opus-99` into a claude action step. Restructure: gate on `wf_harness is not None OR wf_model is not None`, then collapse cases A (model typo) and B (cross-family target with bad model) into a single check against the effective harness's allowlist. Case C (cross-family flip away from allowlist without model) stays as the source-allowlist check. Two new tests: - test_per_workflow_model_typo_without_harness_rejected: the specific gap the reviewer found. - test_per_workflow_model_only_override_valid: positive case — `model: haiku` (no harness change) renders cleanly with siblings still on opus. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Closed in 95f047b. Restructured the validation: the outer guard is now Cases the new logic covers (all gated on "the workflow overrode something"):
Tests:
256 tests pass (+2).
|
|
Restructure looks right — the outer |
Ruff F841 — variable computed but no longer referenced after the case-A/B collapse. Caught by CI on the prior push. 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
Lets adopters trial a new harness on a single workflow without flipping the whole bot. Concrete use case: try
harness: claude-interactiveonnightlywhile keeping PR review / mention on the productionclaudeharness. Trial-safe rollout for the interactive harness added in #609 / #611.What
WorkflowConfiggains an optionalharnessfield.Config.loadvalidates the value is a known harness and (cross-family only) compatible with the top-level model.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 settingmodel:per-workflow too, or changing the top-level model."workflows.py: a new_effective_cfg(cfg, wf)helper returnscfgunchanged when there's no override, ordataclasses.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 anddefault_prompt. No template changes —agent_stepstill readscfg.harnessfrom whatevercfgit gets.Example
Test plan
pre-commit run --all-filespasses