chore(agents): one worktree per agent, and a Forgejo CLI instead of curl/Python snippets #118
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#118
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
1. Agents share the main working tree
Several agent sessions work on this repo at the same time, and some of them run
git switch,git stashor commits directly in the main folder (~/Trabajo/Orinokia/hikcentral). They step on each other.Incident, 2026-09-25 15:03–15:04:
fix/occupancy-config-save-preserves-calibrationand editedapp/static/js/app.jsfor the PR #115 review fix.fix/occupancy-review-followups-53-54(#65/#66), stashed that uncommitted change aswip-occupancy-config-save-appjsand switched the main tree back to its own branch.Nothing was lost (the change is still in the stash), but the only thing that caught it was an odd
git logline.2. Forgejo is driven with ad-hoc
curland Python snippetsAgents talk to the Forgejo API with hand-written
curlcalls and inline Python (urllib) to list PRs, post comments, create issues, set labels and merge. This has several costs:originremote URL.docs/agents/issue-tracker.mddocuments only the raw REST endpoints.Proposal
A. Workspace rule (AGENTS.md)
git worktree add ../hikcentral-wt<topic> <branch>or one under the agent's scratchpad, and removes it when done.switch/checkout/stash/reset/commit there, and never stash or discard changes they did not make.git status -sbshows the expected branch). If anything looks foreign, stop and report instead of "cleaning up".B. Forgejo CLI
tea: Gitea's official CLI; works against Forgejo's Gitea-compatible API.fj(forgejo-cli): Forgejo-native.docs/agents/issue-tracker.mdand reference it from AGENTS.md "Agent skills". Include the exact commands for what agents do today:curl/Python for these operations. Keep the REST endpoints as a fallback only.originremote URL into a credential helper once the CLI holds its own login.Open decisions (hence
needs-triage)teaorfj: both work.teais more mature;fjis Forgejo-native. Check which one supports every operation above, especially merge with a custom title anddelete_branch_after_merge.git-guardrailsskill could do this.🤖 Generated with Claude Code
Implemented by #139 (
c096d72) and hardened by #141 (02f0971):.worktrees/, managed byscripts/wt(new,pr,ls,rm,prune). The main checkout stays on a cleanmaster. Ownership is defined by uncommitted or unpushed work, andwt prrefuses to hand over a worktree someone is still working in. Set work aside with WIP commits instead of the shared stash. Seedocs/agents/workspaces.md; AGENTS.md §4 points to it.tea0.16.0, which also acts as git's HTTPS credential helper. The token was removed from theoriginremote URL. Seedocs/agents/forgejo-cli.md;issue-tracker.mdno longer lists raw REST endpoints.Remaining follow-ups live in #140. Closing.