mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
Many fixes and cleanups
This commit is contained in:
@@ -2,18 +2,25 @@
|
||||
|
||||
## Native Git Commands Blocked
|
||||
|
||||
**Symptom:** `Bash(git commit)` or similar git command denied
|
||||
**Symptom:** `Bash(git commit)`, `Bash(git push)`, `Bash(git checkout)`, etc.
|
||||
denied by the bash-guard hook.
|
||||
|
||||
**Cause:** Native git commands are blocked for all agents
|
||||
**Cause:** Shell git for network / auth / branch-mutating ops bypasses the
|
||||
PAT injection done by the MCP layer; raw `git fetch` etc. would fail with
|
||||
`could not read Username for 'https://github.com'` anyway.
|
||||
|
||||
**Solution:** Use MCP tools instead:
|
||||
| Blocked | Use Instead |
|
||||
|---------|-------------|
|
||||
| `git commit` | `roboco_git_commit()` |
|
||||
| `git push` | `roboco_git_push()` |
|
||||
| `git status` | `roboco_git_status()` |
|
||||
| `git diff` | `roboco_git_diff()` |
|
||||
| `git log` | `roboco_git_log()` |
|
||||
**Solution:** Use the role-scoped MCP verb that matches what you're trying
|
||||
to do. There is **no** `roboco_git_commit / _push / _create_pr / _merge_pr
|
||||
/ _checkout` MCP tool — the surface is smaller than that:
|
||||
|
||||
| Blocked shell command | Use instead |
|
||||
|-----------------------|-------------|
|
||||
| `git status` / `git diff` / `git log` / `git branch` | `roboco_git_status` / `roboco_git_diff` / `roboco_git_log` / `roboco_git_branch_list` (roboco-git-readonly) |
|
||||
| `git commit` + `git push` (devs / docs) | `commit(message, files)` (roboco-do) — auto-prefixes [task-id], pushes |
|
||||
| `git checkout` of a task branch | None — branch is auto-checked-out by `i_will_work_on(task_id)` (devs) or `i_will_plan(task_id, plan)` (PMs) |
|
||||
| Open a PR | None — PR is opened by the choreographer when the dev calls `open_pr(task_id)` |
|
||||
| Merge a PR | `complete(task_id, notes)` (PMs only) — Cell PM merges leaf PR; Main PM merges parent and escalates to CEO |
|
||||
| `git fetch` / `git pull` / `git rebase` | None at the agent layer — task branches are short-lived; if yours diverged, `unclaim` and re-`claim` |
|
||||
|
||||
## Write/Edit Outside Workspace
|
||||
|
||||
@@ -22,36 +29,40 @@
|
||||
**Cause:** Write operations restricted to your workspace
|
||||
|
||||
**Solution:**
|
||||
|
||||
- Developers: Only write in `/data/workspaces/{project}/{team}/{agent-id}/`
|
||||
- Documenters: Only write in `/app/docs/`
|
||||
- QA: No write access (review only)
|
||||
|
||||
## QA Cannot Commit
|
||||
|
||||
**Symptom:** `roboco_git_commit()` denied for QA agent
|
||||
**Symptom:** `commit()` returns `not_authorized` for a QA agent
|
||||
|
||||
**Cause:** QA role is read-only, cannot modify code
|
||||
**Cause:** QA role is read-only — cannot modify code or open PRs.
|
||||
|
||||
**Solution:** QA reviews and provides feedback. Developers make fixes.
|
||||
**Solution:** QA `pass(task_id, notes)` or `fail(task_id, issues)` only.
|
||||
Developers fix issues and re-submit.
|
||||
|
||||
## NO_PLAN Error
|
||||
## NO_PLAN Error on Start
|
||||
|
||||
**Symptom:** `roboco_task_start()` returns NO_PLAN error
|
||||
**Symptom:** Lifecycle transition rejected with NO_PLAN
|
||||
|
||||
**Cause:** Task has no plan submitted
|
||||
**Cause:** Parent tasks require a plan before they can leave `pending`.
|
||||
|
||||
**Solution:** Call `roboco_task_plan()` before `roboco_task_start()`
|
||||
|
||||
See: `roboco_kb_search("task planning workflow")`
|
||||
**Solution:** PMs call `i_will_plan(task_id, plan)`; the verb both records
|
||||
the plan and transitions the task into `in_progress`.
|
||||
|
||||
## Parent Branch Required
|
||||
|
||||
**Symptom:** Can't claim subtask, error "Parent task must be claimed first"
|
||||
|
||||
**Cause:** Parent task hasn't been claimed yet, so it has no branch
|
||||
**Cause:** Parent task hasn't been claimed/started yet, so it has no
|
||||
branch for the subtask's branch to fork from.
|
||||
|
||||
**Solution:**
|
||||
1. Parent task must be claimed first (branch auto-creates on claim)
|
||||
2. Then subtask can be claimed (its branch forks from parent's)
|
||||
|
||||
Note: Branches are auto-created hierarchically. No manual creation needed.
|
||||
1. Parent task must transition to `in_progress` first (PMs:
|
||||
`i_will_plan(parent_id, plan)`; devs: `i_will_work_on(parent_id)`).
|
||||
2. Then the subtask's branch will auto-fork from the parent's on claim.
|
||||
|
||||
Branches are auto-created hierarchically. No manual creation needed.
|
||||
|
||||
@@ -2,87 +2,120 @@
|
||||
|
||||
## Missing Git Token
|
||||
|
||||
**Error**: "Project requires a git token for HTTPS repositories"
|
||||
**Error:** `Project requires a git token for HTTPS repositories`
|
||||
(also surfaces as `WorkspaceError` during clone)
|
||||
|
||||
**Cause**: No GitHub PAT configured for this project
|
||||
**Cause:** No encrypted GitHub PAT on
|
||||
`projects.git_token_encrypted` for this project.
|
||||
|
||||
**Solutions**:
|
||||
1. Open project settings in UI
|
||||
2. Add GitHub token (Personal Access Token)
|
||||
3. Token needs `repo` scope for clone/push/PR
|
||||
**Fix:**
|
||||
|
||||
**Notes**:
|
||||
- Each project requires its own token (no global fallback)
|
||||
- Tokens are encrypted at rest
|
||||
- Token never exposed in API responses
|
||||
1. Open the project's settings tab in the panel
|
||||
2. Paste a GitHub Personal Access Token with `repo` scope
|
||||
3. Save — the panel encrypts and stores it; the API never returns
|
||||
the plaintext
|
||||
|
||||
Notes:
|
||||
|
||||
- Each project has its own token (no global fallback)
|
||||
- Tokens are encrypted at rest with Fernet
|
||||
- The token is injected only at the MCP layer (commit / clone / PR ops);
|
||||
`.git/config` is scrubbed post-clone so a leaked PAT from there is
|
||||
not a recovery path
|
||||
|
||||
## Workspace Not Found
|
||||
|
||||
**Error**: "Workspace does not exist"
|
||||
**Error:** `Workspace does not exist`
|
||||
|
||||
**Cause**: Workspace not cloned yet
|
||||
**Cause:** Workspace not cloned yet (or `ROBOCO_WORKSPACE_AUTO_CLONE`
|
||||
is `false` and no manual clone has run).
|
||||
|
||||
**Solutions**:
|
||||
- If auto_clone enabled: workspace creates on first access
|
||||
- Manual: Wait for workspace service to clone
|
||||
- Check config: `ROBOCO_WORKSPACE_AUTO_CLONE=true`
|
||||
**Fix:**
|
||||
|
||||
## Cannot Push
|
||||
- If `ROBOCO_WORKSPACE_AUTO_CLONE=true` (default), the first MCP verb
|
||||
that touches the workspace will trigger the clone. Just call your
|
||||
next verb (`i_will_work_on`, `commit`, etc.).
|
||||
- Otherwise check `ROBOCO_WORKSPACE_CLONE_TIMEOUT` and the
|
||||
orchestrator logs for a stuck clone.
|
||||
|
||||
**Error**: "Push failed"
|
||||
## BRANCH_MISMATCH
|
||||
|
||||
**Causes**:
|
||||
1. No commits to push
|
||||
2. Remote branch doesn't exist
|
||||
3. Conflicts with remote
|
||||
**Error envelope:**
|
||||
`Workspace is on '<other-branch>' but task requires '<task-branch>'`
|
||||
|
||||
**Solutions**:
|
||||
- Create commits first: `roboco_git_commit(...)`
|
||||
- Check branch exists: `roboco_git_branches()`
|
||||
- Pull and resolve conflicts
|
||||
**Cause:** You're trying to act on task A while your workspace is still
|
||||
on task B's branch.
|
||||
|
||||
## Branch Already Exists
|
||||
**Fix:** Don't checkout by hand — there is no `roboco_git_checkout`
|
||||
tool. Call the verb on the *intended* task instead:
|
||||
|
||||
**Error**: "Branch already exists"
|
||||
- Devs: `i_will_work_on(task_id)` switches to that task's branch
|
||||
- PMs: `i_will_plan(task_id, plan)` switches to that parent task's
|
||||
branch
|
||||
- QA: `claim_review(task_id)` switches to the dev's branch under review
|
||||
|
||||
**Cause**: Trying to create existing branch
|
||||
If your workspace is dirty, the verb returns an envelope telling you to
|
||||
either `commit(...)` first or escalate via `i_am_blocked`.
|
||||
|
||||
**Solution**: Checkout existing branch:
|
||||
```python
|
||||
roboco_git_checkout(project_slug, branch_name)
|
||||
```
|
||||
## NO_COMMITS on open_pr
|
||||
|
||||
## Merge Conflicts
|
||||
**Cause:** No commits on the task yet — the choreographer has nothing
|
||||
to open a PR over.
|
||||
|
||||
**Error**: "Merge conflict"
|
||||
**Fix:** `commit(message=..., files=...)` at least once, then call
|
||||
`open_pr(task_id)` again.
|
||||
|
||||
**Cause**: Conflicting changes between branches
|
||||
## NO_PR on pass / fail
|
||||
|
||||
**Solutions**:
|
||||
1. Pull latest from target branch
|
||||
2. Resolve conflicts manually
|
||||
3. Commit resolution
|
||||
4. Push again
|
||||
**Cause:** The PR was never created — usually because
|
||||
`open_pr(task_id)` did not run cleanly.
|
||||
|
||||
## PR Creation Failed
|
||||
**Fix:** Roll back to the dev: have them re-call `open_pr(task_id)`
|
||||
after fixing whatever blocked the PR opening (see PR Creation Failed,
|
||||
below). QA cannot create the PR.
|
||||
|
||||
**Error**: "PR creation failed"
|
||||
## PR Creation Failed (during open_pr)
|
||||
|
||||
**Causes**:
|
||||
1. No commits on branch
|
||||
2. Branch not pushed
|
||||
3. GitHub CLI not configured
|
||||
**Causes:**
|
||||
|
||||
**Solutions**:
|
||||
- Push branch first: `roboco_git_push()`
|
||||
- Verify commits exist: `roboco_git_log()`
|
||||
1. Nothing to push — no commits on the branch
|
||||
2. Branch is on the workspace but not pushed yet (rare; the choreographer
|
||||
pushes during `commit`, but a stale workspace can drift)
|
||||
3. Project has no git token configured
|
||||
4. The GitHub repo doesn't allow PRs from your branch (rare; usually
|
||||
org-level branch protection)
|
||||
|
||||
## Checkout Failed
|
||||
**Fix:**
|
||||
|
||||
**Error**: "Cannot checkout - uncommitted changes"
|
||||
- Verify commits exist with `roboco_git_log(project_slug=...)`
|
||||
- Verify the project has a git token (Missing Git Token, above)
|
||||
- If the task is in a stuck state, `unclaim(task_id)` and re-`claim`
|
||||
to rebuild the branch
|
||||
|
||||
**Cause**: Working directory has uncommitted changes
|
||||
## FORCE_PUSH_FORBIDDEN
|
||||
|
||||
**Solutions**:
|
||||
- Commit changes: `roboco_git_commit(...)`
|
||||
- Or stash changes (if supported)
|
||||
**Cause:** Force-push is CEO-only. Anyone else attempting it (typically
|
||||
because their branch diverged) is denied.
|
||||
|
||||
**Fix:** `unclaim(task_id)` and re-`claim` it. The choreographer
|
||||
rebuilds the branch from the parent's HEAD; replay your commits with
|
||||
`commit(...)`.
|
||||
|
||||
## Merge Conflicts on `complete`
|
||||
|
||||
**Cause:** The leaf PR conflicts with the parent branch (cell branch
|
||||
or master).
|
||||
|
||||
**Fix:** This currently surfaces as an error envelope from `complete`.
|
||||
The recovery path:
|
||||
|
||||
1. PM `unblock(task_id, restore=False)` — frees the task back to the
|
||||
dev
|
||||
2. Dev re-claims, the choreographer rebuilds the branch off the latest
|
||||
parent, and they replay their commits
|
||||
3. Dev `open_pr` again
|
||||
4. QA re-runs `pass` (or `fail` if the rebase changed behaviour)
|
||||
5. PM `complete` again
|
||||
|
||||
We don't expose a "resolve conflicts in place" path at the agent layer
|
||||
— rebuilds via the lifecycle are the recovery.
|
||||
|
||||
Reference in New Issue
Block a user