Skip to content

fix: correct OpenCode CLI args (fixes #11)#12

Open
longyangxi wants to merge 379 commits intomasterfrom
feat/agency-agents-integration
Open

fix: correct OpenCode CLI args (fixes #11)#12
longyangxi wants to merge 379 commits intomasterfrom
feat/agency-agents-integration

Conversation

@longyangxi
Copy link
Owner

Summary

  • OpenCode backend used invalid run <prompt> --quiet args that don't exist in the CLI
  • Changed to -p <prompt> -f json -q matching the actual OpenCode CLI interface
  • Verified against OpenCode source code (cmd/root.go): -p for prompt, -f for output format, -q for quiet mode

Fixes #11

Test plan

  • Install OpenCode CLI and verify opencode -p "hello" -f json -q works
  • Run Bit Office gateway with OpenCode as backend, confirm tasks execute successfully
  • Verify JSON output is parseable by the orchestrator output-parser

longyangxi and others added 30 commits March 19, 2026 21:15
…rktree for other backends

Claude backend now uses native --worktree flag when a solo neighbor is detected,
avoiding the absolute-path penetration bug where bit-office manual worktree
was bypassed by Grep/Read/Edit using main-repo paths. Other backends (codex,
gemini, aider, opencode) retain the existing hasSoloNeighbor + manual worktree
logic. The useNativeWorktree flag is re-evaluated per task to avoid stale state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review UI no longer covers the full agent panel while working.
Phase 1: compact bottom bar with reviewer avatar + live status.
Phase 2: slide-up panel (65% height) with results + feedback input box.
User feedback is injected into the fix prompt when applying fixes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Worktree isolation was ineffective: Claude Code Grep/Read/Edit tools
use absolute paths that penetrate back to the main repo, bypassing the
worktree boundary. The native --worktree flag conflicts with -p and
--resume, causing exit code 1 on simple conversations. Solo agents now
rely on peer awareness context (buildSoloPeerContext) to avoid conflicts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Preview server's killPortHolder would lsof managed ports and SIGKILL
any process found — including the gateway itself when WS port bumped
into the preview port range (9100). Removed killPortHolder entirely
(stop() already kills its own spawned process) and moved preview ports
to 9198-9199, far from the gateway's 9090 range.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
React state updates are async, so the reviewOverlay state guard in
handleReview could be bypassed by rapid double-triggers. Added a
reviewInProgress ref that updates synchronously to block duplicates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The method was deleted but one call site in runCommand was missed,
causing a runtime crash (calling undefined function) when preview
used command mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fall back to the last line of the streaming message when lastLogLine
is null, so the working dots area stays in sync with the chat bubbles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nitializes

Root cause: two-phase review overlay (mini bar) no longer covers the
chat area, so the review button remained clickable during the window
between setReviewOverlay and the reviewer agent appearing in the store.
Fix: use onDismissReview presence (set immediately) as the guard
instead of reviewerOverlay data (null until agent is created).

Also: gateway-side dedup as safety net, show only last review message.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SSR rendered media="print" while client switched to media="all"
on load, triggering React hydration warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…o-retry

Codex often exits with code 1 despite producing valid output. The
retry tracker treated this as a failure and re-ran the review task,
causing duplicate review results. Reviewers don't benefit from retry
so skip them entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tsx watch kills the process during restart. If writeFileSync is
interrupted between truncate and write, the file becomes 0 bytes
and agents are lost on next startup. Use tmp file + rename instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Extract DELIVERABLE_RULES and DELIVERABLE_RULES_FIX constants
  to single-source the report format across 3 worker templates
- Add guard clause: only use STATUS format when files are changed,
  reply in plain text for conversation
- Fix backtick escaping: use array join instead of template literal
  escaping so markdown code blocks render correctly
- Add NEVER absolute path constraint to ENTRY_FILE to fix preview
  path concatenation errors in gateway

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- page.tsx: busy = reviewResultText === null (was gated on working/waiting_approval, so reviewer starting as idle skipped Phase 1 entirely)
- page.tsx: effect guard -- dont treat idle/done as terminal if reviewer has no agent messages yet
- AgentPane.tsx: Phase 1 upgraded from status bar to scrollable mini window covering input area, shows role + dots animation + streaming thoughts
- AgentPane.tsx: Phase 2 renders all agent messages (not just last one)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- gateway: execSync -> execFileSync for git diff (no shell injection via filenames)
- gateway: scope git diff to changedFiles only (prevents leaking unrelated repo changes)
- gateway: skip git diff when changedFiles is empty, fall through to file reading
- page.tsx: require at least 1 agent message before setting reviewResultText
  (fixes race where status=done arrives before message, locking in empty result)
- page.tsx: combine all reviewer agent messages for Apply Fix prompt
  (reviewer may split findings across multiple messages)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cosmetic rename only — display text, README, doc files, Tauri config,
splash screen, PWA manifest. Package names (@bit-office/*), CLI bin
(npx bit-office), and runtime config paths (~/.bit-office/) are
intentionally unchanged to avoid breaking the build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ubcommand

Fixes #11. OpenCode CLI uses -p <prompt> -f json -q for non-interactive
mode, not run <prompt> --quiet which does not exist.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previous fix incorrectly used -p/-f/-q flags from archived opencode-ai/opencode.
The active version (anomalyco/opencode v1.x) uses: run [message..] --format json
where -f means file attachment and -p means password, not prompt/format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Next.js static export fails looking for the auto-generated
_not-found/page.js.nft.json. Adding an explicit not-found.tsx
resolves the ENOENT error during desktop build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
marklong and others added 30 commits March 23, 2026 15:50
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.

Cannot get this working with open code.

1 participant