Repository navigation
feat: add credential balance /status to TUI and ACP - #15
Merged
Merged
Conversation
Expose /status with the selected provider, model, currency and fresh balance information for DeepSeek and OpenRouter. Resolve the active credential and separate account funds from key spending limits, with explicit unsupported, failure and timeout states. Advertise the command on ACP session creation and resume, and preserve the TUI's immediate model selection when querying status. Cover credential rotation, currencies, failure handling, command discovery and no-inference execution; verify the guarded runtime patch ships in the npm bundle. Validation: 1,112 unit tests, targeted 100% line coverage, ACP protocol probe, both typecheck gates, documentation check, lint, package build and checks.
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 changed
Add
/statusto the TUI and ACP so users can inspect the selected provider, model and current credential's balance without an inference request. ACP advertises the command name and description when creating or resuming a session, before the user sends a prompt.Why
Configured credentials and an advertised model do not tell users whether they have funds remaining. ACP users also need command discovery as soon as a session is opened, rather than having to know and type
/statusthemselves.Checks run
node scripts/check-docs.mjsnpm run lintnpm run typecheckandnpm run typecheck:strictnpm run test:unit— 1,112 passing testsplugins/status/*andscripts/patch-acp-status.mjs— 100% lines/functions, 96.60% branchesnode scripts/verify-acp.mjs— command discovery on new/resumed sessions, execution without inference, model switching, and existing prompt/approval/cancellation/error lifecyclenpm run build:packagesandnode scripts/verify-packages.mjsThe narrower checks above were run; the full
npm run checkgate was not run locally. Balance responses use fixtures, not live billing credentials. Actual PAX rendering was not manually tested.Notes
Balance lookup currently supports official DeepSeek API/account routes and OpenRouter. Custom endpoints and other subscription providers report unsupported. The ACP integration is a guarded, idempotent patch against pinned DSH
0.2.0-rc.2; other terminal slash commands remain outside this change. No version bump or npm publication.