Skip to content

V2: remove V1 event surface after cutover (tracking) #35054

Closed

Description

@kitlangton

Tracking issue so the V1 event surface is removed deliberately, in one sweep, after V2 cutover. Collected while working #35021 (event audit), which intentionally deletes nothing V1.

Inventory to remove

Legacy definitions and manifests

  • packages/schema/src/v1/* legacy event definitions
  • Compatibility entrypoints that remain outside that subtree:
    • packages/schema/src/session-v1.ts
    • packages/schema/src/filesystem-v1.ts
    • packages/schema/src/legacy-event.ts
    • packages/schema/src/permission-v1.ts
    • packages/schema/src/question-v1.ts
  • Core compatibility facades:
    • packages/core/src/v1/session.ts
    • packages/core/src/v1/permission.ts
  • Standalone V1-only event modules:
    • packages/schema/src/ide-event.ts (ide.installed), dead remnant of the old automatic IDE-extension install/toast flow
    • packages/schema/src/session-compaction-event.ts (session.compacted), superseded by current compaction lifecycle events
    • packages/schema/src/project.ts (project.updated legacy event definition)
    • packages/schema/src/lsp-event.ts (lsp.updated)
    • packages/schema/src/mcp-event.ts (mcp.browser.open.failed), already excluded from the current MCP inventory but still published by V1
  • packages/schema/src/session-status-event.ts, V1-only and not in ServerDefinitions; still published by packages/opencode/src/session/status.ts. Its retry status union (attempt/message/action/next/isRetryable) is condemned vocabulary.
  • EventManifest session V1 splits (sessionV1Durable/sessionV1Live) and compatibility-only entries in the full Definitions map (packages/schema/src/event-manifest.ts)

Active compatibility bridges

  • EventV2Bridge (packages/opencode/src/event-v2-bridge.ts)
  • Current Core's remaining V1 durable bridge:
    • packages/core/src/session.ts publishes session.created through SessionV1.Event.Created
    • packages/core/src/session/projector.ts projects session.created, session.updated, session.deleted, message.updated, message.removed, message.part.updated, and message.part.removed
  • V1 publishers for the standalone events above, including packages/opencode/src/session/compaction.ts, project/project.ts, lsp/lsp.ts, and mcp/index.ts

Consumers to migrate or remove

  • packages/app V1 event consumers:
    • src/context/global-sync/event-reducer.ts
    • src/context/server-session.ts
    • src/context/permission.tsx
    • src/context/notification.tsx
    • src/pages/layout.tsx
    • pages/session/usage-exceeded-dialogs.tsx
  • Current TUI transitional V1 subscribers:
    • packages/tui/src/app.tsx
    • packages/tui/src/feature-plugins/system/notifications.ts
  • V1 CLI run stream consumers once the V2 CLI replaces opencode run:
    • packages/opencode/src/cli/cmd/run/noninteractive.ts
    • packages/opencode/src/cli/cmd/run/stream-v2.transport.ts
    • packages/opencode/src/cli/cmd/run/stream-v2.subagent.ts
    • packages/opencode/src/cli/cmd/run/session-data.ts
    • associated tests
  • V1 retry implementation once V2 runner retry matures (V2: port V1 LLM retry policy into opencode #35002):
    • packages/opencode/src/session/retry.ts
    • packages/opencode/src/session/status.ts
    • retry paths in packages/opencode/src/session/processor.ts

Generated surfaces and tests

  • Regenerate or retire legacy event unions in:
    • packages/sdk/openapi.json
    • packages/sdk/js/src/v2/gen/types.gen.ts
    • packages/sdk/js/src/gen/types.gen.ts
    • packages/codemode/test/fixtures/opencode-v2-openapi.json
  • Legacy contract tests:
    • packages/schema/test/legacy-event.test.ts
    • packages/schema/test/v1-isolation.test.ts
    • packages/core/test/legacy-event-schema.test.ts
    • V1 assertions in packages/opencode/test/event-manifest.test.ts

Keep out of this sweep

  • mcp.tools.changed is an active internal V2 Core event.
  • server.connected is actively synthesized and consumed by current clients.
  • vcs.branch.updated, installation.updated, and installation.update-available are current public events.
  • Workspace/worktree lifecycle events and global.disposed need separate product decisions; they are not automatically obsolete just because their current implementation crosses legacy paths.

Notes

  • specs/v2/schema-changelog.md stays historical; never rewrite old entries.
  • Blocked on V2 CLI replacing opencode run and packages/app migrating to the V2 stream.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Jul 3, 2026
  2. kitlangton commented on Jul 23, 2026

    @kitlangton
    ContributorAuthor

    Cutover requirement from #38367: remove persisted obsolete pre-release durable tool event rows, including session.tool.success.1 and session.tool.failed.1, before V2 stable. The canonical tool-result migration intentionally rewrites only session_message projections and leaves these rows untouched for now, because no production path rebuilds projections from them and rewriting them adds substantial upgrade cost.

    When cleaning them up, preserve event_sequence high-water marks (do not renumber later events), verify durable log reads tolerate the resulting sequence gaps, and make the non-replayable pre-cutover baseline explicit. Related retention work: #33356.

  3. neriousy commented on Oct 21, 2026

    @neriousy
    Member

    Mostly done: packages/opencode was deleted, which removed EventV2Bridge, V1 retry/status and the run stream consumers, and #40382 and #43045 removed V1 compatibility from the app. Some V1 schema modules (schema/src/v1/*, legacy-event.ts, filesystem-v1.ts and others) and their entries in event-manifest.ts are still there. Closing this tracker. The remaining removal is mechanical cleanup.

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

    2.0coreAnything pertaining to core functionality of the application (opencode server stuff)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions