fix(chain): add issues:write + fix var-less skill discovery in chain-runner#553
Merged
Merged
Conversation
…runner Two bugs the fork canary surfaced on the chain path (chains are unused on prod today, so these were latent): 1. Missing `issues: write` — the §3 issues-as-state append (added in #548/#550) calls the Issues API via state_store.sh. chain-runner only had contents+actions write, so the append 403'd: chain run-events never reached the ledger Issue (dual mode masked it via the file path; `issues` mode would have lost them). 2. Sub-run discovery regex `test("skill: ${skill}(")` — the literal '(' is an unterminated regex group (jq throws "end pattern with unmatched parenthesis") and only appears in run titles when a skill has a var ("skill: digest (x)"). Var-less steps ("skill: heartbeat") never matched, so dispatch_skill timed out and the chain aborted at step 1. Fixed to `test("skill: ${skill}( |$)")` — matches name-then-space (var) or name-then-end (no var). Verified end-to-end on a fork: a 2-step heartbeat chain now completes green — both sub-runs discovered + awaited, and "chain state appended to issue #N (backend=dual)" succeeds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two bugs on the chain path that the fork canary surfaced. Chains are unused on prod today (0 defined), so these were latent — but both are real and would bite the first time a chain runs.
1. Missing
issues: writeThe §3 issues-as-state append (wired into
chain-runner.ymlby #548/#550) calls the Issues API viastate_store.sh ensure/comment. The workflow only hadcontents: write+actions: write, so the append 403'd — chain run-events never reached the ledger Issue. Dual mode masked this (the file path still recorded the event), but inissuesmode the chain events would be lost from the ledger entirely.2. Var-less skill discovery regex
dispatch_skill()polls for the sub-run it launched withtest("skill: ${skill}("). The literal(is an unterminated regex group — jq throwsRegex failure: end pattern with unmatched parenthesis— and it only "works" by accident when a skill has a var (skill: digest (AI agents)). Var-less steps (skill: heartbeat) never matched, so discovery timed out and the chain aborted at step 1. Fixed totest("skill: ${skill}( |$)")— matches name-then-space (var present) or name-then-end (no var). Confirmed it still rejects near-misses likeskill: heartbeat2.Verified end-to-end on a fork (
aaronjmars/aeontmp)A 2-step heartbeat chain (
canary-chain) now completes green:chain state appended to issue #4 (backend=dual)succeeds (fix 1),Chain 'canary-chain' completed successfully.(Before the fixes: same chain aborted at step 1, and the §3 append logged
Issues-as-state append failed.)🤖 Generated with Claude Code