Skip to content
This repository was archived by the owner on Aug 24, 2026. It is now read-only.

fix: improve Fusion behavior on OpenCode 1.18.21 - #54

Merged
mihneaptu merged 4 commits into
mainfrom
fix/main-agent-git-context
Aug 24, 2026
Merged

mihneaptu merged 4 commits into
mainfrom
fix/main-agent-git-context

Conversation

@mihneaptu

@mihneaptu mihneaptu commented Aug 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • route git-history investigation through the read-only explore agent and keep main-agent diff review scoped
  • resume failed sidekick work with OpenCode's reusable task_id
  • keep the design agent's required skill tool available under a global skill deny
  • keep commits and pushes with the main agent while reducing its avoidable Git context; refs Add Git-related commands to Sidekick #53

Testing

  • npm test — 189 passed, 0 failed, 2 skipped
  • npm run test:integration — 5 passed with OpenCode 1.18.21
  • npm run check-profiles — 5 profiles, 0 errors, 0 warnings
  • npm run check-install — repository prompts matched the installed copies by content
  • OpenCode 2 beta advisory — failed because the plan agent was offered the denied edit tool; OpenCode 2 is not supported by the final maintained release

The main agent's largest avoidable context cost is git read output, not
the commit and push calls: a whole-repo diff or a `git log -p` sweep
lands in the heavy model's context and stays there for the session.

Route history digging to sidekick, which has full bash where explore
carries whatever read-only policy the installed opencode ships, and have
the main agent stat before it diffs.

Refs #53
Review of PR #54 found the routing change rested on a false premise.
opencode 1.18.21 defines the built-in explore with bash "allow" (verified
by extracting the agent definition from the binary), so explore can run
git. Routing history digs to sidekick sent read-only work to an
edit-capable agent on the pricier model.

- Route git history investigation to explore, not sidekick. This also
  drops the conflict with the five-part Spec contract, which a `git blame`
  question cannot satisfy, and with sidekick's REPORT FORMAT, which has no
  field for an investigation that modifies nothing.
- Deny patch-producing `git log` forms (-p, -u, --patch) in the build and
  plan allowlists. AGENTS.md requires a mechanical half, not prompt
  wording alone.
- Apply the git-output rule to plan.md, which carries the same git
  allowlist on the same model and was missed.
- Use `git diff HEAD` throughout: a bare `git diff` reads empty once an
  executor has staged its work. Steps 6 and 9 said plain `git diff`,
  contradicting the new rule in the same prompt.
- Move the task_id instruction to its own step. opencode surfaces an id
  only in `Subagent failed (task_id: ...)`, never on a returned-but-wrong
  diff, so it was inert where it sat. Name the mechanism (the task tool's
  task_id argument) and the silent-fresh-session fallback.
- Pin all of the above with contract tests, and assert no role other than
  design grants the skill permission.
- Document design's `skill: allow` in the README threat model: it skips
  the per-use prompt and overrides a global skill deny.
@mihneaptu
mihneaptu marked this pull request as ready for review August 24, 2026 10:45
@mihneaptu
mihneaptu merged commit 1bd8567 into main Aug 24, 2026
8 of 9 checks passed
@mihneaptu
mihneaptu deleted the fix/main-agent-git-context branch August 24, 2026 10:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant