Skip to content

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

Merged
longyangxi merged 402 commits intomasterfrom
feat/agency-agents-integration
Mar 24, 2026
Merged

fix: correct OpenCode CLI args (fixes #11)#12
longyangxi merged 402 commits intomasterfrom
feat/agency-agents-integration

Conversation

@longyangxi
Copy link
Copy Markdown
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

marklong and others added 30 commits March 20, 2026 11:57
- install-desktop.sh auto-bumps patch version in both tauri.conf.json
  and root package.json on each build
- next.config.ts reads version from root package.json at build time
  and injects NEXT_PUBLIC_APP_VERSION / NEXT_PUBLIC_APP_BUILD_TIME
- Version badge shown in top-left header, Settings tooltip, and
  Settings modal footer
- build:desktop now uses install-desktop.sh with dynamic productName
  and legacy app cleanup

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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bring back worktree module (removed in 9de9578) with key improvement:
all git operations use getIsolatedGitEnv() which clears 11 git env vars
(GIT_DIR, GIT_WORK_TREE, etc.) to prevent cross-worktree contamination.

- Claude backend uses native --worktree flag for isolation
- Other backends use .worktrees/ managed worktrees
- Successful tasks auto-merge back via squash (mergeOnComplete)
- Failed tasks auto-cleanup worktree + branch
- Git bootstrap uses -c user.name/email for fresh environments
- Stale worktree GC runs on gateway startup

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

Add instructionPath, stability, guardType, and capability flags to the
AIBackend interface inspired by Overstory's AgentRuntime abstraction.
Register 5 new backends (copilot, cursor, pi, sapling, aider enriched)
alongside existing claude/codex/gemini. Use version probes for ambiguous
binary names and argv pattern matching in process scanner to prevent
false-positive detection of unrelated tools.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
worktreePath now takes precedence over repoPath in AgentSession so
worktree isolation actually keeps agent work off the main branch.
Also adds explicit Ably.capabilityOp[] type to fix TS error in ws-server.

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

Prevent stale worktree paths from causing spawn failures and session
clear cascades: validate existence before restore (gateway + orchestrator),
fall back gracefully in agent-session. Increase resume fail threshold
from 2→3 to reduce false session clears. Use registered agent count
(not running count) for worktree isolation decisions. Add rotating file
logger (gateway.log, 5MB) for post-mortem debugging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tart, merge on finalize

- Worktree OFF: agents work directly in designated directory on current branch
- Worktree ON: create branch when agent starts task, keep alive between tasks
  (preserves --resume session history), merge all at finalize
- Startup: always clean ALL residual agent/* branches and .worktrees/
- Never restore stale worktree state from saved sessions
- Delegation and direct-fix paths now create worktrees via prepareWorktree callback
- Solo agents still merge immediately on task completion
- Fixes: agents' changes not visible on main branch; agents losing context
  between tasks due to worktree recreation clearing session history

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
require() is not available in ESM modules — causes ReferenceError at
runtime when worktree merge runs on task completion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Same ESM compatibility issue as orchestrator.ts — require() is not
available, causing cleanupStaleWorktrees to silently fail on startup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
mergeWorktree did squash merge but never committed, so agent work
was staged then lost when the worktree/branch was cleaned up.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When commitOnMerge is true (default): squash merge + auto-commit.
When false: squash merge only, changes left staged for review.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Always squash merge worktree back to main on task completion.
When mergeOnComplete=true + commitOnMerge=true: auto-commit.
When mergeOnComplete=false: squash merge + git reset to unstage,
so changes appear as modified files in git status for review.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
git merge --squash requires a clean working tree, so it fails when
multiple agents leave unstaged changes. Instead, copy changed files
directly from worktree to workspace — works with any working tree state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Simplify worktree merge to one mode: squash merge + auto-commit.
The no-commit / file-copy approach doesn't handle multi-agent
conflicts properly — defer review-before-merge to future UI work.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
longyangxi and others added 29 commits March 23, 2026 23:17
@longyangxi longyangxi merged commit b355f67 into master Mar 24, 2026
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