Repository navigation
org: a chat at its spending limit reads the organization's sentence, not a payment failure - #2936
Merged
Merged
Conversation
A refusal from the organization's model door is shaped like a provider's, so a client could not tell the organization's own sentence from a service's failing account. The error envelope now has a `door` field, and a refusal carrying `door: organization` is flagged on the APIError, with OrgLimitWords giving the organization's sentence for the limit refusals (402, payment-shaped) and false for every other refusal. Terminal handling of the refusal is untouched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…number it is Every error the organization's model door writes now carries the `door` mark, so a client can show its sentence as written. A provider's refusal passed through the door is not signed and keeps its own wording. The limit sentences wrote every cap with two decimals, so a limit of a tenth of a cent read "$0.00"; a whole number of cents keeps two places ($5.00, $0.50), anything finer is spelled by the one door that spells a cap (teams.Money: $0.001). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s sentence The engine's ending and the page's failure line put "<service> accepted the key but the account cannot pay" in front of a door's limit sentence, blaming the vendor and the person's account for a limit the organization set. A refusal the organization's door signed is now shown as the door wrote it, with no service name, and it no longer asks for a read of the person's own OpenRouter credits. A provider's own payment refusal reads exactly as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nization's sentence Co-Authored-By: Claude Opus 5.5 <[email protected]>
AbirAbbas
added a commit
that referenced
this pull request
Nov 25, 2026
…ack (#2903) The hosted organisation line: a team-mode org server deciding every request through one access model (verbs, roles, grants and policy in SQLite), hosted chats run by the sessionhost under a per-chat uid inside a Landlock fence with minted model bearers, sealed keys and a git helper, shared chats acting through verbs, bots owned by their creator, the Hosting and chats policy settings, and a self-hosting stack (deploy/org Docker Compose, published images behind a leak gate, a Railway path). Consolidates #2894 #2895 #2896 #2898 #2899 #2900 and the follow-ups #2904 #2905 #2907 #2908 #2910 #2911 #2912 #2913 #2915 #2916 #2918 #2927 #2936 #2944. Proven by the full suite, a keyless Compose smoke, a hostile wire client, sandbox escape probes, a real-model run and a production-style install from the published images. Co-Authored-By: Santosh kumar <[email protected]> Co-Authored-By: ZeroPoint95 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 was wrong
A hosted chat whose organization limit was reached read:
OutcomeAccountCannotPayand put the service name and "accepted the key but the account cannot pay" in front of the organization's own sentence.$0.00.The change
"door":"organization"in the error envelope (provider.DoorKey/provider.OrganizationDoor, one spelling shared by server and client). The client reads that field, never the sentence. A provider's refusal passed through the door is not signed.APIError.OrgLimitWords()returns the door's sentence for its payment-shaped refusals only. The engine's ending (internal/session/loop.go) and the page's failure line (internal/tui3/feed.go) show it as written. The org limit no longer triggers a read of the person's own OpenRouter credits.$5.00,$0.50), anything finer is spelled byteams.Money($0.001). Zero stays$0.00.AccountCannotPay,OurRequest,RoutePaymentunchanged). The monthly limit refusal had the same defect and is fixed the same way.organization-hosted-sessions.mdgets a section (and a search probe) saying the limit lines are the organization's own words, not an OpenRouter credit problem.Validation contract and tests
TestAHostedChatAtItsSpendingLimitReadsTheOrganizationsSentenceAndNothingElse,TestAHostedChatAtTheMonthlyLimitReadsTheOrganizationsSentenceAndNothingElse(serve). The page's line from the same real turn:TestAChatAtTheOrganizationsLimitDrawsOnlyTheOrganizationsSentence(tui3). Both fail on the base with the exact line from the report.TestAProvidersOwnPaymentRefusalThroughTheDoorStillReadsAsAnAccountThatCannotPay(through the door),TestAProvidersOwnPaymentRefusalStillNamesTheServiceAndTheAccount(tui3),TestOnlyTheOrganizationsDoorIsReadAsTheOrganizationSpeaking(provider: a provider'sinsufficient_quotais not the mark). The existing payment-note and plan-door tests pass unchanged.$0.001,$0.50,$2.00, zero stays$0.00:TestALimitIsWrittenAsTheNumberItIs,TestEveryErrorTheDoorWritesIsSignedAndOnlyThoseItWrites(serve; real handler at cap 0.5 reads$0.50).TestTheDoorsLimitIsStillTerminalForEveryReaderOfARefusal,TestTheOrganizationsLimitDoesNotSendAReadOfThePersonsOwnCredits, and the field-name pinTestTheDoorsFieldIsTheOneTheClientDecodes.Gates
make pr-ready BASE=origin/org/mainpassed on the final commit (build, vet, Windows vet, packed manual, change entries, manual gates, laws, touched packages: serve, provider, session, tui3, manual, cmd).Note
Over the engine wire the typed refusal becomes plain text, so a remote TUI draws the same sentence under its ordinary
error:label for untyped endings; the service name and the payment wording are gone there too.🤖 Generated with Claude Code