Repository navigation
Conversation
Apply scoped child mutations to the current storage draft so independent plugin setups cannot overwrite each other. Preserve explicit pruning, earliest failure times, and pending evidence across rejected writes. Cover shared deferred storage in both flush orders and retain the mounted sidebar/chip and remount regressions.
Resolve native provider credentials in an independent server companion and return validated usage through location-aware, cancellable RPC calls. Retain quota polling, stale/backoff behavior, and the Go parser contract. Mount Home and Quota on native slots with renderer/location-shared leases, view-owned selection, and draft-based Z.AI persistence. Cover the boundary and native UI lifecycle with 162 focused tests and record Task 5 evidence.
Handle invalid Z.AI results explicitly so cached usage remains visible as stale until the existing horizon expires. Preserve the validated RPC classification and the no-data fallback modes. Cover malformed JSON and payloads, unsuccessful envelopes, stale expiry, recovery, and authentication clearing. Record the red/green evidence and self-review for Task 5 fix round 1.
Apply the user scope amendment to the native V2 migration. Remove report commands, exports, pricing, usage adapters and report-only tests while preserving live SesTokens, Context and connected session pagination. Retire known managed report artifacts and registrations on deployment, preserve unrelated same-basename paths, and verify repeatable cleanup in temporary roots. Include the amended migration spec and plan. BREAKING CHANGE: removes all eight /tokens_* commands and the ./token-report package export. Remove Token Reports registrations; redeployment cleans managed legacy report paths and command definitions. Live SesTokens and Context accounting remain available.
Allow an invocation-local dist root and keep build fixtures, outputs, imports and invalid-manifest probes in a temporary test root. Force deployment cleanup between fixture mkdir and writeFile, then verify real concurrent build/deployment isolation and artifact contents. Preserve default production output paths and full-suite concurrency.
Apply the user scope amendment by removing the rename server plugin and its dedicated build, deploy, and test tooling. Retire managed artifacts, registrations, and exact generated command definitions while preserving custom commands, title preferences, and existing session data. Keep private build-output isolation and include the amended migration spec and plan. Record remaining aggregate migration gates for Tasks 8-9. BREAKING CHANGE: /session-rename and its server plugin are removed. Redeploy to clean recognized managed artifacts and generated command definitions. Custom commands and explicit title-agent settings remain.
Honor effective native plugin fields for registrations and options. Resolve retained feature subpaths before aggregate Quota aliases and preserve adjacent JSONC text during command cleanup and field creation. Cover legacy-only and mixed native configs, per-feature options, comment preservation, and repeat deployment with real temporary-root regressions.
Complete native integration coverage and document the six retained features. Verify built packages in an isolated OpenCode 2.0.16 PTY. Bundle server helpers and retain import whitespace required by its loader. Recognize legacy IDs during deployment and untrack the Task 5 report. BREAKING CHANGE: requires OpenCode 2.0.16 or newer. Redeploy native package directories using plugins entries with package/options; CLI settings belong in global cli.json. LSP, TODO, Token Reports and session rename are retired. Runtime IDs use aamkye.opencode-tools-*, so plugin-owned persisted state starts in the new namespace.
Use selected-session metadata for Context spend across cached transcript pages. Roll back partial Z.AI factory ownership and validate omitted SubAgent parents before publishing topology or pruning failure evidence. Cover native cache accounting, failed plugin activation, retained hub leases, and missing-parent refreshes. Make temporary wiring setup self-contained and provider-retention assertions distinguish providers.
Share per-session sources across sidebar and footer consumers, disposing them after the last lease. Update running SubAgent durations without rescanning histories or recreating rows. Reuse successful snapshot histories with targeted metadata and message refreshes. Retain invalidations across cancellation and reload complete snapshots on reconnect or recovery. Cover lifecycle and cache behavior.
Limit independent builds to four workers, preserve result order, and settle active writes before reporting failures. Skip Babel for plain TypeScript while retaining Solid transforms for TSX. Local three-run medians fell from 0.373s to 0.262s for plugin builds and from 0.464s to 0.366s for fixture compilation. Cover worker bounds and failure cleanup with regression tests.
Inline shared helpers into each UI bundle and remove the shared artifact from builds and deployment. Retain the minimal V2 package wrappers and preserve renderer-scoped provider sharing across independent bundles. Verify isolated bundle loading, deployment migration, and native V2 provider request sharing.
Keep quota schemas out of non-quota bundles, isolate countdown updates from structural rendering, and share cached session token totals. Verify with 574 tests, typecheck, build, and the native V2 smoke test.
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
Migrate opencode-tools to the native OpenCode V2 plugin and client APIs, requiring OpenCode 2.0.16 or newer.
Retain six features: Home, Context, SesTokens, SubAgent, Quota, and MCP. Add a separate server-side quota companion and package each UI section as an independent bundle.
Changes
Native V2 integration
Reliability and interaction
Packaging and performance
tui.js, retaining the minimal V2 package wrapper.Breaking changes and migration
/tokens_*commands, the./token-reportexport, and/session-rename.tui.jsfiles.cli.json.aamkye.opencode-tools-*; plugin-owned persisted state starts in the new namespace.Redeploy with
npm run deploy:localornpm run deploy:global, then reopen the TUI. Deployment migrates recognized registrations and removes retired managed artifacts while preserving unrelated configuration and custom commands.Verification
npm test: 574 tests passednpm run typechecknpm run buildnpm run test:v2-smokeon OpenCode 2.0.16git diff --checkThe native smoke test uses isolated HOME/XDG directories and a private server. It verifies plugin activation, slot mounting, shared quota requests, native storage behavior, and cleanup.