Repository navigation
Report the account's job limit from its entitlement - #55
Merged
Merged
Conversation
GET /triggers keeps max_triggers as the legacy free ceiling and reports
the account's limit in trigger_limit: limited with max, unlimited, or
unavailable. job list and service triage showed max_triggers, so a paid
account read "Jobs: N of 5 allowed", and job_limit copied a key the
service never sends. job_limit now mirrors trigger_limit ({kind, max?});
max_jobs and triage jobs.max are the account's max when limited and null
otherwise; triage gains jobs.limit; the human line says "of M allowed",
"(unlimited)" or "(limit unavailable; try again)". An unknown kind reads
as unavailable, and an older service without trigger_limit reads as
limited at max_triggers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Bug
A paid account with unlimited jobs sees
prose cli job listprintJobs: 0 of 5 allowed, andprose cli service triage --jsonreportjobs.max: 5.GET /triggersreturns two fields:max_triggers: always the free ceiling (5), kept for older clients.trigger_limit: the account's actual entitlement. It is one of:{"kind":"limited","max":N}{"kind":"unlimited"}{"kind":"unavailable"}, meaning the service could not check the entitlement; it's temporary.The CLI showed
max_triggers. Itsjob_limitprojection also copied alimitkey the service never sends, so even a limited account's ownmaxwas lost.Fix
Projection. One projection, shared by
job listandservice triage, derives the limit:job_limitmirrorstrigger_limitas{kind, max?}.kindreads asunavailable, never guessed.limitedwithout a valid integermax≥ 0 isSERVICE_PROTOCOL_INVALID, namingjob_limit.max.trigger_limitreads as limited at an integermax_triggers≥ 0; otherwise it isunavailable. Whentrigger_limitis present,max_triggersis ignored.Output.
max_jobs(job list) andjobs.max(triage) are the account'smaxwhen limited, andnullotherwise.jobs.limit.Jobs: N of M allowed,Jobs: N (unlimited)orJobs: N (limit unavailable; try again).Compatibility.
job_limit.limitis replaced byjob_limit.max, andjob_limit.kindis now an enum.max_jobs/jobs.maxbecomenullfor unlimited accounts. These changes are in the changelog.job createhas no client-side limit wording; a service refusal passes through as before.Files.
service/{jobs,triage}.rsand Bunservice/{jobs,triage}.ts, implemented independently, with unit tests in both.jobs.schema.jsongains$defs.jobLimit,discovery.schema.jsongains triagejobs.limit, and the response schema gainstrigger_limit.max.max; triage limited JSON and human). The 10 existing cases whose fixtures sayunlimitedare refreshed, changing only the limit line. One fixture that used the never-sentlimitkey now usesmax.docs/service/{jobs,discovery}.mdandCHANGELOG.md.Evidence
Local, on macOS with Python 3.10.21 and Rust from
rust-toolchain.toml. These gates pass:shared-contracts,service-help,public-surface-filesandservice-operations-corpusdifferential-conformanceandservice-coverageservice-operations-rust-buildandservice-operations-rust: 1097 cases, 0 failuresservice-operations-bun-buildandservice-operations-bun: 1097 cases, 0 failuresOn the first pass,
rust-format,rust-clippy,bun-typecheck, the Rust service tests and the Bun job/discovery tests also passed.Every new or refreshed case was accepted only where Rust and Bun produced identical bytes. An independent review agent read the diff before this was opened; its required doc fix and nits are applied.
🤖 Generated with Claude Code