Skip to content

fix: support current V2 service discovery when starting scripts #87

Closed

Description

@kitlangton

Drive 2.1.0 cannot launch the existing network-properties gauntlet against OpenCode V2 revision 4fc5ba1358. The isolated server starts, but SDK attachment fails with OpenCode service registration was not found and Drive stops it.

Reproduction: run packages/drive/test/manual/tui-regressions/network-properties.ts through opencode-drive start --name remote-inbox-gauntlet --script <script> --dev <V2 checkout>, with seed 42 and 12 steps.

Expected: attach the SDK to the script-owned server. Actual: fail before launching the TUI or running the scenario. Investigation is ongoing: Drive uses its older client Service.discover; current V2 uses /api/status rather than /api/health. My initial description incorrectly identified files/.opencode/service-local.json as the registration; that is private service configuration, not the live registration, which cleanup removes.

Observed while investigating a separate remote-client inbox synchronization defect. This issue concerns Drive startup only; no application reproduction has run through this failed launch. No credentials or private project data are included.

Activity

  1. changed the title [-]fix: discover scripted service from its configured registration path[/-] [+]fix: support current V2 service discovery when starting scripts[/+] on Sep 15, 2026
  2. kitlangton commented on Sep 15, 2026

    @kitlangton
    ContributorAuthor

    Confirmed a temporary workaround: use the target V2 checkout’s current Effect service discovery and Effect client in src/driver/opencode.ts. Replacing discovery alone gets the TUI running, but the old SDK then fails the gauntlet’s first projection check. Replacing both lets seed 42 / 12 steps finish (4 submissions, 2 latency windows, 2 blackholes, 1 steer).

    A separate deterministic recording also runs with that shim. The earlier registration-path hypothesis was wrong; this is service/client compatibility drift. The workaround lives in a disposable Drive checkout.

  3. kitlangton commented on Sep 15, 2026

    @kitlangton
    ContributorAuthor

    Reproduced with opencode-drive v2.1.0 while running a scripted before/after capture against current OpenCode V2 (origin/v2 at 6a30741c45). The script server and service both became ready (server listening on http://127.0.0.1:51320), then Drive immediately stopped with OpenCode service registration was not found before launching the TUI. The checkout had a fresh bun install; retrying after installation produced the same failure.

  4. kitlangton commented on Sep 16, 2026

    @kitlangton
    ContributorAuthor

    Reproduced with Drive 2.1.0 against V2 2cdd938152 while recording background-shell restart recovery. start --name recovery-before --dev <checkout> --script <script> reaches “script server ready”, then fails with “OpenCode service registration was not found”. Using the current checkout’s Effect client and service discovery in a disposable Drive worktree gets the real TUI and server restart scenario running.

  5. kitlangton commented on Sep 16, 2026

    @kitlangton
    ContributorAuthor

    Fixed in #89 and released as [email protected] (#90). Drive now pins @opencode/[email protected], whose service discovery probes /api/status. Verified the stock installed 2.1.1 CLI attaching to OpenCode origin/v2 (2cdd938152) via --dev and running a scripted tool call end to end.

  6. kitlangton commented on Sep 18, 2026

    @kitlangton
    ContributorAuthor

    This has regressed with opencode-drive v2.1.1 against current OpenCode V2 (0fa881efd0). Drive reaches “script server ready”, probes GET /api/status (404), then exits with OpenCode service registration was not found before launching the TUI. I reproduced it twice, including against the previously compatible 2cdd938152 checkout with the 2.1.1 client. In a disposable Drive worktree, updating @opencode/client from 0.0.0-dev-19699 to 0.0.0-dev-19764 restores scripted startup and lets the restart probes run.

  7. kitlangton commented on Sep 18, 2026

    @kitlangton
    ContributorAuthor

    The current protocol refresh is in #91. It updates Drive to the consolidated server.info() / /api/info contract and passes the full package suite plus the real current-V2 compatibility probe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions