feat(dkai-agent): add slashbay-pull helper - #8
Conversation
Warm workspaces claim Slashbay jobs and run agent -p without embedding CODER_TOKEN or replacing start-cursor-worker. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1b5dd70. Configure here.
| ) & | ||
| hb=$! | ||
| set +e | ||
| agent -p "$prompt" |
There was a problem hiding this comment.
Agent cannot apply code changes
High Severity
slashbay-pull invokes agent -p without --force (and without --trust). In Cursor headless/print mode, writes and other tools are denied unless forced, so issue jobs can exit 0, get marked complete, and leave the repo unchanged.
Reviewed by Cursor Bugbot for commit 1b5dd70. Configure here.
| rm -f /tmp/slashbay-pull.pid | ||
| fi | ||
| export HOME=/home/coder USER=coder LOGNAME=coder | ||
| nohup /home/coder/bin/slashbay-pull >>/tmp/slashbay-pull.log 2>&1 & echo $$! >/tmp/slashbay-pull.pid |
There was a problem hiding this comment.
Restart orphans agent processes
High Severity
Startup only kills the slashbay-pull bash PID from the pidfile, with no process-group cleanup, no wait, and no sleep before relaunch. Mid-job agent -p and the heartbeat subshell keep running, so restarts leave orphans and can double-claim work.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1b5dd70. Configure here.
| fi | ||
| job_id=$(job_field id) | ||
| prompt=$(job_field prompt) | ||
| git_url=$(job_field git_url) |
There was a problem hiding this comment.
Bad claim JSON kills puller
Medium Severity
After a HTTP 200 claim, set -e is re-enabled and job_field parses /tmp/slashbay-claim.json with no error guard. Invalid JSON or a non-object body makes Python fail and exits the whole while true daemon until the workspace is restarted.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 1b5dd70. Configure here.




Summary
slashbay_urlandslashbay_worker_tokeninjectSLASHBAY_URL/SLASHBAY_WORKER_TOKENviacoder_env(same pattern ascursor_api_key)./home/coder/bin/slashbay-pullandnohups it when both are set. Logs/tmp/slashbay-pull.log, pid/tmp/slashbay-pull.pid.git_urlinto/home/coder/agent-workspace/git/<repo>/→ progress agent_running →agent -p→ complete/failed.start-cursor-workerin place. Does not putCODER_TOKENin the workspace.Pairs with DataKnifeAI/slashbay pull-jobs API.
Test plan
make test/scripts/check-dkai-startup-shell.sh(startup_scriptbash -n)cursor_api_key/tmp/slashbay-pull.logshows claims against Slashbaystart-cursor-workerstill autostarts whencursor_api_keyis setMade with Cursor