Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
d10a333
test(noema): require free-first auto fallback route
seonghobae Aug 29, 2026
0c4f099
ci(noema): run gateway contracts on changed paths
seonghobae Aug 29, 2026
9effbb4
test(strix): cover auto orchestrator loopback route
seonghobae Aug 29, 2026
687087b
fix(strix): preserve auto orchestrator gateway route
seonghobae Aug 29, 2026
4741d8e
fix(noema): use free-first auto provider fallback
seonghobae Aug 29, 2026
40bf16d
fix(noema): batch sidecar route preflight
seonghobae Aug 29, 2026
8ab8a28
Merge branch 'fix/noema-auto-provider-fallback' of https://github.com…
seonghobae Aug 29, 2026
8c2e0ba
Revert "fix(noema): use free-first auto provider fallback"
seonghobae Aug 29, 2026
6bcf304
Revert "ci(noema): run gateway contracts on changed paths"
seonghobae Aug 29, 2026
52c43dc
Revert "test(noema): require free-first auto fallback route"
seonghobae Aug 29, 2026
6fd376f
fix(noema): expose full bounded free catalog
seonghobae Aug 29, 2026
205b485
fix(opencode): keep bootstrap event-independent
seonghobae Aug 29, 2026
e39028c
test(opencode): align event-independent bootstrap contract
seonghobae Aug 29, 2026
14ec0e2
docs(noema): align shared preflight budget
seonghobae Aug 29, 2026
c44e8cd
chore(noema): drop overlapping OpenCode workflow drift
seonghobae Aug 29, 2026
03b7dd8
chore(noema): drop overlapping OpenCode contract drift
seonghobae Aug 29, 2026
17f695d
test(strix): align bootstrap path policy
seonghobae Aug 29, 2026
765732d
test(strix): stop bootstrap scan at job boundary
seonghobae Aug 29, 2026
9f6f628
Merge PR #1413 trust-boundary fixes into #1415
seonghobae Aug 29, 2026
966c39b
fix(noema): fail closed on partial discovery
seonghobae Aug 29, 2026
85f45b8
fix(noema): do not truncate single-provider route catalog
seonghobae Aug 29, 2026
6ac9e01
test(noema): prove single-provider catalog breadth
seonghobae Aug 29, 2026
f0c768f
fix(review): classify unavailable gateway evidence
seonghobae Aug 29, 2026
a281686
fix(review): separate startup and serving timeouts
seonghobae Aug 30, 2026
fcc376f
test(review): pin sidecar preflight contract
seonghobae Aug 30, 2026
5032c3a
fix(sidecar): smoke virtual pools in route mode
seonghobae Aug 30, 2026
a832eb0
fix(noema): route sidecar reviews directly
seonghobae Aug 30, 2026
1b71335
Merge origin/main into fix/noema-batched-preflight-413-evidence
claude Aug 31, 2026
2937e52
Merge branch 'main' into fix/noema-batched-preflight-413-evidence
opencode-agent[bot] Aug 31, 2026
55867cd
fix(ci): restore missing pull_request_target guard on Pingora policy …
claude Aug 31, 2026
b0917a6
fix(ci): coordinate sidecar startup watchdog with launcher's real wor…
claude Aug 31, 2026
3770d77
fix(ci): reconcile contradictory Pingora guard contracts by removing …
claude Aug 31, 2026
d9900c1
fix(sidecar): require serving-budget confirmation before route admission
claude Aug 31, 2026
b64f1e5
fix(sidecar): separate confirmation budget from rescue escalation budget
claude Aug 31, 2026
608755f
fix(sidecar): count wall-clock seconds, not polls, in the startup wat…
claude Aug 31, 2026
19f006f
Merge main into fix/noema-batched-preflight-413-evidence; fix catalog…
claude Aug 31, 2026
9aec73a
fix: sidecar account-cap default bypass and discovery watchdog underc…
claude Aug 31, 2026
02e4cc7
Merge remote-tracking branch 'origin/main' into fix/noema-batched-pre…
claude Aug 31, 2026
1535a40
Merge remote-tracking branch 'origin/main' into fix/noema-batched-pre…
claude Aug 31, 2026
9231906
fix(test): sidecar direct-route test must not trip substantive-verdic…
claude Aug 31, 2026
7e07a4e
fix(noema): eliminate serving-orchestrator retry/judge doubling, fix …
claude Aug 31, 2026
d98a310
fix(noema): restore serving quality gate/failover, re-derive timeout …
claude Aug 31, 2026
dc7b38c
fix(noema): cap serving candidates so worst case fits the job deadline
claude Aug 31, 2026
098df10
docs(noema): explain why REVIEW_SERVING_MAX_CANDIDATES exceeds today'…
claude Aug 31, 2026
0509639
docs(gap-baseline): record opencode-review structural deadlock finding
claude Aug 31, 2026
0160515
docs(gap-baseline): fix malformed cross-repo issue reference format
claude Aug 31, 2026
961f379
docs(gap-baseline): record required-check dispatch starvation pattern
claude Aug 31, 2026
9c150a2
docs(gap-baseline): correct conflated failure-mode claim per Devin re…
claude Aug 31, 2026
bf729bd
docs(nvidia-nim): mark the OpenCode NIM-priority hotfix note rolled back
claude Aug 31, 2026
41ce1e9
docs(nvidia-nim): correct two accuracy findings on the hotfix-rollbac…
claude Aug 31, 2026
2e31dce
fix(review): remove serving 120-second timeout
seonghobae Aug 31, 2026
ad62439
Revert "fix(review): remove serving 120-second timeout"
seonghobae Aug 31, 2026
c7904c8
Reapply "fix(review): remove serving 120-second timeout"
seonghobae Aug 31, 2026
ebeca2b
fix(noema): preserve long reviews across peer checks
seonghobae Aug 31, 2026
0a38150
fix(noema): isolate long candidate attempts
seonghobae Aug 31, 2026
7e6ccb8
chore(noema): pin corrected candidate routing
seonghobae Aug 31, 2026
c9bc298
fix(noema): preserve bounded cross-job failover
seonghobae Aug 31, 2026
f76a261
fix(noema): bind GitHub App identity source
seonghobae Aug 31, 2026
84a3e03
chore(noema): pin candidate-control fixes
seonghobae Aug 31, 2026
76b2e07
fix(noema): remove 120-second preflight cutoff
seonghobae Sep 1, 2026
e344352
fix(noema): bound long preflight attempts
seonghobae Sep 1, 2026
cb97e44
test(strix): align six-hour job budget contract
seonghobae Sep 1, 2026
36bcda2
Merge remote-tracking branch 'origin/main' into codex/pr1415-provider400
seonghobae Sep 1, 2026
a40a9ca
test(opencode): refresh trusted dispatch blob pin
seonghobae Sep 1, 2026
8e7a476
test(opencode): accept live-head dispatch rebinding
seonghobae Sep 1, 2026
0af37d9
Merge remote-tracking branch 'origin/main' into codex/pr1415-provider400
seonghobae Sep 1, 2026
aa687a9
test(opencode): follow protected exact-head revert
seonghobae Sep 1, 2026
37e845d
fix(noema): share correction response deadline
seonghobae Sep 1, 2026
3b44c67
fix(noema): subtract response setup time
seonghobae Sep 1, 2026
c57fcbd
test(noema): accept consumed setup budget
seonghobae Sep 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 259 additions & 27 deletions .github/workflows/noema-review.yml

Large diffs are not rendered by default.

18 changes: 16 additions & 2 deletions .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,22 @@ jobs:

echo "DEPENDENCY_REVIEW_SUPPORT repository=${REPOSITORY} visibility=${repository_visibility} base_sha=${BASE_SHA} head_sha=${HEAD_SHA} http_status=${http_status} curl_exit=${curl_status}"

if [ "$curl_status" -ne 0 ] || [ "$http_status" != "200" ]; then
echo "::error::Dependency review evidence unavailable for ${REPOSITORY} at exact base ${BASE_SHA} and head ${HEAD_SHA}: HTTP ${http_status}; curl exit ${curl_status}. Verify dependency-graph/security configuration and GitHub service behavior, then rerun. Failing closed."
evidence_state="complete"
unavailable_reason="none"
if [ "$curl_status" -ne 0 ]; then
evidence_state="unavailable"
unavailable_reason="transport"
elif [ "$http_status" = "403" ]; then
evidence_state="unavailable"
unavailable_reason="api_authorization"
elif [ "$http_status" != "200" ]; then
evidence_state="unavailable"
unavailable_reason="api_response"
fi
echo "DEPENDENCY_REVIEW_EVIDENCE state=${evidence_state} reason=${unavailable_reason} repository=${REPOSITORY} visibility=${repository_visibility} http_status=${http_status} curl_exit=${curl_status}"

if [ "$evidence_state" != "complete" ]; then
echo "::error::Dependency review evidence unavailable for ${REPOSITORY} at exact base ${BASE_SHA} and head ${HEAD_SHA}: classification ${unavailable_reason}; HTTP ${http_status}; curl exit ${curl_status}. This is not a vulnerability-free result. Verify dependency-graph/security configuration and GitHub service behavior, then rerun. Failing closed."
exit 1
fi

Comment thread
seonghobae marked this conversation as resolved.
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/strix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,12 @@ jobs:
# standing operating directive accepts that central OpenCode/Strix/Noema
# scans may take more than two hours per model (docs/product-goal-directive.md).
# The scanner gets a 150-minute process budget and a 155-minute total
# retry budget; the 170-minute step and 200-minute job leave deterministic
# time to preserve partial reports and publish a concrete failure reason.
# retry budget. Three one-hour sidecar preflight attempts plus the
# 170-minute scan step fit within this six-hour job with ten minutes left
# to preserve partial reports and publish a concrete failure reason.
# Hitting any cap is fail-closed and never turns an incomplete scan into
# an approval.
timeout-minutes: 200
timeout-minutes: 360
runs-on: ubuntu-latest
# Least-privilege token scoped to this job (Scorecard alert #43): the scan
# exchanges an OIDC token (id-token) and publishes same-repo status evidence
Expand Down Expand Up @@ -565,8 +566,10 @@ jobs:
;;
esac
strix_model="$(printf '%s' "$STRIX_MODEL" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
echo "strix_model=$strix_model" >> "$GITHUB_OUTPUT"
echo 'enabled=true' >> "$GITHUB_OUTPUT"
{
echo "strix_model=$strix_model"
echo 'enabled=true'
} >> "$GITHUB_OUTPUT"
echo 'provider_mode=contextual_orchestrator' >> "$GITHUB_OUTPUT"

- name: Provision contextual-orchestrator Strix sidecar
Expand Down
240 changes: 226 additions & 14 deletions CHANGELOG.md

Large diffs are not rendered by default.

86 changes: 68 additions & 18 deletions docs/adr/0003-contextual-orchestrator-vendored-free-zdr.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ all five, and auto-optimize routing by cost.

1. **Vendoring, pinned**: `scripts/ci/contextual_orchestrator_review_sidecar.sh`
clones `ContextualWisdomLab/contextual-orchestrator` at an exact SHA
(`8cd99f139915131ba0239bce12a5d6a5fd85394e` today) into `RUNNER_TEMP`. The
(`ab7a813a69dae19541dc2888acd50c4ce37b29b7` today) into `RUNNER_TEMP`. The
source's `requirements.lock` is installed with `--require-hashes` and
`--no-deps`, so dependency resolution cannot silently move the reviewed
runtime.
Expand All @@ -43,17 +43,21 @@ all five, and auto-optimize routing by cost.
price-attested; a partial price vector, malformed numeric value, conflicting
free marker, or missing currency for a published vector fails closed. The gateway's
`orchestrator/free` virtual id fails closed (`400 invalid_model`) unless an
enabled zero-cost agent exists. Strix uses `orchestrator/auto`; its catalog
enabled zero-cost agent exists. Strix originally used `orchestrator/auto`
(superseded by the 2026-08-30 amendment below: Strix now uses
`orchestrator/free`, like OpenCode and Noema); the `auto` pool's catalog
may admit priced routes only through this evidence-bearing
policy, never through a direct-provider model identifier.
The auto pool probes the free catalog first. Only when every selected free
route rejects the real runtime request contract does it rebuild once from
fully price-attested routes and record the rejected primary attempt. This is
evidence-triggered failover, not an arbitrary free/paid mixing ratio.
Both stages share one twelve-route startup budget: no more than eight routes
enter the free primary stage and only its remaining capacity may enter priced
fallback. Full discovery counts remain in policy evidence, and the transient
priced catalog is removed immediately after loading.
Both stages share one 24-route startup budget: no more than eight routes
enter the free primary stage and only the remaining capacity (at most sixteen
routes) may enter the price-attested fallback when the `auto` pool is in use.
The `free` pool never admits priced fallback. Full discovery counts remain in
policy evidence, and the transient priced catalog is removed immediately
after loading.
3. **ZDR-first within each cost tier**: `scripts/ci/zdr_policy.py` defines ZDR
the way OpenRouter does ("a provider will not store your data for any period
of time"; zero retention also implies no training) and is deliberately
Expand All @@ -73,21 +77,42 @@ all five, and auto-optimize routing by cost.
credential-account-diverse agents catalog, capped in size, in the
orchestrator's own `ModelAgent` schema. Every KV credential is an independent
account; vendor or endpoint identity does not imply model equivalence. Only
explicit `model_group` membership may share routing evidence.
explicit `model_group` membership may share routing evidence. The sidecar
defaults the per-account cap to `contextual_orchestrator_review_policy`'s
own `DEFAULT_ACCOUNT_CAP` (4), never to the total preflight-route budget: an
earlier version of this ADR described defaulting the cap to the same
24-route total budget "so a single provider's catalog is not truncated,"
but that was a real, live-evidenced bug (ContextualWisdomLab/.github#1415)
— it silently disabled per-account diversification and let two
rate-limited NVIDIA NIM credentials sharing one upstream jointly occupy an
entire 12-slot preflight batch. `ORCHESTRATOR_CATALOG_ACCOUNT_CAP` remains
an explicit operator override. (2026-08-31 correction: that "defaults to
4" claim was true of the Python launcher's own fallback but not, until
this date, of the shell sidecar — `contextual_orchestrator_review_sidecar.sh`
still unconditionally exported a leftover literal `8` default whenever no
operator override was set, which meant the launcher's own env-unset
fallback branch could never actually run in production and every real run
got a cap of 8, not 4. The shell now derives its default the same way the
startup watchdog seconds below are derived: by reading
`contextual_orchestrator_review_policy.DEFAULT_ACCOUNT_CAP` at runtime
instead of hard-coding a numeric literal, so shell, Python, and this ADR
describe one real number.)
4. **Wiring**: `pr-review-autofix.yml` and the Required OpenCode dispatch
provision the sidecar with the five secrets before OpenCode runs and point
every model/diagnosis candidate at `contextual-orchestrator/orchestrator/free`;
the generated dispatch config contains only the gateway provider. The shared
`opencode.jsonc` default `model`/`small_model` is the same gateway route.
`noema-review.yml` retains `orchestrator/free`. `strix.yml` provisions the
same sidecar and uses the loopback chat-completions/API-compatible URL with
`orchestrator/auto`: the 2026-08-29 exact-head DiskSage scan proved that four
same sidecar and originally used the loopback chat-completions/API-compatible
URL with `orchestrator/auto` (superseded by the 2026-08-30 amendment below:
`strix.yml` now defaults to `orchestrator/free`, like OpenCode and Noema):
the 2026-08-29 exact-head DiskSage scan proved that four
discovered free routes all shared the OpenRouter outage domain, which the
gateway correctly collapsed to one provider attempt. Strix therefore uses
gateway correctly collapsed to one provider attempt. Strix therefore used
the provider-diverse pool supplied by all five configured credentials.
Provider diversity and cost-evidence classification remain delegated to the
gateway rather than embedding a second routing policy in GitHub Actions.
Strix has no external fallback and private targets pass visibility through
Strix had no external fallback under `auto` and private targets pass visibility through
to the gateway's ZDR requirement. Noema reviewer identity remains
`NOEMA_REVIEW_TOKEN` / GitHub App / OIDC and is still never `github.token`;
Autofix mutation still requires `PR_REVIEW_MERGE_TOKEN` /
Expand All @@ -108,15 +133,40 @@ all five, and auto-optimize routing by cost.

## Consequences

- **Bounded discovery preflight (2026-08-29):** the sidecar probes at most 24
selected routes in concurrent batches of four and stops after the first batch
with a usable text route. This preserves a finite startup budget while
allowing a rejected first catalog slice to fall through to later discovered
routes. The intentional oversized-body contract probe captures its expected
413 diagnostic locally so it cannot be mistaken for provider discovery
failure. Exhausting every bounded batch still fails closed before healthz.

- **Separate startup and serving budgets (2026-08-30):** route admission keeps
the ten-second timeout so unavailable providers cannot delay healthz, while
the serving `ModelClient` uses the Noema gate's 9,600-second review budget.
Both phases keep zero retries and the same bounded request policy; the
launcher test verifies the two constructed client configurations separately.

- **Direct gateway requests (2026-08-30):** the sidecar's startup request and
Noema request select explicit `route` orchestration so they validate and use
the direct virtual-pool path without invoking auto-mode triage. The Noema
change is limited to the exact process-local sidecar origin; external
OpenAI-compatible URLs retain their original payload. Provider response
validation and fail-closed non-200 handling are unchanged.

- The autofix/OpenCode review paths no longer hard-code any provider base URL
or model id; upstream model selection is delegated to the orchestrator's
discovery under the zero-cost pool. Strix uses the separately governed auto
pool without treating absent price metadata as either free or paid-route
evidence.
- Strix delegates selection to `orchestrator/auto`. Its correctness-first pool
remains distinct from the zero-cost OpenCode/Noema pool, while private-target
ZDR admission remains fail-closed. Unknown-cost routes remain auditable but
ineligible; free and fully price-attested routes are the only review routes.
discovery under the zero-cost pool. Strix originally used the separately
governed auto pool (superseded by the 2026-08-30 amendment below: Strix now
uses the same zero-cost pool as OpenCode/Noema) without treating absent
price metadata as either free or paid-route evidence.
- Under `orchestrator/auto`, selection is delegated to the gateway's
correctness-first pool, distinct from the zero-cost OpenCode/Noema pool,
while private-target ZDR admission remains fail-closed. Unknown-cost routes
remain auditable but ineligible; free and fully price-attested routes are
the only review routes. (This paragraph describes the `auto` pool mode
itself, which still exists for any caller that opts into it explicitly —
see the 2026-08-30 amendment below for why Strix no longer does.)
- Workers need egress to the five provider model-list hosts and, when reachable,
`https://openrouter.ai/api/v1/endpoints/zdr`; the feed failure path is
graceful (static table).
Expand Down
44 changes: 22 additions & 22 deletions docs/adr/0005-sidecar-preflight-token-budget.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@ Citations below pin to the exact reviewed blob at `main`'s
2. **The shell script's own virtual-pool smoke request.** Once `/healthz` succeeds (a separate,
already-completed budget — Layer 2 does not draw from Layer 1's 180s), the shell script sends one
`POST /v1/chat/completions` with `"model":"orchestrator/free"` (the *virtual* pool id, not a
specific candidate) and its own fixed `max_tokens`, currently `4096`, under a **120-second**
`curl --max-time`. This 120s value is itself the outcome of a prior, real, evidenced fix in this
specific candidate) and its own fixed `max_tokens`, currently `4096`, under a **one-hour**
`curl --max-time`. The former 120s value was itself the outcome of a prior, real, evidenced fix in this
exact file (raised from a too-tight 30s after live reproduction on
`ContextualWisdomLab/contextual-orchestrator#921` showed a genuinely-healthy DeepSeek NIM route
needing more than 30s to complete a real generation) — the comment there explicitly documents that
this required-workflow job budgets **120 minutes** total (`timeout-minutes` in
`strix.yml`/`noema-review.yml`) and that *"the org's own stated policy accepts multi-hour central
review latency in favor of accuracy over speed."* This ADR's design deliberately **does not shorten
that 120s value** — doing so would reintroduce the exact regression that prior fix corrected. The
these required-workflow jobs now budget up to **six hours** total and that *"the org's own stated
policy accepts multi-hour central review latency in favor of accuracy over speed."* The one-hour
bound removes the synthetic 120s failure while preserving finite retry and failover behavior. The
correct fix for a hang, per Devin Review (see Decision §1), is a bounded *retry*, not a shorter
*timeout*.

Expand Down Expand Up @@ -178,10 +177,10 @@ correctly caught in an earlier revision of this text):**
treats it as Trigger A: retried up to `REVIEW_PREFLIGHT_GATEWAY_MAX_ATTEMPTS` times against a
candidate the gateway is, by the same reasoning as the Trigger-B/route-diversity note below, more
likely to repeat than diversify away from. **This does not change Layer 2's stated worst case**
(`REVIEW_PREFLIGHT_GATEWAY_MAX_ATTEMPTS × 120s` — this failure still consumes attempts from the
(`REVIEW_PREFLIGHT_GATEWAY_MAX_ATTEMPTS × 3600s` — this failure still consumes attempts from the
same shared Trigger-A budget, not an additional one), but it does mean this specific failure
typically consumes the *entire* retry budget before failing closed, rather than failing fast the
way a correctly-classified Trigger B would (one attempt, ~120s). A correct fix requires a
way a correctly-classified Trigger B would (one attempt, up to one hour). A correct fix requires a
`contextual-orchestrator` change (a machine-readable field distinguishing the two
`ProviderResponseError` cases through the `/v1/chat/completions` error boundary) — genuinely out of
scope for this sidecar-only ADR and its stacked implementation PR. Fragile string-matching on the
Expand Down Expand Up @@ -337,22 +336,22 @@ retried once, unconditionally, would be a real, computed worst-case blowup again
itself be exactly the unjustified heuristic this ADR's convergence principle already rejects.
Tracked as `ContextualWisdomLab/.github#1458`; revisit if real hosted-run telemetry (already required
below) shows a specific, evidenced bias worth correcting.
- **Layer 2** (bounded only by the job's own 120-minute ceiling, per the org's stated "accuracy over
- **Layer 2** (bounded by the caller job's ceiling, per the org's stated "accuracy over
speed" policy already reasoned in this file — *not* by the 180s Layer 1 budget, which has already
completed by the time Layer 2 runs): keep the existing per-attempt timeout (**120s, unchanged** — not
shortened, per Context above) and the existing **`4096` budget, unchanged throughout — Layer 2 never
completed by the time Layer 2 runs): use a one-hour total-time timeout plus a 10-second connection
timeout. Keep the existing **`4096` budget, unchanged throughout — Layer 2 never
escalates** (already proven working on a real hosted run, `contextual-orchestrator#921`; see Decision
§1 for why an escalation tier was considered and dropped here). Allow up to
`REVIEW_PREFLIGHT_GATEWAY_MAX_ATTEMPTS = 3` total attempts, consumed only by Trigger A (transport
`REVIEW_PREFLIGHT_GATEWAY_MAX_ATTEMPTS = 3` total attempts (one for an explicitly pinned
single-candidate job), consumed only by Trigger A (transport
failure/hang/non-2xx) — Trigger B (empty + either its `finish_reason == "length"` or
reasoning-without-content signature) is not retried at Layer 2 at all (Decision §1). **Worst case**:
3 × 120s = **360s (6 minutes)** —
explicit, bounded, and small relative to the job's 120-minute ceiling; the previous design's worst
case was already 120s for one unconditional attempt with no chance of recovery, so this trades a
bounded amount of additional worst-case latency for surviving exactly the transient-hang class of
failure reproduced live on this ADR's own PR.
- **Initial values are reused precedent, not new guesses** (Devin Review's fourth finding): every
number above is either already deployed in this exact codebase today (`10s`, `120s`, `4096`, `12`)
reasoning-without-content signature) is not retried at Layer 2 at all (Decision §1). The job timeout
and per-attempt timeouts are fail-closed wall-clock bounds; a pinned candidate failure advances to
the next job instead of reporting curl's former synthetic 120-second transport failure.
- **Initial values are derived or reused, not guesses** (Devin Review's fourth finding): the one-hour
attempt bound follows from the six-hour caller ceiling: three attempts plus the 170-minute Strix
workload consume 350 minutes and preserve ten minutes for cleanup. Other numbers are either already
deployed in this exact codebase today (`10s`, `4096`, `12`)
or has direct external documentation backing it (`16` — the pre-#1436 value this codebase already
ran with, and separately the floor OpenRouter's own schema documents: *"some providers enforce a
minimum of 16"* for the deprecated `max_tokens` field). The two new counters
Expand Down Expand Up @@ -398,8 +397,9 @@ outcome already observed in production.**
being wrong for a fixed token budget, or hanging/failing transiently, which is the actual shape of
the problem — while keeping every worst case explicit and bounded rather than open-ended.
- Layer 1's worst case would grow from ~120s to a computed 160s, still under its existing 180s
healthz-readiness ceiling. Layer 2's worst case would grow from a single 120s attempt with no
recovery path to up to 360s across bounded retries — small relative to the job's 120-minute ceiling
healthz-readiness ceiling. Layer 2 allows up to three one-hour attempts; the six-hour Strix caller
leaves ten minutes after that maximum plus its 170-minute scan step, while pinned Noema jobs use one
attempt before cross-job failover.
and consistent with this file's own already-stated "accuracy over speed" policy.
- Keeping Layer 2 (not just Layer 1) would mean the preflight still proves the actual consumer-facing
`orchestrator/free` route works, not only that individual candidates can respond in isolation —
Expand Down
Loading
Loading