Skip to content

feat(extensions): add OpenCode subagent compatibility - #1598

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/opencode-subagent-compatibility
Jul 18, 2026
Merged

feat(extensions): add OpenCode subagent compatibility#1598
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/opencode-subagent-compatibility

Conversation

@limityan

@limityan limityan commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a provider-neutral external subagent contract and coordinator, with OpenCode discovery and translation maintained in its own adapter.
  • Reuse the existing Task/subagent runtime while adding explicit confirmation, conflict resolution, immutable generation leases, and exact approved model bindings.
  • Expose bounded GUI and interactive TUI (ChatMode) review flows, including non-blocking deduplicated notices when an active external agent becomes unavailable.
  • Keep source diagnostics and safe path projection ecosystem-neutral so later Claude Code or Codex adapters do not require OpenCode conditions in core or product surfaces.
  • Realign the extension architecture and delivery plan with the implemented Command, standalone Tool, and Subagent slices, while keeping package-plugin and remote-source support explicitly out of scope.
  • Fix the Web lint failure by declaring the complete dependency set for the selected-agent capability tab memo.

Product and safety boundaries

  • Static system prompt files are unchanged.
  • External prompt templates remain backend-only and are never serialized through desktop IPC; dynamic agent listings use BitFun-owned descriptions.
  • Conflicting names require a user choice and remember that choice until the external definition changes.
  • Approval binds the concrete model configuration ID and a secret-free runtime fingerprint. Reserved-looking IDs such as inherit remain ordinary configuration IDs, and provider/model/endpoint drift requires a new approval.
  • A leased generation retains the binding facts it was approved with; execution fails closed if the current runtime configuration no longer matches those facts instead of silently selecting a fallback model.
  • Provider snapshots bound source, definition, provenance, and diagnostic collection sizes and reject invalid diagnostic codes, text, asset kinds, or source ownership.
  • GUI and interactive TUI (ChatMode) receive backend-projected source locations and route diagnostics by neutral asset kind rather than parsing provider codes or OpenCode paths. Known absolute paths are also removed from diagnostic text before the catalog crosses IPC or TUI boundaries.
  • The current Command, standalone Tool, and Subagent slices are local-execution-domain features. Remote workspaces fail closed for local external-source discovery, approval, and conflict resolution, with an explicit unsupported state rather than a generic runtime failure or local-machine fallback.
  • This PR does not add headless CLI/exec management commands, a primary-agent mode, external follow-up semantics, package-plugin loading, a general notification center, or Claude Code/Codex adapters.

Validation

  • Rebased on GCWing/BitFun@5d7df2282; the branch commit is directly based on the current main head.
  • cargo +nightly check --locked -p bitfun-desktop
  • cargo +nightly test --locked -p bitfun-agent-runtime
  • cargo +nightly test --locked -p bitfun-services-core session
  • cargo +nightly test --locked -p bitfun-core --lib: 1165 passed, 1 ignored.
  • Focused Rust suites pass for product-domain contracts, the external-source coordinator, the OpenCode adapter, and CLI external-agent/tool flows (7 agent and 6 tool tests).
  • pnpm run lint:web: passed with 0 errors; 12 pre-existing warnings remain outside this PR.
  • pnpm run type-check:web
  • pnpm run build:web
  • Full Web UI suite: 259 files, 1615 tests passed; focused agent/settings suite: 2 files, 17 tests passed.
  • i18n contract tests: 37 passed; i18n audit passed with 0 warnings.
  • Core boundary check and self-test, repository hygiene, git diff --check, conflict-marker scan, and static system-prompt change scan passed.
  • Independent adversarial architecture and product/UX re-reviews passed after all actionable findings were fixed.

@limityan
limityan force-pushed the yanzhn/opencode-subagent-compatibility branch 2 times, most recently from d49b7b4 to d91a9dc Compare July 18, 2026 01:59
@limityan
limityan force-pushed the yanzhn/opencode-subagent-compatibility branch from d91a9dc to 797e1f9 Compare July 18, 2026 02:30
@limityan
limityan merged commit da027e2 into GCWing:main Jul 18, 2026
5 checks passed
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.

1 participant