Repository navigation
Description
Written-by: HugoXK
Expected behaviour
A model selected for a repository is the model the job runs on, so it must count as an own model everywhere: the first-run checklist, the dashboard's quota next action, and the job enqueue quota check. A user with such a model can start a job after the platform quota is exhausted, and the model step is not marked done just because a provider row exists.
When the platform quota is the fallback, the model step must also tell the truth about that quota:
- Show the current remaining platform balance.
- Below
PLATFORM_QUOTA_COMFORT_CNY(50 CNY), warn that the balance may not cover the first run and recommend configuring an own model now — or selecting one for the repository when a provider already exists. - At 50 CNY or more (or when the account is unlimited), show only the remaining balance and keep Settings → Model as the place to configure a model later, with no warning.
- The threshold changes the advice only; it never changes quota accounting or the gateway.
Actual behaviour
src/app.tsmarks the model step done when any provider has any model, even if no repository selected one.src/gateway/gateway.tsonly uses a repository model when it is inrepo_model_selection; otherwise the call is platform-funded.src/jobs/service.tsdecidesplatformFundedfrom the legacyusers.own_llm_*fields only, so a repository-selected model still getsQUOTA_EXHAUSTEDwhen the platform quota is empty.src/views/pages.tsshows the quota "Add your own model" action unconditionally when the quota is exhausted, even when a usable own model exists.- The platform-satisfied model step says only "Using platform quota (default)" and never says how much is left or whether that is enough for a first run.
Reproduction
- Create a user with
quota_cny = 0(or spend the default quota). - Add a provider and a model in Settings, then select that model for a repository.
- Start a job.
Expected: the job is dispatched through the repository model. Actual: enqueue returns QUOTA_EXHAUSTED before the gateway is called. The dashboard also offers "Add your own model" and may mark the model step done before the repository selection exists. A new account with the default 1 CNY quota is treated as if the platform balance were a comfortable default instead of a warning.
Scope
src/app.ts: derivemodelConfiguredfrom a usable own model (legacy own model or a repository selection), keepproviderConfiguredseparate, and pass the remaining platform quota into the checklist.src/views/checklist.ts: a provider without a repository selection is not a completed model step; link it to the repository picker. A selected model satisfies the step. When the platform quota is the fallback, show the balance and the low/high advice described above.src/views/pages.tsandpublic/app.css: show the quota warning in the checklist row and suppress the exhausted-quota next action when a usable own model exists.src/jobs/service.ts: treat a repository selection as non-platform-funded in both enqueue and dispatch.- Tests in
test/setupChecklist.test.ts,test/nextAction.test.ts,test/jobs.test.ts; docs indocs/architecture.mdanddocs/quota.md; one changelog fragment.
Out of scope: changing the gateway fallback, quota accounting, or auto-binding a provider to every repository.
Verification
- A repository with a selected model and an exhausted quota enqueues.
- A repository without a selection and an exhausted quota is still refused as today.
- The first-run model step is not done when only a provider exists, and links to the repository picker.
- The quota next action is absent when a usable own model exists.
- A 1 CNY platform balance shows a warning and an "add your own model now" action; a 50 CNY balance (or unlimited) shows only the balance and the later Settings → Model path.
npm run checkpasses.
Activity
HugoXK commentedon Nov 15, 2026
Written-by: HugoXK
Claimed on branch
fix/732-repo-model-readiness; PR #733 is open. The fix makes a repository-selected model the own-model signal in the checklist, the quota next action and the enqueue/dispatch quota checks.HugoXK-bot commentedon Nov 15, 2026
Issue-review: PASS at issue #732 body ff778233d7e7
Written-by: HugoXK-bot
Hashes re-read this turn: raw
ff778233d7e7, trimmed11772aef40ba.issue-gate: no-pass #732, exit 2 before this verdict.The card pinpoints the four places where a repository selection was not treated as an own model (checklist, dashboard quota action, enqueue, dispatch) and fixes the scope to those, with the gateway fallback and quota accounting explicitly out of scope. The PR #733 (
e48822384ea4, my PASS5908787902) implements that scope:platformFundedFor()shared by enqueue and dispatch,providerConfiguredseparated frommodelConfiguredin the checklist, and the quota card suppressed only when an own model exists; its tests cover provider-without-selection, selection, and the exhausted-quota enqueue path.Ran:
node scripts/issue-hash.mjs --repo HugoXK/fledge --issue 732— raw ff778233d7e7 / trimmed 11772aef40banode scripts/issue-gate.mjs --repo HugoXK/fledge --issue 732— no-pass, exit 2npx tsx --test test/jobs.test.ts test/nextAction.test.ts test/nextScheduledRun.test.ts test/setupChecklist.test.tsate48822384ea4— pass 135/135Conclusion: PASS — the reproduction, expected behaviour and scope name one defect and the tests the card asks for exist in the fix.
fix: treat a repository model as an own model for quota (#732)
fix: treat a repository model as an own model for quota (#732)
fix: treat a repository model as an own model for quota (#732)
HugoXK commentedon Nov 15, 2026
Written-by: HugoXK
Correction: the fix stays in PR #733, which is open again. PR #678 is being reused for a different approved issue, not #732.
fix: treat a repository model as an own model for quota (#732) (#733)