Repository navigation
Conversation
Keep historian observations in bounded session memory and use indexed cache-delta counts. Share the refresh scheduler across OpenCode sidebar paths without changing their layout.
iceteaSA
force-pushed
the
feat/sidebar-option-b
branch
from
November 6, 2026 16:40
331693b to
14ff34d
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This branch has not been deployed
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.
Approved issue: #839
This is a draft. The collapsed view waits for cortexkit/common-auth#12. See "Not in this draft".
Summary
SidebarFramefrom@cortexkit/common-auth/quota-sidebarand shows option B from Sidebar: adopt the shared CortexKit sidebar layout (design proposal, PR offered) #839: Context, History, Prompt cache, Knowledge, Dreamer, and aHealthsection that shows only when something is wrong.Screenshots
Rendered from the compiled sidebar slot with OpenTUI's
testRender, with the OpenCode dark theme colours and fixture values (the values of the #839 mocks).Healthin the warning tone)Changes
Snapshot data
All new
SidebarSnapshotfields are optional, so an older RPC server still works with the new view.historianRunwaitingMessagesproactiveFloorgetProactiveCompartmentTriggerPercentage(executeThreshold)queuedDropTokensidx_pending_ops_session_tag_idand thetagsprimary key.cachedM0MaterializedAt,summariesSinceCache,memoriesSinceCachesession_meta, then two counts. The plans usesqlite_autoindex_compartments_1andidx_memories_project_status_expires. The memory count uses the same workspace visibility rules asm[1].configReloadFailureA historian attempt counts against the model that produced it. A primary attempt counts as rejected when its output fails validation, or when the host answers with a different model. An invalid fallback output does not count against the primary.
OpenCode 1 and OpenCode 2 use the same snapshot builder. In Rust transform mode,
historianRunandwaitingMessagesare missing, because the TypeScript historian does not run.Refresh
loadSidebarSnapshothas a new opt-inthrowOnFailure, so that scheduled reads can see a failure. Other callers do not change.View
Healthwording follows the shared CortexKit sidebar standard: stat rows in the warning or error tone, no glyphs, and at most one muted hint row,/ctx-status shows details.—. An unknown usage showsno reading, not 100%.Hygiene, the dreamer backlog row for each task, the second dreamer progress line, andStats · Total tokens.historianto History,statusto Prompt cache and the notes rows,memoryto Memories,dreamerto Dreamer. The preferences file format does not change.Healthrows are not shown.Build (decision 3)
scripts/build-tui.tsbundles@cortexkit/common-auth/quota-sidebarwith the Solid transform bound to the host runtime ids, plus a raw variant. This is the same method that anthropic-auth uses. The change is +69/−5 lines, and the two bundles are 34,365 B (raw) and 34,631 B (host). I do not think this is heavy.hourstohours2), and Bun 1.4.4 does not. CI usesbun-version: latest, which is 1.4.4 now, socheck:tui-compiledpasses. A later Bun release can change the output for each contributor. A pinned Bun version in CI would prevent this.Not in this draft
SidebarFramedoes not collapse when it has no accounts, and its gauge is not exported. I asked for acollapsibleprop and aSidebarGaugeRowin quota-sidebar: a collapsible frame without accounts, and a gauge row primitive (PR offered) common-auth#12. The local gauge has the same props, so the change to the shared gauge is one import. The collapse preference stays stored and is not used yet.Tests
npm pack --json, andscripts/tui-pack-graph.test.tsand the 4 packed review-bundle tests read[0].files.tui-pack-graphfails the same way without this branch.dist/. They pass afterbun run buildinpackages/pluginandpackages/pi-plugin.064262aa1:typecheckpasses,build:tuion Bun 1.4.4 writes no file,check:tui-compiledpasses, and the focused TUI, v2 TUI, snapshot, historian, event-handler and event-loop tests pass (315 of 315).Harness coverage (required)
For each entry select: covered / not applicable — surface does not exist there / NOT covered.