mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4752] [Feature]: Add context budget indicator in Prof. Mari Workspace #2615
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2615
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xDanteMD on GitHub (Aug 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4752
Originally assigned to: @SpicyMarinara on GitHub.
What problem does this solve?
The Workspace assistant (Professor Mari's primary code path, via
workspace-agent.service.ts) provides no persistent visibility into context consumption. Users see per-message token counts when theshowTokenUsagetoggle is enabled, but there's no aggregate readout — no running total that answers "how full is the context window right now?"This is basic UX hygiene. Every AI chat interface that takes context management seriously provides this. It should exist regardless of whether the user is "hitting limits" — it removes an abstraction layer and lets users see what's actually happening with their context.
Practical value. Most users will likely stay under 100K tokens per conversation. But the feature earns its keep in the margins:
The data already exists on both sides. The server calculates and returns
promptTokensandcompletionTokensviaLLMUsageon every generation. The client receives this and displays it per-message when the toggle is enabled. ThemaxContextfield on each connection holds the model's configured maximum (default 128,000; configurable per-provider). ThePeekPromptModalcan show token estimates on demand. The gap is purely a persistent, at-a-glance display.Proposed solution
Add a lightweight context budget indicator to the chat UI that shows:
Minimal implementation:
showTokenUsagetoggle or a new setting)Alternatives considered
Additional context
app_datatool andmari-db.service.ts— this issue targets that code path, not the legacy conversational assistant.*Research: codebase analysis of
generate.routes.ts(token usage flow),ChatMessage.tsx(per-message display),ChatSettingsDrawer.tsx(agent contextSize — message count, not token budget),PeekPromptModal(token estimates),seed-mari.ts(MARI_ASSISTANT_PROMPT — ~9K tokens),workspace-agent.service.ts(workspace assistant code path),connections.ts(OAI-compatible endpoint support,maxContextfield). Token estimates verified with tiktoken (cl100k_base). GitHub issue search found no duplicates.@SpicyMarinara commented on GitHub (Aug 8, 2026):
SpicyMarinara is taking this in the current assigned-issue sweep. I am preparing a focused draft PR against
stagingand will link it here shortly.@SpicyMarinara commented on GitHub (Aug 8, 2026):
Implementation is now tracked in draft PR #4761: https://github.com/Pasta-Devs/Marinara-Engine/pull/4761