Skip to content

fix(routing): select concrete free model groups - #971

Open
seonghobae wants to merge 122 commits into
mainfrom
fix/model-group-timeout-openrouter
Open

fix(routing): select concrete free model groups#971
seonghobae wants to merge 122 commits into
mainfrom
fix/model-group-timeout-openrouter

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Current owner outcome — 2026-09-03

This PR remains the canonical contextual-orchestrator owner lane for concrete free-model grouping, provider discovery/routing, timeout semantics, endpoint races, and provider-embedding runtime behavior. It is not merge-ready. GitHub still reports draft=false; a fresh convertPullRequestToDraft attempt failed in the connector GraphQL response because Repository.fullDatabaseId is not available, so the body remains the explicit Draft-equivalent state. No predecessor-head check/review is being transferred.

Current exact head: 696fd17431ce5937fb318e241837709c4eebb989 on fix/model-group-timeout-openrouter, base main@464da4715b495b5eaaa593eba3796e2d976ee0c9.

Exact-head evidence boundary

Tests run 33653589654 has materialized two exact-head jobs (Full unit and contract suite; NIM benchmark coverage, docstrings, and package smoke) but they are still queued with no runner assigned. Security, Fuzz, Semgrep, OSV, Scorecard, and Security Scan are likewise non-terminal. CodeQL PR run 33653592151 terminated startup_failure before job materialization; its jobs endpoint reports total_count: 0, jobs: []. This organization-owned Actions defect has been handed to .github#712 with exact-head RED/GREEN acceptance. It is platform evidence, not source-success evidence, and required gates remain fail-closed.

Completed causal repairs on this successor line

  • Purpose-complete self-modifying source-fix machinery remains removed from the branch. Earlier endpoint-race and provider-embedding shutdown/race regressions have direct production fixes and subprocess/behavioral coverage rather than workflow source rewriting.
  • Durable bootstrap identity reporting was repaired test-first. tests/test_provider_bootstrap_report_identity.py was added first at 770dada2d11bf8ab939ded292929448fb7588d8e; source fix 7369d48d134f2f02c41d4a3db9be2a5bf83a3537 makes a durable bootstrap report the resolved persisted identity in both selected_agent_ids and enabled_agent_ids, while ephemeral bootstrap retains generated IDs.
  • The same defect existed independently in provider_catalog_bootstrap.py. tests/test_provider_catalog_bootstrap_report_identity.py was added at 3acc6cd1438ff46dcd5e7c9d2fa8d639f16ee449; minimal source fix d02c97c5c9a548467d1286f160a9cc7498916810 was diff-checked as exactly one file, +2/-1. CHANGELOG.d/bootstrap-report-persisted-identity.md records the durable contract on the current head.
  • The corresponding review thread remains open until an unchanged successor head obtains executable exact-head test evidence; the repair is not being called GREEN merely from source inspection.

Still-live repair boundaries

  1. Bootstrap admission still contains decision-affecting hand-authored selection policy: representative request weights, lexical tie-breakers, provider/model-group pass ordering, and incomplete/equal evidence fallbacks. Do not repair this by merely changing constants, weights, quotas, or tie-break strings. Automatic admission/order needs an explicit executable research/experiment/standard-backed decision model, or must fail closed when evidence cannot uniquely justify a decision.
  2. The hourly OpenCode lane still has a platform-resumability gap: cancel-in-progress: false can serialize later hourly triggers behind an execution that never returns, while a leaf-authored finite model timeout would violate the timeout=null model contract. The needed boundary is durable/resumable contextual-orchestrator-owned execution/checkpoint/re-dispatch preserving exact-head identity across external runner termination.
  3. Provider/model-group diversity semantics and migration behavior still require current-head review against the canonical free-pool contract; a hand-authored provider quota or lexical fallback is not acceptable evidence.
  4. GitHub Actions remains externally non-terminal on this exact head. Until unchanged-head required tests/security/review/provenance become terminal, no ordinary merge or release action is justified.

Stable architecture boundary

GitHub Actions callers request exactly orchestrator/free; contextual-orchestrator alone owns provider discovery, capability/privacy/free-pool admission, ranking, serving, and failover. All configured credential sources may participate in global discovery. OpenAI-derived models remain excluded from orchestrator/free while the global OpenAI integration remains available elsewhere. Private targets require ZDR admission. Default model inference timeout is null; elapsed time alone does not terminate reasoning, streaming, or tool work. Explicit caller/user cancellation, provider termination, audited admin timeout, and infrastructure loss remain distinct states.

Before ordinary merge: repair the remaining current-head owner defects test-first; preserve the no-self-modifying-source boundary and orchestrator/free contract; resolve only findings proven repaired or obsolete on an unchanged successor head; regenerate full exact-head tests/security/review/SBOM/provenance; and synchronize ADR/PRD/ARCHITECTURE/CHANGELOG/product-gap evidence. No force push, self-approval, administrative bypass, gate weakening, or predecessor-evidence transfer is authorized.

Exclude OpenRouter's aggregate free router while retaining discovered concrete free models. Group exact model identities across provider accounts and remove fixed inference deadlines, including readiness races.

Signed-off-by: Seongho Bae <me@seonghobae.me>
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

모델 검색과 부트스트랩이 모델 그룹 및 fingerprint ID를 사용합니다. 공급자 호출은 선택적 타임아웃과 명시적 취소를 지원합니다. OpenRouter ZDR 라우팅, 임베딩 실패 기록, readiness 동시성, 레거시 에이전트 동기화 및 관련 회귀 검증을 갱신합니다.

Changes

모델 검색 및 부트스트랩

Layer / File(s) Summary
모델 그룹 식별 및 검색 제한
contextual_orchestrator/model_discovery.py, contextual_orchestrator/conventions.py, contextual_orchestrator/provider_bootstrap.py
모델 그룹과 SHA-256 기반 agent ID를 추가했습니다. 레거시 ID 재사용을 지원합니다. provider별 discovery deadline과 openrouter/free 제외를 적용합니다.
부트스트랩 선택 및 동기화
contextual_orchestrator/provider_bootstrap.py, contextual_orchestrator/provider_catalog_bootstrap.py, contextual_orchestrator/__main__.py, tests/test_*bootstrap*, tests/test_discover_models_cli.py
provider 및 model group 다양성을 순서대로 적용합니다. 운영자 관리 에이전트와의 ID 충돌을 거부합니다. 선택된 모델을 동기화 후 다시 매칭합니다.

공급자 취소 및 readiness

Layer / File(s) Summary
취소 가능한 공급자 호출
contextual_orchestrator/orchestrator.py, contextual_orchestrator/endpoint_race.py, tests/test_endpoint_race.py, tests/test_local_mlx.py
DNS, TCP, 소켓 종료까지 공급자 취소를 확장했습니다. race loser 결과를 세분화해 기록합니다.
무기한 probe 및 readiness 갱신
contextual_orchestrator/orchestrator.py, README.md, contextual_orchestrator/api_contract.py, tests/test_local_mlx.py
기본 probe 및 연결 타임아웃을 선택 사항으로 변경했습니다. 동시 refresh에는 refresh_in_progress를 반환합니다.

ZDR 라우팅 및 임베딩

Layer / File(s) Summary
OpenRouter ZDR 요청 보정
contextual_orchestrator/orchestrator.py, contextual_orchestrator/batch_routing.py, contextual_orchestrator/cost_router.py, tests/test_orchestrator_client_boundaries.py
OpenRouter의 실제 base_url을 기준으로 provider를 식별합니다. zdr_only 범위에서 모든 주요 전송 경로와 Batch JSONL에 provider.zdr=true를 적용합니다.
임베딩 실행 및 실패 상태
contextual_orchestrator/server.py, contextual_orchestrator/cost_router.py, contextual_orchestrator/batch_routing.py, tests/test_batch_embeddings.py, tests/test_provider_embedding_batch_backend.py
무기한 실행과 고정 claim lease를 분리합니다. 불완전한 결과와 terminal batch 상태를 embedding failure로 기록합니다. 복구된 ZDR batch의 현재 태그를 재검증합니다.

계약 및 운영 지원

Layer / File(s) Summary
재시도·운영 문서 및 workflow
docs/adr/*, docs/planning/adrs/*, CHANGELOG.md, CHANGELOG.d/*, docs/product-technical-gap-baseline.md, .github/workflows/*, docs/kv-credentials.md
기본 transport retry를 0으로 기록합니다. OpenRouter evidence 및 ZDR 정책을 갱신합니다. workflow 단계별 제한과 gateway 프로세스 상태 확인을 추가합니다.
회귀 계약
tests/test_pr971_review_quality_regressions.py, tests/test_provider_gateway_resilience.py, tests/test_openrouter_uptime.py, tests/test_embeddings_model_pool_http_honesty.py, tests/test_provider_error_taxonomy.py
discovery deadline, provider 오류 분류, uptime timeout, embedding failure, ZDR 정책 복원을 검증합니다.
임시 수리 자동화
.github/workflows/source-fix-971-live-review-quality.yml, scripts/ci/pr971_live_review_quality_repair.py
RED 테스트 실행, 소스 수리, GREEN 검증, traceability 갱신 및 수리 파일 삭제 순서를 정의합니다.

Estimated code review effort: 5 (Critical) | ~120 minutes

Merge Risk: 🔴 Critical · up to 03b62

The current head still relies on temporary source-rewriting machinery instead of committed production fixes, while provider discovery can wait indefinitely or leak background work and embedding and failover paths retain correctness and privacy risks. These issues can cause hangs, resource exhaustion, incorrect routing, or loss of privacy guarantees, so the PR is not merge-ready and should remain blocked.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.20% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 341 functions across 44 files. (3 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 구체적인 무료 모델 그룹을 라우팅 선택 대상으로 유지하는 핵심 변경을 정확히 설명합니다. 다른 변경 사항을 모두 포함할 필요는 없으므로 제목은 간결하고 적절합니다.
Full details: Docstring Coverage

Explanation

Docstring coverage is 52.20% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 341 functions across 44 files. (3 skipped: 3 unsupported.)

✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch fix/model-group-timeout-openrouter
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/model-group-timeout-openrouter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Routing contract: provider family is not a product grouping. Selection and measurement use model_group only. OpenRouter discovery retains concrete free model IDs such as vendor/model:free; the aggregate openrouter/free meta-router is excluded because contextual-orchestrator itself owns concrete-model selection, RPM/TPM measurement, and failover.

devin-ai-integration[bot]

This comment was marked as resolved.

Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
devin-ai-integration[bot]

This comment was marked as resolved.

Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae
seonghobae enabled auto-merge (squash) August 31, 2026 12:16
@opencode-agent
opencode-agent Bot disabled auto-merge August 31, 2026 13:18
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Signed-off-by: Seongho Bae <me@seonghobae.me>
devin-ai-integration[bot]

This comment was marked as resolved.

Signed-off-by: Seongho Bae <me@seonghobae.me>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae
seonghobae enabled auto-merge (squash) August 31, 2026 23:01
Signed-off-by: Seongho Bae <me@seonghobae.me>
devin-ai-integration[bot]

This comment was marked as resolved.

seonghobae and others added 5 commits September 2, 2026 23:32
A fresh Devin Review pass on this PR (#971) flagged an Info-severity gap
in the _DaemonWorkerPool added in 59b2fc8 to replace
ThreadPoolExecutor for ProviderEmbeddingBatchBackend: shutdown() set no
closed state, so a concurrent direct submit() could enqueue real work
behind the shutdown sentinels every worker exits on -- work no worker
would ever pick up again. Real ThreadPoolExecutor.submit() raises
RuntimeError once shutdown() has run; _DaemonWorkerPool did not
replicate that fail-fast contract.

Traced every current submit() call site: ProviderEmbeddingBatchBackend
only ever calls it from __init__ (before any external reference to self
exists) and from start(), and both start() and close() serialize through
the backend's own _executor_lock, with start() checking self._closed
first. So today's actual production risk is narrow -- the backend's own
locking already prevents the described race in practice, and its
durable claim/recovery design would likely reclaim a stranded job on the
next process start regardless. But _DaemonWorkerPool is a standalone
primitive that should not depend on every future caller reproducing that
locking discipline, and matching stdlib's fail-fast contract is the
correct, minimal fix regardless of today's callers.

Added a self._shutdown flag, set under the pool's existing
_workers_lock inside shutdown() and checked under the same lock at the
top of submit() (which now also enqueues under that lock, not before
acquiring it) so the check and the enqueue/shutdown transition can never
interleave. submit() now raises RuntimeError("cannot schedule new work
after shutdown") instead of silently queuing behind the sentinels.
Left worker lazy-spawn, cancel_futures draining, and queue join
behavior untouched.

Added
tests/test_provider_embedding_batch_backend.py::test_daemon_worker_pool_submit_after_shutdown_raises_instead_of_stranding_work,
which submits and completes one real job through the pool, calls
shutdown(), then asserts a further submit() raises RuntimeError.
tests/test_provider_embedding_batch_backend.py (27 tests) and
tests/test_provider_embedding_batch_backend_process_exit.py (1 test)
pass. Broader affected suite (batch_routing/cost_router/API-contract
tests importing batch_routing, 14 files): 210 passed, the same 4
pre-existing tokenizer-unavailable ZDR failures in test_batch_embeddings.py
(unrelated to this change, present before it).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
Append a one-line changelog fragment entry for the _DaemonWorkerPool
fail-fast fix in 18a76eb, matching this file's existing per-PR
fragment convention.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
devin-ai-integration[bot]

This comment was marked as resolved.

claude and others added 6 commits September 2, 2026 15:01
A fresh Devin Review pass on this PR (#971) flagged "Concurrent shutdown
admits cancelled work" in _DaemonWorkerPool.shutdown (added in 59b2fc8,
closed-state flag added in 18a76eb): when shutdown(cancel_futures=True)
races submit(), the cancel_futures queue drain ran *before* admission
closed (self._shutdown = True, under _workers_lock). A submit() landing in
that gap could acquire the (still-unheld) lock, see self._shutdown still
False, and enqueue real work strictly after the drain loop had already
found the queue empty and exited -- that item then survived the
cancellation, got a stop sentinel queued behind it, and ran on the worker
shutdown() itself spawned and joined, despite cancel_futures=True.

Fixed by reordering shutdown(): it now acquires _workers_lock, sets
self._shutdown = True, and captures the worker list as one atomic step
*first* -- before any draining or sentinel-queuing. submit() checks the
same flag under the same lock, so the two methods can no longer interleave:
a submit() that acquires the lock after this closes admission observes the
closed pool and raises immediately (unchanged fail-fast contract from
18a76eb); a submit() already holding the lock is guaranteed to finish
enqueuing before shutdown() can proceed, so its item is still present in
the queue when the drain runs right after and is correctly cancelled. A
worker that already dequeued and started an item before the drain runs is
an inherent, expected race identical to ThreadPoolExecutor's own
cancel_futures (it cannot interrupt in-flight work) -- not the bug here.

Also made shutdown() idempotent against its own repeated-call behavior: a
second call now observes self._shutdown already set and skips re-draining
the queue and re-queuing stop sentinels (both only correct to do once),
while still joining the already-captured worker list when wait=True.

Added two regression tests to tests/test_daemon_worker_pool_shutdown.py:
test_daemon_worker_pool_submit_racing_shutdown_cannot_execute forces the
exact vulnerable interleaving deterministically (hooking the queue drain's
empty-check with an Event, no real thread-timing luck involved) and
asserts the racing submit() raises RuntimeError and its work never
executes; verified this test fails against the pre-fix shutdown() (0
RuntimeErrors raised, work would have run) and passes against the fix.
test_daemon_worker_pool_shutdown_is_idempotent asserts a second shutdown()
call does not error.

Full daemon-pool/provider-embedding/batch-routing suite (62 tests across
tests/test_daemon_worker_pool_shutdown.py,
tests/test_provider_embedding_batch_backend.py,
tests/test_provider_embedding_batch_backend_process_exit.py,
tests/test_batch_routing.py, tests/test_batch_routing_boundaries.py,
tests/test_batch_routing_boundaries_extra.py): all pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
Two fresh Devin Review findings landed on
.github/workflows/_temp_pr971_daemon_pool_shutdown.yml (added in 8caf844,
one commit before the actual fix in 18a76eb landed as an ordinary
commit):

- "Obsolete repair workflow remains active": the workflow's "Prove RED
  regression on event head" step requires
  tests/test_daemon_worker_pool_shutdown.py to fail before it will apply
  its generated repair; current source already fixes the regression the
  workflow exists to react to. Verified directly: on this branch's head
  (558c847), and independently on the pre-this-PR state (before the
  present commit's shutdown-ordering fix), that test file already passes.
  Any dispatch hits "RED regression unexpectedly passed before production
  repair" and exits before ever reaching the self-removal step at the end
  -- the workflow is fully dead, not merely redundant.
- "Repair workflow can rewrite the PR branch": its final step uses
  secrets.PR_REVIEW_MERGE_TOKEN to git commit and push generated changes
  directly to this PR's branch on a manual workflow_dispatch, bypassing
  normal PR review/merge controls -- a live exposure for anyone with
  dispatch permission on this repo, independent of whether the (now-moot)
  RED-regression guard currently blocks that step from being reached.

Confirmed before removing: the file has exactly one commit (8caf844,
2026-09-02T14:35:29+09:00) and the branch has had no further commits in
the ~14 minutes since, so this is not concurrent in-progress work; no
paired helper script exists (unlike the earlier
source-fix-971-review-quality.yml + source_fix_971_review_quality.py
pair); and no other file in the repository references
_temp_pr971_daemon_pool_shutdown.yml.

This follows the branch's own established "no purpose-complete
self-modifying/source-fix workflows" convention already applied to the
earlier source-fix-971-review-quality.yml removal (9b8f609, 0247eca,
d388564): remove confirmed-obsolete, security-carrying repair-workflow
debris rather than leave it as inert (but exploitable) machinery.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
…g-fix session

Adds a dated entry documenting today's remaining #971 session work not yet
covered by an existing entry: the real main-merge conflict resolution
(mergeable_state dirty -> blocked, tests/test_review_gateway.py resolved in
favor of main's evidence-only-admission suite after main's 0db4e5a dropped
max_agents), the two additional ThreadPoolExecutor-atexit-join fixes in
endpoint_race.py and batch_routing.py's new _DaemonWorkerPool, the raw-Future
callback-settlement regression fix, the _DaemonWorkerPool post-shutdown
submit hardening, a verified-false-positive analysis of a proposed
provider_routing equality guard, and a recap of the remaining open,
large-scope work (bootstrap diversity heuristics, hourly-loop
cancel-in-progress gap with a PR #1027 pointer, legacy identifier mixing).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 2 new potential issues.

Devin Review

if agents_db
else ()
)
selected_ids = enabled_ids if agents_db else generated_selected_ids

@devin-ai-integration devin-ai-integration Bot Sep 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Durable selection order is lost

selected_ids adopts alphabetically sorted enabled IDs for durable pools, discarding the selector’s cost and model-group order. Ephemeral reports retain that order.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@@ -0,0 +1,61 @@
"""Regression coverage for bootstrap report identity consistency."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Regression misses direct check list

This test lacks a directly runnable entry and README check-list registration. The documented per-file workflow therefore omits the identity regression.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 0 new potential issues.

Devin Review

Copy link
Copy Markdown
Contributor Author

Fresh consumer evidence that should be carried by this owner lane rather than worked around in leaves:

  • ContextualWisdomLab/keyverse#132 is migrating its hourly model-backed workflow to orchestrator/free, but it still has to vendor/pin contextual-orchestrator source revision 464da4715b495b5eaaa593eba3796e2d976ee0c9. The owner repository currently has no GitHub latest release endpoint (/releases/latest returns 404). Under the CWL boundary, a consumer must not treat a sibling source commit as the durable released client/schema contract; this owner lane needs to land a canonical immutable release/client revision and provide an upgrade target, after which Keyverse can bump to that released contract.
  • Keyverse also inherits OPENCODE_RUN_TIMEOUT_SECONDS=2100; EgressWeave#235 currently has a 45-minute Actions job timeout around the same gateway-backed OpenCode pattern. Both demonstrate the same owner/runtime gap already described in this PR body: slow reasoning/streaming/tool-call work cannot be classified as failed solely from elapsed time, but a hung external execution also must not serialize the hourly lane forever. Please preserve the timeout=null inference contract and solve resumability/checkpoint/re-dispatch as an owner runtime concern, with explicit user/provider/admin/infrastructure terminal states rather than leaf wall-clock wrappers.

Owner RED/GREEN acceptance to add before release: a long-lived orchestrator/free request survives beyond the former leaf timeout without synthetic model failure; explicit user cancellation/provider termination/audited admin timeout/infrastructure loss remain distinguishable; an interrupted maintenance execution can resume/re-dispatch with exact-head/checkpoint identity; and the resulting released API/client/schema is immutable enough for consumers to pin without vendoring this repository's source. No paid/provider-specific fallback should be required.

Fresh cross-repo consumer evidence on PR #971 (keyverse#132, EgressWeave#235)
independently hit the same owner-lane gap: no canonical immutable release
means consumers vendor a raw source SHA, and no owner-side resumable/
checkpointed execution model means every leaf re-invents its own wall-clock
timeout wrapper around the timeout=null inference contract. Records the
gap, why it's owner-lane (two independent consumers, not one), scoped action
items (SemVer release; a dedicated ADR for resumability with distinguishable
terminal states), and the owner's own stated RED/GREEN acceptance criteria,
per this repo's standing directive to keep the gap baseline current from
live PR/consumer evidence.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4

Copy link
Copy Markdown
Contributor Author

Acknowledged — recorded this evidence and the two scoped action items in docs/product-technical-gap-baseline.md (pushed as 2d8e233a).

This is genuinely two separable, architecturally significant pieces of work, not a small local fix, so I'm not folding an implementation into this PR (which is already close to mergeable on its own narrower scope: model-group timeout/thread-pool-shutdown fixes). Proposing to track them as their own dedicated tracks:

  1. Canonical immutable release — publish a tagged SemVer GitHub Release for this repo so consumers (keyverse and others) can pin /releases/latest instead of vendoring a source SHA. This is the more bounded of the two — no design questions, just release process.
  2. Resumable long-running execution — needs its own ADR before any code: distinguishable terminal states (user cancellation / provider termination / audited admin timeout / infrastructure loss), checkpoint/exact-head re-dispatch, while strictly preserving the existing timeout=null inference contract. This is the wider one and deserves design review before implementation, per this repo's own Ponytail gate.

Will pick these up as the next highest-leverage gap items once the current PR review/fix backlog is exhausted, per the standing loop. Flag if you'd rather see either scoped differently or prioritized sooner.


🤖 Generated with Claude Code


Generated by Claude Code

devin-ai-integration[bot]

This comment was marked as resolved.

Two real citation errors in the 2026-09-02 canonical-release/resumable-
execution entry: docs/CWL-MASTER-CONTEXT.md does not exist in this repo (it
is ContextualWisdomLab/.github's org-wide doc) and this repo's AGENTS.md
carries no such rule directly -- corrected to cite it as the .github repo's
document. The no-fixed-timeout policy citation named "ADR-0005", which is
the .github repo's numbering for a related policy; this repo's own
equivalent is docs/planning/adrs/0032-model-group-cost-aware-discovery.md
-- corrected to cite that file directly with its exact text.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 0 new potential issues.

Devin Review

Copy link
Copy Markdown
Contributor Author

"RED to GREEN owner repair" failure — not a defect in this PR's diff, already self-resolved

Investigated the failing required-looking check RED to GREEN owner repair (run 33632367429, job 100254717794, conclusion failure).

What it actually is

That job belongs to workflow .github/workflows/source-fix-971-live-review-quality.yml (display name "PR 971 exact-head review-quality repair" / "PR 971 live review quality repair") — one of this PR's own one-shot, branch-scoped, self-modifying source-fix workflows, same class already documented and retired earlier today (see the 06:19 / 08:18 / 09:21 UTC comments above about source-fix-971-default-retry-policy and source-fix-971-exact-head-review/source-fix-971-runtime-context-green).

Why it failed

The failed step is its own safety guard (Guard exact writer head):

remote_head="$(git ls-remote origin "refs/heads/${GITHUB_REF_NAME}" | cut -f1)"
test "$remote_head" = "$GITHUB_SHA"
test -e scripts/ci/pr971_live_review_quality_repair.py

This run was queued for the push at fe13068c (created_at 12:52:16Z) but, under the same org-wide Actions capacity congestion already called out earlier on this PR, didn't actually get a runner until 23:32:23Z — over 10.5 hours later. By then the branch tip had moved well past fe13068c (through this session's own 2d8e233a / df587e17, currently the PR head), so the guard's exact-head check failed closed exactly as designed, rather than letting a stale one-shot workflow mutate source against an out-of-date checkout.

Confirms it isn't live

  • .github/workflows/source-fix-971-live-review-quality.yml and scripts/ci/pr971_live_review_quality_repair.py no longer exist on the current head (df587e17) — this workflow has already been removed per the standing self-removal convention for this repair machinery.
  • All 7 runs of this workflow (workflow_id 348344002) are completed (this failure plus prior cancelled/failure attempts); none are queued. There is nothing left to retrigger — the workflow file that would need re-running is gone from the branch, and this job does not appear among the 24 check runs on the current head, so it is not gating the current head.

Conclusion

Not a defect introduced by this PR's diff — it's the same known org-wide GitHub Actions queue-congestion pattern hitting a now-already-deleted one-shot repair workflow's own stale-head guard. No source change is needed or applicable here; the machinery that produced this failing run is already gone from the branch. Current-head required checks (Security, CodeQL, Full unit and contract suite, etc.) remain the authoritative gate and are tracked separately.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: high status: draft type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants