Conversation
jensenojs
force-pushed
the
wip-v2
branch
2 times, most recently
from
September 15, 2026 19:02
cc67b2d to
88f78f1
Compare
* refactor: replace api_client/event_manager/session with per-protocol
operations and Observation modules under protocols/{v1,v2}
* feat: auth health probe selects the protocol once per connection;
identity change forces reconnect, no per-request branching
* feat: connect to the native V2 shared service via CLI discovery;
V1 keeps local spawn, explicit URLs, and port coordination
* fix(renderer): rebuild topbar stats bridge from observation usage
(session.usage.updated and snapshot first, latest entry fallback)
* fix(v2): handle session.usage.updated; drop dead branches for
server-absent session.tool.error and file.watcher.updated
* test: per-protocol contract suites and live-captured V2 fixtures
from a real 2.0.1 server; counterexamples for cross-session event
pollution and malformed usage payloads
* docs: add migration draft under docs/drafts; update bidirectional-sync
recipe for the native V2 service path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reworks the client to speak both OpenCode wire protocols (V1 1.18.x and V2 2.0.x) through a single connection/observation architecture.
What changed
protocols/{v1,v2}modules own native endpoints and event interpretation per protocol;ui/consumes one read-only per-session Observation instead of reducing protocol events.service status/get password); V1 keeps local spawn, explicit URLs, and port coordination.api_client,event_manager,session,renderer/events,event_scope,session_scope.session.usage.updated/ snapshot first, latest entry fallback for V1).run_tests.shnow names the spec file when a test file dies at load time (e.g. requiring a removed module), instead of a bare non-zero exit.Contract
The published OpenAPI spec and the running 2.0.x server disagree at several endpoints (
/api/project/current,renamevia POST, promptcommandfield,forkbody shape). This implementation follows the running server; fixtures undertests/data/v2/are live captures from a real 2.0.1 server. Known future break: upstream dev renamespermission.asked/form.*events.Details in
docs/drafts/v2-migration-draft.md(temporary draft intended to be folded into docs later).Testing
./run_tests.shgreen (minimal, unit, replay).protocol_{v1,v2}_{operations,observation}*_spec.lua.