fix: fail loud with a clear message when the harness CLI is missing from the worker - #861
Conversation
|
@JoeJoeflyn is attempting to deploy a commit to the fergana Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for the PR! Will take a look soon |
ColemanDuPlessie
left a comment
There was a problem hiding this comment.
Looks good! One note that the codebase previously didn't use the shutil python library in backend/, only in the CLI and plugins. It's probably fine, but perhaps something to be aware of.
|
My bad! I didn't notice |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
That's alright! Given that we already use shutil elsewhere in stash, it's okay to also introduce it into backend/ It seems like this change is causing a couple of the backend tests to fail (there are 6 failures in the CI, and all but test_integration_indexer_log_security.py::test_github_index_success_logs_internal_source_id_only come from this change): it looks like they're all coming from the fact that our pre-existing tests trip up your code and cause it to fail loud when it doesn't recognize the tests' mocks. Other than that, this PR looks good, so once that's fixed, we can merge it! |
|
Thanks, really appreciate it! Glad I could help improve this. Happy to contribute! |
|
Hey @JoeJoeflyn do you plan on addressing the test failures here? Lmk otherwise I'm gonna close since this is getting stale |
|
yep, i forgot this |
8ed0adc to
fb0ae2e
Compare
…rom the worker When the harness CLI (claude/codex/opencode) isn't installed on the worker host, the curator task crashed with a cryptic FileNotFoundError from deep in asyncio — "No such file or directory: 'claude'" — that didn't tell the operator what to install. Check shutil.which() before spawning and raise a RuntimeError that names the missing binary and says to install it on the worker host. References Fergana-Labs#780
fb0ae2e to
9e1a196
Compare
Summary
Fail loud with a clear, actionable error when the harness CLI (claude/codex/opencode) is missing from the worker host, instead of the cryptic FileNotFoundError from issue #780.
Changes
backend/services/sprite_agent_service.py: checkshutil.which(auth.harness.bin)before spawning the subprocess inrun_chat; raiseRuntimeErrornaming the missing binary if absentbackend/tests/test_curator.py: addedtest_missing_cli_raises_clear_error— mocksshutil.whichto returnNone, asserts the error namesclaudeand mentionsPATHRelated issues
References #780
Test plan
python -m pytest backend/tests/test_curator.py -v— 22 passed)test_missing_cli_raises_clear_error)docker-compose.prod.yml, confirmedclaudeis absent from the worker container, reproduced the originalFileNotFoundError, then confirmed the new check raises a clearRuntimeErrornaming the binary