Repository navigation
refactor(providers): consolidate stream and catalog owners - #173563
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9f6337ffb
ℹ️ 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".
| Object.freeze(selection); | ||
| Object.freeze(this); | ||
| } | ||
| ) {} |
There was a problem hiding this comment.
Update the remaining frozen-context assertions
When the Codex settled-finalization suites run, this empty constructor leaves both the context and its data array mutable, but run-attempt.settled-finalization.test-support.ts (lines 208 and 290), settled-turn-finalizer.native.test.ts (line 803), and session-history.test.ts (line 213) still assert that these values are frozen. Those assertions now deterministically fail, so remove or revise all of them as part of this behavior change.
AGENTS.md reference: AGENTS.md:L85-L86
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR consolidates provider stream composition, framing, catalog caching, and Codex validation around shared owners. Example: While downloading gemma4:e2b from Ollama, the progress callback throws "progress display failed".
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep this PR open: the maintainer-approved consolidation is worthwhile, but three concrete cutover defects need repair before merge. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherProvider plugins translate model requests into transport calls; shared stream helpers process hooks and response frames, catalog helpers cache model metadata, and the runner owns inference liveness. flowchart TD
A[Agent runner] --> B[Provider adapters]
B --> C[Shared payload and stream helpers]
C --> D[Provider transports]
D --> E[Provider services]
B --> F[Shared catalog cache]
F --> E
Technical reviewBest possible solution: Complete the test and packaging cutover while retaining the approved shared-owner design and accepted tradeoffs. Do we have a high-confidence way to reproduce the issue? Source inspection establishes the remaining freeze assertions and missing wrapper inventory entries, and hosted CI corroborates both; the notification-test failure is additionally verified in CI's synthetic merge with the overlapping main change. Is this the best way to solve the issue? The shared-owner approach fits the repository's design guidance, and the recorded maintainer tradeoffs resolve its intentional behavior changes; the remaining repairs should complete that cutover rather than restore the removed machinery. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 012bb1ccaf0b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource -610, Tests -28, Docs +12, Other -3. Total -629 across 68 files. Added test files: 1. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 15, 2026, 8:09 PM ET / October 16, 2026, 00:09 UTC. |
f9f6337 to
fde1c46
Compare
…173563) * refactor(providers): consolidate stream and catalog owners * chore(providers): shrink removed assertion allowances * fix(providers): preserve tooling imports and retained fixture contracts * test(codex): validate prepared terminal notifications
What Problem This Solves
Provider implementations still have parallel stream settlement/framing paths,
catalog borrower protocols, and a private OpenCode Go watchdog competing with
the runner's existing liveness owner. Codex also materializes schema references
and defaults that the schema dependency and actual consumers already own.
User Impact
Internal cleanup with existing provider features, cancellation, FIFO, security,
resource bounds and shutdown settlement retained. Ollama now reports a progress
callback failure instead of swallowing it as malformed JSON. Radius accepts
standard mixed SSE line endings. No configuration or migration is required.
Why This Change Was Made
Use one owner for payload-hook settlement, sync/promise stream mapping, raw SSE
framing and bounded Ollama NDJSON. Keep vendor payload rules, EOF behavior,
reader lifetimes and transport validation local. Vertex uses existing Anthropic
thinking/output-budget policy, including authoritative listed capability overrides.
Read-only catalog loads become bounded, auth-keyed shared promises rather than
consumer-counted controllers and removable waiters. Native TypeBox reference
resolution replaces Codex's recursive schema closure/default injection; consumed
modality defaults live at the model owner. Owned finalization projections no
longer need recursive freezing; source/model/auth detachment stays.
The OpenCode Go provider uses the existing runner watchdog instead of a second
queue, pump, timer and terminal-event synthesizer. The registered-provider
integration test retains human-reported issue #93610's missing-EOF protection.
Actual cloud/cron/explicit bounds, transport first-SSE timeout and failover remain.
Net production: 609 lines removed, excluding tests, support, fixtures,
generated files, declarations and documentation. No dependency, persisted schema,
protocol, permission or public SDK contract change. Phase E is untouched.
Best-effort tradeoffs accepted
fix(models): keep shared catalog requests alive for remaining callers #157191/Model catalog cancellation interrupts other callers of a shared request #157189 concern source review and synthetic cancellation, not a human
actual-use failure. Each observer still cancels independently; loader deadlines,
scoped keys, refresh, eviction and bounded cache size remain.
settles. fix(plugin-sdk): release cancelled catalog callers before shared loads finish #162516 explicitly lacked established production incidence; its
amplified marker-retention harness does not justify a second waiter protocol.
refactor: migrate validators to TypeBox #86639/refactor(codex): deduplicate generated protocol schemas #117382/refactor(codex): deslop codex #157080 describe compiler/materialization ownership, not a human incident
requiring this allocation. Consumed defaults remain at their semantic owners;
native schema validation still rejects malformed wire input.
idle pump or synthesized terminal event. Real registered inference uses the
shared watchdog; [Bug]: opencode-go provider streaming — API calls complete on provider side but gateway never receives stream termination signal #93610 remains protected. [Bug]: opencode-go stalled-stream watchdog aborts a live stream and drops the completed answer (idle timer re-arms only on token deltas, not block-boundary events) #96518's synthetic harness does not
require two owners. Transport timeout and native terminal/error handling remain.
forwarding adapter. Async hooks still settle before outgoing provider policy.
feat(models): refresh provider models and live discovery #131294/fix(kilocode): normalize string stop param to array in stream wrapper #86461/refactor: simplify agent runtime preparation and dispatch #152399 provide implementation provenance, not timing incidents.
owner's precedence rather than another local race protocol. Real cancellation,
startup errors, unref timers and the final credential-return abort check remain.
internal mutation. Source detachment, captured auth/model facts and human
[Bug]: Codex nativeSubagentAssignments are never removed after completion delivery gives up; every new parent thread re-pins and re-sends them #172837's durable completion restoration remain unchanged.
Evidence
Targeted production and changed extension-test types passed. Runtime and Madge
cycles are both zero. SDK exports/surface checks, syntax lint, changed line caps,
formatting and diff checks passed. Fresh complete independent review found no
actionable P0–P2 findings. The moved assertion retains its explanatory invariant.
The first two focused provider/owner shards passed174 tests across15 files; the remaining
selection was stopped before repair edits. The pre-push lint-suppression
suite passed3/3. Full build remains pending; public SDK API comparison is running
against frozen refs. The isolated root-script test type graph reports an unchanged Vitest
performance-plugin type mismatch; the one changed inventory row only removes a
deleted test filename. Exact-head hosted CI is the broad proof, not a claim that
unfinished local preparation passed. The existing environment-count mismatch
(452 versus 453) was reproduced on the untouched base previously.
The assertion ratchet identified five stale allowances after the implementation
removed their casts; those exact rows are shrunk, never expanded. The broad
changed-check invocation was stopped after its unrelated SQLite ratchet made no
progress for over thirty minutes; scoped provider gates and hosted CI own the
remaining proof. No database code is changed.
Release-note context: provider-internal consolidation and visible Ollama progress
failure reporting; no live-provider, billing or general performance result claimed.
Owned CI repairs
The first exact-head run exposed four owned jobs, not inherited failures:
checks-node-compact-small-1-2caught two newly eager imports outside the protectedtooling extraction;
check-test-typescaught a reader import lost by the cleanmain merge; extension bundles3/5 caught that import and four stale private-freeze
assertions. The repair routes thinking through the existing Anthropic facet and
SSE framing through the existing shared transport owner. The protected wrapper,
inventory and allowances remain unchanged. Main's later retirement of the private
reader is adopted: both negative assertions use the existing prepared-notification
owner, retaining malformed-item and nonterminal rejection. Only obsolete Object.isFrozen assertions are removed,
leaving content, detachment, persistence and authority checks intact. These are
source/test repairs, not CI reruns or timeout/retry changes.
Fresh repair review is scoped-clean through P2; targeted production types, syntax
lint, 67-file line-cap check, runtime cycles0 and suppression3/3 pass. A direct run
of the unchanged closure owner reports missing[]/stale[]. Its Vitest invocation
timed out at the unchanged120s bound on the loaded host without an assertion
verdict. Earlier separate Codex replays were stopped during prolonged preparation,
not claimed passing. Expanded repair-test types pass. The full Madge recheck was
stopped before integration; API rendering remains pending. The previous cut's Madge0 proof is reused:
the only added import is a direct shortcut over the existing
internal/anthropic→providers/anthropic→anthropic-transport-options path; the SSE
move adds no import, and all other repair edges are removed. No new component is
possible from that shortcut.
A real one-file import conflict and the named type gate required a conflict-only
rebase onto main. Main's prepared-notification owner and private-reader retirement
are preserved. Fresh test-only review is clean through P2; conflicted-graph types,
runtime cycles0, SDK exports/surface, syntax lint, line caps and suppression3/3 pass.
All18 protocol-validator assertions passed (the wrapper was stopped during its
generation-cleanup phase, so no aggregate exit-zero claim). A separate direct
production-owner probe also accepts the valid terminal fixture and rejects both
malformed nested text and nonterminal status. Exact repaired-head CI supplies broad proof.