Skip to content

refactor(app): extract context usage extension - #47948

Draft
Hona wants to merge 2 commits into
review-extensionfrom
context-extension
Draft

refactor(app): extract context usage extension#47948
Hona wants to merge 2 commits into
review-extensionfrom
context-extension

Conversation

@Hona

@Hona Hona commented Sep 8, 2026

Copy link
Copy Markdown
Member

Context as a built-in extension

  • Move the context-usage button, statistics, system-prompt display, raw messages, and export implementation into @opencode/plugin-context-desktop.
  • Declare an initially closed panel and open it from the extension's header action or command. Use the host's closing policy without coupling to another plugin's default panel.
  • Read session history and model/provider metadata from the shared public data cache; export every message page through the public client.
  • Compose shared controls, Markdown, and file rendering. No imports from App, Desktop, Core, or Server internals.
flowchart LR
  Cache[Public session and model cache] --> Context[Context extension]
  Context --> Button[Session header action]
  Button --> Panel[Host-owned Context panel]
  Context --> Export[Public client: paged session export]
Loading
<Panel id="context" reference="context" initial="closed" title={title}>
  <SessionContextTab session={session} view={session.services.view} />
</Panel>
Before: review-extension After: context-extension
Host context panel Extension context panel

Synthetic session fixture; no live-session data.

Production session-switch comparison

Baseline review-extension (37218177cf), candidate 4f1dbd8189. Production web renderer, Chromium 147, 400 messages/session, two serial samples per scenario. Median milliseconds; exploratory sample sizes, not a performance-improvement claim.

Scenario First correct: before After Stable: before After
cold, review closed 293.20 237.35 320.05 255.80
cold, review open 367.75 387.00 403.15 419.30
warm, review closed 64.80 60.50 118.55 121.45
warm, review open 134.35 139.40 163.55 219.20
warm, review resized 174.25 160.25 263.75 234.10

@Hona Hona changed the title refactor(app): extract context usage into an extension refactor(app): extract context usage extension Sep 8, 2026
@Hona
Hona force-pushed the context-extension branch from df69e7a to a59a5bc Compare September 8, 2026 22:26
@Hona
Hona force-pushed the context-extension branch from a59a5bc to 0fbc66f Compare September 8, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant