Skip to content

feat(dkai-agent): add slashbay-pull helper - #8

Open
surrealwolf wants to merge 1 commit into
mainfrom
feat/slashbay-pull
Open

feat(dkai-agent): add slashbay-pull helper#8
surrealwolf wants to merge 1 commit into
mainfrom
feat/slashbay-pull

Conversation

@surrealwolf

Copy link
Copy Markdown
Contributor

Summary

  • Workspace parameters slashbay_url and slashbay_worker_token inject SLASHBAY_URL / SLASHBAY_WORKER_TOKEN via coder_env (same pattern as cursor_api_key).
  • Startup writes /home/coder/bin/slashbay-pull and nohups it when both are set. Logs /tmp/slashbay-pull.log, pid /tmp/slashbay-pull.pid.
  • Loop: claim → progress cloning → clone git_url into /home/coder/agent-workspace/git/<repo>/ → progress agent_running → agent -p → complete/failed.
  • Leaves start-cursor-worker in place. Does not put CODER_TOKEN in the workspace.

Pairs with DataKnifeAI/slashbay pull-jobs API.

Test plan

  • make test / scripts/check-dkai-startup-shell.sh (startup_script bash -n)
  • Push template, create a workspace with both Slashbay params + cursor_api_key
  • Confirm /tmp/slashbay-pull.log shows claims against Slashbay
  • Confirm start-cursor-worker still autostarts when cursor_api_key is set

Made with Cursor

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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ 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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1b5dd70. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a non-blocking comment; not approved. Cursor Bugbot finished skipped and reported 3 unresolved findings that need human review. No additional reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant