refactor: delegate fj work to the fj-worker subagent instead of forking #8
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/forgejo-cli-delegation"
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?
Goal
Invert the
forgejo-cliplugin from an auto-forking skill into a thin routerthat splits Forgejo work two ways:
a deterministic bundled script (
scripts/fj_read.py) -- no model in the loop,so content comes back exactly as written (a body that is a spec stays verbatim).
fj-workersubagent (Sonnet),which holds the full
fjreference + footguns and runs one small,self-contained task at a time, taking any multi-line content via an absolute
tmp-file path the caller writes.
Either way the main context stays lean and carries zero
fjmechanics.Why
The previous design used
context: forkso anyfjmention forked the wholetask into the worker. Two problems: the main context did no thinking of its own,
and routing a content read through an LLM risked summarising/truncating a body
that is actually a spec. The new model keeps the main context in control, makes
reads deterministic (a script, not a model), and reserves the worker for the
footgun-heavy writes and adaptive error recovery.
Steps
fjreference (commands, footguns, REST fallbacks,token scopes, subcommand surface) into the
fj-workeragent, and add anoperating contract: one small self-contained task per dispatch; large
content arrives as an absolute tmp-file path to
Read; results terse,but returned content (a body) verbatim.
extras.mdcompanion next to the agent(
agents/references/extras.md) and retarget its cross-references at theagent reference, since the skill no longer owns it.
SKILL.mdto a thin router: drop thecontext: fork+agent:frontmatter, trim the description to a pure trigger, and make the body the
two-path contract (script the reads, delegate the writes; the tmp-file rule
for bodies; what comes back).
scripts/fj_read.py-- a stdlib-only script that readsfj's storedtoken and hits the Forgejo REST API to dump a PR/issue verbatim (metadata,
body, flat comments, and reviews + inline comments, which
fjcan't show)to a tmp file or stdout (
--format jsonfor machine output). Route readsthrough it in the skill router.
Notes
agents/fj-worker.md+agents/references/extras.md); main context carries just the small router bodywhen the skill triggers.
fj_read.pyis morecapable than
fjfor reads (reviews/inline comments are REST-only; it alsosidesteps the broken
fj pr status).fj_read.pywas verified liveagainst this PR (#8): body verbatim, comments captured, JSON +
--out+ errorpaths (bad host, 404) all behave.
taskpysuite still tells callersto "invoke the
forgejo-cliskill ... for syntax" and references "theforgejo-cli skill's review subsection" -- those now resolve to the agent /
fj_read.py, so the references want updating.Depends on: none.
2026-06-25 -- resolver pass on refactor/forgejo-cli-delegation at
9284978.2026-06-25 -- second resolver pass on refactor/forgejo-cli-delegation at
1264e3f.WIP: refactor: delegate fj work to the fj-worker subagent instead of forkingto refactor: delegate fj work to the fj-worker subagent instead of forking