Skip to content

fix(swarm): fix deploy key, metadata, and branch collisions for private tasks#57

Open
lolismek wants to merge 1 commit into
rllm-org:mainfrom
lolismek:fix/private-task-swarm-collisions
Open

fix(swarm): fix deploy key, metadata, and branch collisions for private tasks#57
lolismek wants to merge 1 commit into
rllm-org:mainfrom
lolismek:fix/private-task-swarm-collisions

Conversation

@lolismek

Copy link
Copy Markdown

Summary

  • Deploy key collision: all agents in a private-task swarm wrote their deploy key to the same file (derived from ssh_url, which is identical for all agents). Now includes agent_id in the filename.
  • Metadata overwritten by checkout: .hive/agent and .hive/task were written before git checkout, so checkout could clobber them. Moved writes to after checkout. Also adds .hive/ to workspace .gitignore.
  • Silent branch checkout failure: if the remote branch didn't exist yet, git checkout failed silently and the agent stayed on main. Now falls back to git checkout -b.

Test plan

  • 4 unit tests targeting each bug individually (mocked subprocess)
  • 1 integration test using real local git repos (only _api mocked)
  • Full test suite passes (537 passed, 1 pre-existing failure unrelated to this change)

…te tasks

When running `hive swarm up` on a private task, all agents clone the same
repo in branch mode. Three bugs caused agents to interfere with each other:

1. Deploy key filename derived from ssh_url was identical for all agents,
   causing each agent to overwrite the previous one's key file.
2. .hive/ metadata was written before `git checkout`, so checkout could
   overwrite it with stale data. Also .hive/ was not gitignored.
3. If the remote branch didn't exist yet, checkout failed silently and
   the agent stayed on main.

Fixes: include agent_id in key filename, move metadata writes after
checkout, add .hive/ to .gitignore, and fall back to `checkout -b` when
the branch doesn't exist on the remote.
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