Skip to content

feat(generate): --allow-not-ready submits past a ready:false estimate - #1006

Merged
ZacxDev merged 2 commits into
mainfrom
generate-allow-not-ready
Dec 4, 2026
Merged

ZacxDev merged 2 commits into
mainfrom
generate-allow-not-ready

Conversation

@ZacxDev

@ZacxDev ZacxDev commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Problem

civitai generate --ecosystem OpenAI --image <photo> (a gpt-image-2.5 edit) can never be submitted: its estimate always comes back ready: false and the CLI refuses. The same job runs from civitai.com's generator.

Root cause

The request is not the difference. The site's generator gets ready: false for this job too, and it does not gate on it: src/components/generation_v2/ResourceAlerts.tsx shows a "Potentially slow generation" notice for ready: false with no download preparation and leaves Generate enabled. The refusal is this CLI's own (runGenerate, the !quote.Ready check; AGENTS.md item 28(a): nothing on the server's submit path reads ready).

Measured 2026-12-04 against civitai.com, dry runs only:

graph ready total
OpenAI 3311436, 4:5, high, 1 image false 52
same, version 3311434 / 2880272 false 52
same, quality medium false 14
same, aspect 1:1 false 69
same, no images true 52
same, site's shape (workflow: img2img:edit, acceptBoostRequired: true), throwaway build false 52

preparation was null in every case, so this is the capacity signal (queuePosition.support), not a pending download.

Change

  • New opt-in --allow-not-ready: submit even when the estimate reports ready: false. The refusal stays the default.
  • With the flag, the submit path and the --dry-run quote print one warning that promises no output: the job may start late or never produce anything, and like any submit it is charged when the server accepts it. Without the flag nothing changes, except that the refusal message now names the flag.
  • Help text (and its golden) and the README say the same.

Tests

internal/cmd/generate_allow_not_ready_test.go:

  • TestGenerate_AllowNotReadySubmits: a ready:false estimate with the flag submits once and warns.
  • TestGenerate_AllowNotReadySilentWhenReady: no warning on a ready:true estimate.
  • TestDryRun_AllowNotReadyStatesItWouldSubmit: the dry run still reports Resources ready: false, prints the proceed warning, and does not claim a refusal.
  • TestGenerate_AllowNotReadyFlagRegisteredOffByDefault.

TestGenerate_NotReadyRefuses (the default) is unchanged and green.

Mutants, each killed by the named test's own assertion: gate reverted to !quote.Ready (AllowNotReadySubmits); dry-run branch disabled (AllowNotReadyStatesItWouldSubmit); submit-path warning dropped (AllowNotReadySubmits). Against main the new file does not compile (no flag, no field).

Local: go test ./internal/cmd ok, golangci-lint 2.12.2 on ./internal/cmd 0 issues. go test . has 3 TestOracle* failures that also fail on main here (no Chromium on PATH).

Live, with a binary built from this branch, dry run only (nothing submitted): --dry-run --allow-not-ready prints Resources ready: false, total 52, and the new warning.

🤖 Generated with Claude Code

Every gpt-image-2.5 edit estimate (--ecosystem OpenAI with --image) reports
ready: false, so the CLI refused the whole job class, while civitai.com's own
generator runs the same job. The site does not gate on the flag:
ResourceAlerts.tsx shows a "Potentially slow generation" notice for ready:false
with no download preparation and leaves Generate enabled. The refusal is this
CLI's own (item 28(a)); nothing on the server's submit path reads `ready`.

Measured 2026-12-04 against civitai.com, dry runs only: versions 3311436,
3311434 and 2880272, quality high and medium, aspect 4:5 and 1:1, all
ready:false with preparation null; the same graph without images is
ready:true. Sending the site's own shape (workflow img2img:edit,
acceptBoostRequired) from a throwaway build also returned ready:false, so the
request shape is not the difference.

--allow-not-ready is opt-in; the refusal stays the default. With the flag the
submit path and the --dry-run quote print one warning that promises no output.
Help text, its golden, and the README say so.

Tests: generate_allow_not_ready_test.go. Mutants killed: gate reverted to
`!quote.Ready` (AllowNotReadySubmits), dry-run branch disabled
(AllowNotReadyStatesItWouldSubmit), submit-path warning dropped
(AllowNotReadySubmits). go test ./internal/cmd ok; golangci-lint 2.12.2 on
./internal/cmd 0 issues.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ZacxDev

ZacxDev commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Audit round 1 (first, full) at 42555e2 — 0 🔴, ladder ends

Scope read: full diff; the civitai/civitai origin/main generator (ResourceAlerts.tsx DownloadReadyAlert, WhatIfProvider.tsx, orchestration-new.service.ts whatIfFromGraph / generateFromGraph) and the orchestrator client's JobSupport enum.

Narrowing question. No change recommended. The site's client reads ready in one place only, DownloadReadyAlert, and only to choose which notice to show. Generate stays enabled both when the job is waiting on a download (preparation set) and in the "Potentially slow generation" case (no preparation). Allowing only the no-preparation case would be STRICTER than the site, not equal to it. It would also miss the real never-runs risk: ready:false merges JobSupport unsupported and unavailable, and whatIfFromGraph returns only the boolean, so neither the site nor this CLI can tell those two apart. On the submit side, the only server gate is boostRequired without downloadPriority: 'high', which returns a 400 before any charge. Per item 28's #307 account, the orchestrator re-prices undelivered jobs after the fact. The new copy promises nothing in either direction, which is correct.

🟡 scaffolding — new spend copy is not golden-pinned. internal/cmd/generate.go:2056 (allowNotReadyWarning) and the --allow-not-ready usage at :721 both say what happens to the charge (item 28 copy). The tests compare against the constant itself, so they cannot catch a reword. Measured: I edited both strings to say "your Buzz is refunded automatically" / "Nothing is charged unless it runs". 266 tests matching Golden|Generate|DryRun|Spend|Retract|Refund|Ledger|Charge|Copy stayed green. Positive control: the same edit in the Long text failed TestGoldenSpendCopy/generate_help_long. Fix: add both strings to TestGoldenSpendCopy, the same way --max-cost and --timeout usage are pinned (generate_golden_copy_test.go:127-140).

🟢 payload — the warning cannot tell a download wait from a capacity wait. genapi.WhatIfResult (internal/genapi/generate.go:71) drops the preparation / boostRequired / warnings fields that whatIfFromGraph returns. With the flag set, the user gets one warning for both cases. The site shows a download ETA and size for the first case. Optional: decode preparation and print its ETA.

🟢 payload — the help text contradicts itself. generate.go:401 still says Treat ready: false as "do not submit". The next sentence introduces a flag to submit it anyway.

Verified: Mutants run by hand, each killed by the test the PR names: gate reverted, dry-run branch disabled, submit warning dropped, warning made unconditional (SilentWhenReady), flag default true (FlagRegisteredOffByDefault). go test ./internal/cmd -run '…AllowNotReady…|NotReadyRefuses|Golden…' is green at the head. The new symbols are absent on main, so the new tests are red there. All CI check-runs on 42555e2 pass (9/9). Nothing in the diff or PR text exposes internal infrastructure.

Verdict: safe to merge. The 🟡 is a test gap; it does not block.

1. audit only, no fixes this round: 0 blockers; open 🟡 allowNotReadyWarning + --allow-not-ready usage not golden-pinned in TestGoldenSpendCopy
2. open 🟢: preparation not surfaced in the not-ready warning; Long still says treat ready:false as do-not-submit

…y:false help

Add the --allow-not-ready flag usage and allowNotReadyWarning to
TestGoldenSpendCopy, next to --max-cost and --timeout, so a reworded or
appended sentence about the charge fails the test.

The generate help no longer says to treat ready: false as "do not submit":
the default refuses, and --allow-not-ready submits anyway, as the site's
generator does, charged when the server accepts it.

Mutation check: rewording the warning, trimming the flag usage, and
re-adding the do-not-submit wording to the help each fail their own
subtest (generate_allow_not_ready_warning, generate_flag_usage_allow_not_ready,
generate_help_long).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ZacxDev
ZacxDev merged commit 63dc7b8 into main Dec 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant