Skip to content

Dream: probe reserved capacity through the LLM gateway; add kill switch - #23180

Merged
Git-on-my-level merged 2 commits into
mainfrom
lane/dream-probe-403
Oct 22, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
lane/dream-probe-403

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

At 25% of paid owners on 2026-10-22, the 02:00Z Dream sweep logged candidates=520 complete=2 failed=0 waiting=517, with 550 probe_failed capacity waits.

Cause (Codex Sol, confirmed from read-only prod audit logs).

  • Dream's 3.8 reservation probe called Vertex generateContent directly as backend-sync's backend-runtime identity. IAM denies that identity aiplatform.endpoints.predict, so the probe got a 403.
  • Real Dream turns succeed because they go through the LLM gateway's prod-omi-llm-gateway identity.
  • Each failed probe set 600 s local and shared Redis vetoes on admission.
  • While real traffic kept reservation evidence fresh (900 s), the probe was rarely needed. Once the 5% backlog drained, evidence went stale and the vetoes starved admission fleet-wide, which kept the evidence stale.

Fix.

  • Probe path: the 3.8 probe goes through the gateway's ownerless reserved omi:auto:dream-verify route: 16 tokens, dream_reserved_only, no user attribution. That is the same identity and dedicated policy as real turns.
  • Evidence: the gateway publishes strict PT evidence itself. A gateway 200 never manufactures evidence.
  • Vetoes: the failed-probe vetoes are removed. Auth and transport failures are inconclusive, while 429 and capacity failure classes still mark saturation with the 10 s cooldown.
  • Still enforced: fresh shared evidence, a readable shared store, shared slots and utilization guards.
  • 2.5: legacy direct probing is unchanged.
  • Kill switch: DREAM_GATEWAY_PROBE_ENABLED, default on. 0/false/off/no makes no probe call, so admission relies only on fresh evidence from real Dream turns. It's registered as ops_kill in config/feature-flags.yaml.

No IAM change is needed.

Review

GLM-5.3 (zcode) returned SHIP-WITH-NITS. It traced the probe end to end:

  • reserved-only is enforced at the route pin, executor re-validation and the dedicated-only attempt plan;
  • spillover becomes a 429;
  • only the gateway's strict PT reducer can publish evidence;
  • admission stays fail-closed (store, stale evidence, slots);
  • probes stay lease-gated at 600 s fleet-wide;
  • the kill switch makes zero calls;
  • 2.5 is unchanged.

Findings and what happened to them:

  • Medium (deploy prerequisite): the probe needs OMI_LLM_GATEWAY_URL on backend-sync. Verified: prod backend-sync has it set to a non-loopback gateway address, which real Dream turns already use.
  • Low, follow-ups:
    • a misconfigured Dream route surfaces as a 10 s saturation;
    • reason=probe_failed now only covers store and slot errors, so dashboards keyed on it measure a narrower event.
  • Nits:
    • the kill-switch test doesn't cover the 'no' value;
    • the feature header is set redundantly.

Verification

  • Codex Sol: 354 passed, 2 skipped across nine targeted files. All seven new regressions fail on origin/main.
  • Kill switch: backend/test.sh on the probe, capacity, fail-open, retry and canary files gave 84 passed, including the 3 kill-switch cases.
  • scripts/check_feature_flag_registry.py: OK.

These are unit results only. Prod verification is that probe_failed waits disappear and the next sweeps show completions, with 3.8 still dedicated-only.

Product invariants affected

none

Failure class

Failure-Class: none

🤖 Generated with Claude Code

Git-on-my-level and others added 2 commits October 22, 2026 09:46
Use the ownerless reserved Dream verifier route for 3.8 discovery so the probe uses the same Vertex identity and dedicated policy as real turns. Let the gateway publish strict completed PT evidence; never infer it from a gateway HTTP 200.

Remove local and shared failed-probe vetoes while retaining fresh evidence, shared-store and slot requirements, utilization guards, and the 10-second capacity cooldown. Keep legacy 2.5 probing direct. Cover gateway recovery, denials, incomplete proof, and reserved-only routing.

Co-Authored-By: Codex Sol <[email protected]>
…way probe

Default on; 0/false/off/no makes no probe call, so admission relies on fresh
evidence from real Dream turns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T03:02:52.100602Z 6f3d29b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f3d29b9e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +123 to +126
elif outcome == 'inconclusive':
# Auth/transport failures are not saturation. Admission still requires
# fresh shared evidence, readable headroom and shared concurrency slots.
logger.info('dream_capacity_probe outcome=inconclusive model=%s', model)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Record the gateway-probe fail-open outcome

When the gateway returns a non-capacity error or the request raises, this inconclusive branch now permits admission to continue from previously fresh evidence, but it emits only an info log. That is a new fail-open path, so outages or authentication failures will be absent from the shared fallback telemetry used by operations; call record_fallback with bounded fields when this path is taken.

AGENTS.md reference: backend/AGENTS.md:L313-L314

Useful? React with 👍 / 👎.

Comment thread config/feature-flags.yaml
- {"key":"DREAM_AGENT_PAID_PERCENT","aliases":[],"kind":"env","lifecycle":"rollout","surfaces":["backend"],"summary":"Stable per-owner percent of paid owners eligible under ELIGIBILITY=paid; unset admits all paid owners, malformed admits none; listed owners always stay in","fail":"closed","owner":"dazheng","created":"2026-10-21","review_by":"2026-11-04","terminal":"off","decision":"kill","notes":"David 2026-10-21: Dream ramps to paid owners on the 3.8 reservation; reservation headroom is the global cap. Delete the knob once prod runs unset (100%). 2026-10-21 13:01Z: the first 5% sweep failed ~17 cohort passes in seconds (error_type=other, applied=0); rolled back to 0 pending diagnosis. Cause: Firestore Aborted contention on the turn ledger, admission and discovery transactions; fixed by bounded retries (#23051). Re-ramp at 5% with DREAM_AGENT_CONCURRENCY=8. 2026-10-22: 5% held clean after the in-pass 429 retry (#23085): 00:00Z sweep complete=6 failed=0, dedicated-only 3.8; step to 25% at concurrency 8.","ramp":{"cohorts":["listed owner + 5% of paid owners, 1 h hold","25%, 3 h hold","unset (all paid owners), 6 h soak"],"clean_metric":"<2 failed Dream passes/h, no new Dream ERROR signatures on backend-sync, no probe_failed storm, undo rate under 0.2, zero 3.8 on-demand Dream spend","expander":"dazheng (Dream lane, deploys via the rollout lead)","done_by":"2026-10-22"}}
- {"key":"DREAM_AGENT_UID_ALLOWLIST","aliases":[],"kind":"env","lifecycle":"config_switch","surfaces":["backend"],"summary":"Comma-separated owner uids admitted when eligibility is allowlist; empty admits nobody","fail":"closed","owner":"dazheng","created":"2026-10-15","terminal":"keep","decision":"keep"}
- {"key":"DREAM_ON_DEMAND_ENABLED","aliases":[],"kind":"env","lifecycle":"config_switch","surfaces":["backend"],"summary":"Gateway and backend gate for allowlisted Dream on-demand capacity; default false; prod backend false since the 3.8 reservation went live 2026-10-21","fail":"closed","owner":"dazheng","created":"2026-10-15","terminal":"keep","decision":"keep"}
- {"key":"DREAM_GATEWAY_PROBE_ENABLED","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default-on 3.8 reservation probe through the LLM gateway's reserved Dream route; 0/false/off/no makes no probe call and admission relies on fresh evidence from real Dream turns","fail":"open","owner":"dazheng","created":"2026-10-22","terminal":"keep","decision":"keep"}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Wire the kill switch into deployed Dream hosts

A repo-wide search finds no DREAM_GATEWAY_PROBE_ENABLED declaration in backend/deploy/runtime_env, the backend-listen/pusher charts, or deployment workflows; the generated registry consequently shows dashes for every deployment column. Current Dream workloads therefore always use the default true, and operators cannot disable the probe through the repository-owned fleet configuration during an incident. Add a classified runtime-env/chart binding for every host that can run Dream.

AGENTS.md reference: backend/AGENTS.md:L133-L134

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit e4a8fd0 into main Oct 22, 2026
66 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/dream-probe-403 branch October 22, 2026 03:08
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