Fix #94: resolve claude-worker-loop.sh from the lib dir, not repo_root - #96
Merged
Conversation
restart-worker.sh killed the hung worker but never relaunched it, leaving the pane at a bare shell while still printing "✅ Worker restarted". Root cause: callers derive AGENTS_REPO_ROOT as SCRIPT_DIR/../../.., which is only correct for a repo checkout. An installed plugin lives at cache/plugin-marketplace/autocoder/<version>/scripts, so that walk lands on the cache root; appending plugins/autocoder/scripts/claude-worker-loop.sh yields the hybrid path from the report — real in neither the cache nor marketplace layout. Changes: - worker-launch-lib.sh: resolve the loop script from the lib's own directory (WORKER_LAUNCH_LIB_DIR); both ship in the same scripts/ dir. Fail loudly with a non-zero return if it is missing instead of emitting an unusable path. - restart-worker.sh: after sending WORKER_CMD, capture the pane and exit non-zero if it reports "No such file or directory"/"command not found", so a killed-but-not-restarted worker can no longer be reported as success. - test_worker_launch_lib.sh: assert the emitted loop path EXISTS on disk when repo_root does not follow the checkout layout, and that it is not derived from repo_root. Verified red before the fix with exactly the reported path shape. Verification: 17/17 shell unit tests pass; bash -n + py_compile clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Jul 31, 2026
laird
added a commit
that referenced
this pull request
Aug 10, 2026
…ng (2026-08-02..2026-08-10) Collapses 28 commits into one. The individual commits are not preserved: intermediate revisions of skills/improve/SKILL.md named the internal platform the validation loop was developed against, and squashing to the current tree is what removes those revisions from this branch's history. The resulting tree is byte-identical to the pre-squash HEAD (9f73851) — this changes history, not content. What the squashed range delivered: Skills - The validation & refinement loop skill (run/grade/fix/log to N-clean; scope + exercise preflight; swarm cadence; per-round report-grade logging; model tier guidance), renamed harden -> improve (#112). - Packaged the root skills/ tree into the Claude Code plugins, which had shipped no skills at all — `improve` and the model-config reference were unreachable for every Claude Code user. Issue backends - Jira search migrated to /rest/api/3/search/jql after Atlassian removed the v2 endpoint (#100), with ADF descriptions flattened to plain text. - ado-smoke-test.sh, mirroring jira-smoke-test.sh. Autocoder runtime - Ship gate: issues close only when their work reaches the ship branch (#35). - Claim lock held to a terminal outcome (#14). - Branch-claimed issues excluded from the candidate list (#48). - claude-worker-loop.sh resolved from the lib dir, not repo_root (#94/#96). - Env-var-driven model selection with startup confirmation (#110). - Three failing test suites resolved (#116). Housekeeping - Platform packaging drift repaired across Claude/Codex/Gemini/Droid. - Planning-pipeline spec, implementation plan and critical reviews. - Version bumps through autocoder 4.14.1 / marketplace 3.36.1. Co-Authored-By: Claude Opus 5 <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.
Closes #94
Root Cause
restart-worker.shkilled the hung worker but never relaunched it, leaving the pane at a bare shell — while still printing✅ Worker restarted.Callers derive
AGENTS_REPO_ROOTasSCRIPT_DIR/../../.., which is only correct for a repo checkout. An installed plugin lives atcache/plugin-marketplace/autocoder/<version>/scripts, so that walk lands on the cache root; appendingplugins/autocoder/scripts/claude-worker-loop.shproduces exactly the hybrid path in the report — real in neither the cache nor the marketplace layout.Solution
claude-worker-loop.shalways ships besideworker-launch-lib.sh, so resolve it from the lib's own directory instead of fromrepo_root.Changes Made
worker-launch-lib.sh— resolve the loop script viaWORKER_LAUNCH_LIB_DIR(the lib's own dir). Fail loudly with a non-zero return if it is missing, rather than emitting an unusable path.restart-worker.sh— after sendingWORKER_CMD, capture the pane and exit non-zero if it reportsNo such file or directory/command not found. A killed-but-not-restarted worker can no longer be reported as success.tests/test_worker_launch_lib.sh— assert the emitted loop path exists on disk whenrepo_rootdoes not follow the checkout layout, and that it is not derived fromrepo_root.Verification
.../not-a-repo-checkout/plugins/autocoder/scripts/claude-worker-loop.shbash -n plugins/autocoder/scripts/*.shandpy_compileclean.Note on scope
Only
claude-worker-loop.shis repointed. Thecodex/droidloops legitimately live under the repo-levelscripts/dir, not beside this lib, so theirrepo_rootderivation is left unchanged.Unrelated observation (already tracked)
On
origin/masterthe regression harness reports✅ All tests passedwhile running 0/0 unit tests ("No unit test command configured — skipping") — the failure class #73/#85 address. Those fixes are still stuck behind the blocked #74 stack, so this PR was gated on the unit tests directly rather than on that harness.🤖 Generated with Claude Code