Skip to content

Add OpenCode Navigator session orchestration - #111

Merged
dbpolito merged 8 commits into
mainfrom
feature/kompass-navigator
Jul 27, 2026
Merged

Add OpenCode Navigator session orchestration#111
dbpolito merged 8 commits into
mainfrom
feature/kompass-navigator

Conversation

@dbpolito

@dbpolito dbpolito commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Ticket

SKIPPED

Description

Adds opt-in OpenCode-native orchestration for creating, inspecting, continuing, waiting for, interrupting, and cleaning up sessions across the current checkout and managed worktrees. Navigator remains disabled by default, enforces project and worktree boundaries, and recovers state directly from OpenCode after plugin restarts.

Checklist

Native Orchestration

  • Add eight SDK-backed session and managed-worktree tools
  • Support asynchronous parallel sessions, bounded reads, and first-idle waits

Configuration And Safety

  • Add the opt-in feature gate, aliases, limits, schema, and compatibility warning
  • Enforce project ownership, self-target restrictions, and guarded removal

Documentation And Distribution

  • Update package, adapter, configuration, tool, and homepage documentation
  • Regenerate OpenCode artifacts and validate the publishable package

Validation

  • Verify that all 116 automated tests pass
  • Confirm that typecheck, compile, import check, and package build pass
  • Check Navigator manually in OpenCode Desktop and TUI after restart

- add native session and managed worktree tools
- enforce project scope, limits, and lifecycle safety
- document configuration and cover runtime behavior
@dbpolito dbpolito self-assigned this Jul 25, 2026
dbpolito added 2 commits July 25, 2026 20:05
- register all Navigator tools on compatible OpenCode runtimes
- retain feature-level and per-tool opt-out controls
- update bundled config, generated artifacts, tests, and docs
- detect and route sessions through the compatible OpenCode protocol
- add legacy session handling for prompts, reads, status, and interrupts
- replace V2 wait calls with local active-session polling
- remove queued delivery from the Navigator send tool surface
- update Navigator tests and docs for protocol-aware behavior

@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.

★★★★☆

Solid implementation: ownership checks, worktree guards, self-target rejection, partial-failure resource reporting, and poll-based wait are all consistently handled and well-tested. One medium edge-case finding inline on navigator.ts — legacy (V1) errored tool outputs are silently dropped because the projected error shape does not match what summarizeMessages reads.

Comment thread packages/opencode/navigator.ts Outdated
dbpolito added 2 commits July 27, 2026 10:08
- add optional agent and model overrides to session_send
- map V1 sends to promptAsync agent/model fields
- switch V2 session agent or model before steering prompts
- document wait timeout defaults and caps
- cover V2 context switching in Navigator tests
- register a bundled Rift workspace adapter for OpenCode experimental workspaces

- prefer Rift for new Navigator workspaces when available and use Git worktrees as fallback

- use Rift copy-all snapshots and default storage to avoid filtered APFS copy failures

- document Rift behavior and cover adapter/list/remove paths in tests

@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.

★★★★☆

Solid follow-up: the previously raised legacy errored-tool-output issue is fixed and tested, and the Rift workspace adapter integrates cleanly with listing, creation, and removal. One medium edge-case inline on navigator.ts — on the V1 protocol path, active-session tracking does not enumerate Rift workspace directories, so an active session running in a Rift workspace is invisible to session_wait, the worktree_remove active-session guard, and the session_create concurrency cap.

Comment thread packages/opencode/navigator.ts Outdated
- retry Rift workspace removal once when OpenCode re-discovers the path

- fail if Navigator cannot confirm the workspace disappeared

- cover stale-list retry behavior in Navigator tests

@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.

★★★★☆

The new Rift removal retry/verification logic in worktree_remove is sound and well-covered by the updated navigator.test.ts (stale-list re-discovery path is exercised, failure fails closed).

The outstanding concern from the open thread on navigator.ts:176 is not addressed by this commit: on the V1 protocol branch, activeSessionIDs calls listManagedWorktrees(client, navigator.checkout) without navigator.projectID, so listRiftWorkspaces is never consulted. A session running in a Rift workspace therefore stays invisible to session_wait polling, the worktree_remove active-session guard, and the session_create maxConcurrentSessions cap. Smallest fix remains passing navigator.projectID so Rift workspace directories are enumerated. No new inline findings beyond that open thread.

@dbpolito

Copy link
Copy Markdown
Contributor Author

Handled the duplicate review-body concern from the latest bot review in 27483cc: V1 active-session tracking now enumerates Rift workspaces, and the regression test verifies the active-session removal guard sees /repo-rift.

@dbpolito
dbpolito merged commit fd7ebd1 into main Jul 27, 2026
1 check passed
@dbpolito
dbpolito deleted the feature/kompass-navigator branch July 27, 2026 20:38
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