You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tui: plan usage footer is not synced across TUI instances sharing one service #59062
With several OpenCode TUI tabs open behind a single shared background service,
each footer shows a different Go plan usage/allowance value, because the footer
only renders the opencode.allowance from the most recent inference response that session completed. There is no polling of the shared service and no API
endpoint exposing plan allowance, so tabs show stale or divergent balances for
the same plan.
Active plugins: @xberg-io/opencode-html-to-markdown
Reproduction
Connect a Go plan via /connect and use a Go model.
Open two or more terminal tabs running opencode in the same environment
(all attaching to the same background service; verify opencode service status).
Send requests in one tab only.
Compare the plan-usage readout at the bottom of each tab.
Expected Behavior
All TUI instances connected to the same shared service should display the same,
current plan usage for the Go workspace — ideally refreshed periodically
(polling the shared service) rather than only updating on a session's own
inference response.
Actual Behavior
The footer in each tab shows only that session's last echoed allowance value.
Tabs not used recently (or brand-new sessions) show stale/initial values until
their next request. Nothing syncs while idle.
Additional Context
Inspected the running service's /openapi.json: there is no endpoint exposing
plan allowance. The closest is /api/experimental/session/stats, which returns
aggregate token/cost stats per project — not plan state.
The PlanTabs precedent: the Console's plan-tabs UI already uses a shared syncKey so all plan displays on a page stay synchronized; the same idea
applies to TUI footers via the shared service.
Workspace limits are enforced server-side per plan, so enforcement is correct;
this is a display/observability gap only.
Workaround: check usage in the OpenCode Console, or watch the local /api/experimental/session/stats endpoint for aggregate cost.
Thanks for the detailed write-up! As I understand it, you'd like every TUI instance connected to the same service to show the same, current OpenCode Go plan usage, refreshed periodically rather than only after that tab's own requests.
Some context on why the tabs differ today:
In 2.1.4 the prompt footer is per-session by design. It shows that session's context tokens and percentage and that session's cost, not the plan's allowance. Two tabs are two sessions, so they show different numbers.
Since 2.1.4, plan usage has moved to a separate usage limits API (/api/experimental/usage/limits), and the TUI on dev now has a /usage dialog and a sidebar "Limit … remaining" line (feat(tui): show OpenCode Console usage limits #58731). Those limits load once and only reload on demand, so having them refresh on their own and stay in sync across instances is the open part of your request.
Activity
opencode-agent commentedon Oct 25, 2026
Thanks for the detailed write-up! As I understand it, you'd like every TUI instance connected to the same service to show the same, current OpenCode Go plan usage, refreshed periodically rather than only after that tab's own requests.
Some context on why the tabs differ today:
/api/experimental/usage/limits), and the TUI ondevnow has a/usagedialog and a sidebar "Limit … remaining" line (feat(tui): show OpenCode Console usage limits #58731). Those limits load once and only reload on demand, so having them refresh on their own and stay in sync across instances is the open part of your request.Related requests:
I've marked this as a feature request for the maintainers to consider.