Repository navigation
feat(composer): show context and connectors next to the model picker - #6285
Open
m-froehlich wants to merge 1 commit into
Open
m-froehlich wants to merge 1 commit into
m-froehlich wants to merge 1 commit into
Conversation
Contributor
Contributor screen: passedCommit No hidden characters, dependency, database or obfuscation concerns. Nothing else runs yet. A maintainer reviews the changes then comments |
Contributor
|
Someone is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Author
|
Ready for review; please run /test when you have a moment. |
m-froehlich
force-pushed
the
feat/composer-context-indicators
branch
from
October 21, 2026 15:43
6a6d056 to
5140c37
Compare
abdofallah
added a commit
to abdofallah/openwork
that referenced
this pull request
Oct 26, 2026
Port of different-ai#6285 (5140c37) onto dev, reconciled with the v2 cost capture from different-ai#6337 and regenerated Helm feature locks.
Two quiet controls in the composer row, behind composerContextIndicators (declared off, cloud and self-hosted, with an internal doc): - Connectors: how many MCP servers are connected, a logo stack, and a list with sign-in or a short note for the others. - Context: "Context: 34%" with a ring that turns amber from 70% of the window and stronger amber shortly before the engine compacts. The popover shows the measured total, a segmented bar and a row per category (estimates marked), with a switch between share of the window and share of the used context. Everything is computed locally. The v2 adapter keeps the usage OpenCode reports (session.step.ended becomes session.usage.measured) and reads the engine context; a small store beside the transcript holds the latest figure per session. The compaction ceiling follows each engine, including the v2 buffer given as tokens or as a share. Refs different-ai#2724 Builds on the approach of different-ai#2902. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
m-froehlich
force-pushed
the
feat/composer-context-indicators
branch
from
November 21, 2026 09:28
5140c37 to
faad61a
Compare
Author
|
@reachjalil this is rebased onto current dev, signed, and has no generated files. Whenever you next go through the external PRs, could you take a look? The head is faad61a. Thanks! |
This branch was successfully 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.
What
Two quiet controls in the chat box, next to the model picker, behind
composerContextIndicators:first; the others dimmed, with their sign-in action or a short note).
stronger amber shortly before the engine compacts). A click opens what fills it: a segmented bar and a row
per category, with a switch between share of the window and share of the used context.
Everything is computed locally from what the app already holds. No model is asked.
Fixes #2724. Builds on the approach of #2902, which was closed unmerged and showed the total only.
How is this implemented?
Behind
composerContextIndicators(cloud and self-hosted, off by default), declared inpackages/features/src/flags/composer-context-indicators.tswith an internal doc and screenshots indocs/features/composer-context-indicators/. Safe to kill: the controls vanish and nothing else changes. No OpenAPIor SDK files are committed; CI generates them.
overflow formula so the indicator and the compaction agree (v1
tokens.total, v2 the sum of all fields).The v2 adapter used to drop that usage block; it now keeps it and turns
session.step.endedinto a smallevent of its own (a sparse
message.updatedwould overwrite the transcript row). A small store beside thetranscript holds the latest figure per session.
limit.input - reserved, orlimit.context - maxOutputTokens.v2: the smaller of the input limit and the context window, minus the configured buffer (tokens or a share such as
20%), ormax(15%, 16000)when none is set. The strong step starts 5% of the window before that ceiling.scaled down if they exceed the measured total; the rest is shown as "system and other", so the rows always
add up. v1 reads the engine's tool list; v2 reads
GET /api/session/{id}/context.session opens, with a passive read that skips the silent re-authentication.
usage is not the size of the context that follows.
Design rules (DESIGN.md)
P3 progressive disclosure (details only in popovers), P5 existing primitives (
Popover,Button,ConnectorLogo), S2 compact rows, S7 floating surfaces open upwards and fit, T5 quiet composer controls,V2 and C5 amber and never red for a limit, colour never the only carrier (ring fill, numbers and text).
Evidence
Run as the desktop client (Electron) in a test profile, and against the real engines OpenCode v1.18.30 and v2.0.26
with a fake model that reports its usage as request characters / 4. Since then the branch was rebased onto current
dev, and the formulas were checked again by reading the sources of OpenCode v1.18.33 and v2.2.6 (total, ceiling,buffer setting, entry types and the context endpoint). That check was not run against a live v2.2.6 engine.
Tests: 110 new tests in seven files (logic, formulas against recorded engine payloads, the v2 usage mapping,
the store, both controls in happy-dom).
tsc --noEmitforapps/appandpackages/features, code habits, prosehabits, app structure, i18n and
features:checkpass locally. The rest ofpnpm checkwas not run locally, becausenative modules cannot be built on my machine; CI will.
Known limits
just compacted, the indicator can show the pre-compaction size until the next reply.
the rest stays in "system and other". On v2 the built-in tools cannot be listed and stay there; the row shows
MCP tools only, when there are any.
🤖 Generated with Claude Code