Skip to content

fix: separate Navigator from subagent delegation - #112

Merged
dbpolito merged 2 commits into
mainfrom
fix/navigator-session-delegation
Jul 28, 2026
Merged

fix: separate Navigator from subagent delegation#112
dbpolito merged 2 commits into
mainfrom
fix/navigator-session-delegation

Conversation

@dbpolito

Copy link
Copy Markdown
Contributor

Ticket

SKIPPED

Description

Reserve Navigator for explicitly requested native-session workflows while directing ordinary delegation to OpenCode's built-in task tool. Created sessions now inherit the caller's agent, model, and variant, and V2 operations reject unknown agent names before prompt admission.

Checklist

Delegation Boundaries

  • Restrict Navigator guidance to explicit native-session and worktree workflows
  • Direct subagent delegation and waiting to the built-in task tool

Session Context

  • Inherit caller agent, model, and variant when creating sessions
  • Validate V2 agent names before creating or steering sessions

Documentation

  • Update adapter and web documentation with the revised lifecycle behavior
  • Replace delegation-oriented Navigator alias examples

Validation

  • Verify that bun run compile completes successfully
  • Confirm that bun run typecheck reports no diagnostics
  • Check that all core and OpenCode adapter tests pass

- reserve Navigator tools for explicit native session workflows
- inherit caller agent and model context for created sessions
- reject unknown V2 agents before prompt admission
- document and test the updated lifecycle behavior
@dbpolito dbpolito self-assigned this Jul 28, 2026

@kompassdev kompassdev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

★★★★☆

Navigator cleanly separates native-session orchestration from subagent delegation, and the caller-inheritance + V2 agent validation logic is well covered by the new tests. Two medium concerns:

  • (inline) assertKnownV2Agent runs after worktree creation on the new_worktree path, so an unknown agent now leaks a worktree with no error context.
  • packages/opencode/navigator.ts:898 — V2 session_create and session_send now hard-depend on client.v2.agent.list for every call that selects an agent (including caller-inherited agents), but getNavigatorCompatibilityWarning only verifies client.v2.session methods for the V2 path. If a runtime-"compatible" OpenCode version lacks v2.agent.list, every agent-carrying V2 create/send throws an unrelated "OpenCode agent list" failure instead of operating or emitting the Navigator-incompatibility warning. Worth confirming 1.17.12 ships agent.list, or adding it to the V2 hasMethods list (and degrading gracefully when missing).

Comment thread packages/opencode/navigator.ts Outdated
@dbpolito

Copy link
Copy Markdown
Contributor Author

Addressed the client.v2.agent.list compatibility concern from review 4798096892 in 6965a77. The V2 compatibility probe now requires agent.list, so runtimes missing that API emit the existing Navigator incompatibility warning instead of failing later during create/send. Added regression coverage for the missing-method case.

@dbpolito
dbpolito merged commit a355188 into main Jul 28, 2026
1 check passed
@dbpolito
dbpolito deleted the fix/navigator-session-delegation branch July 28, 2026 14:21
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