|
| 1 | +# 010 — wp2: Round 1 |
| 2 | + |
| 3 | +Bottom layers plus the clean half of the merge track. Target: five PRs merged into |
| 4 | +`dev` in one CI generation, closed by a post-merge `dev` run. |
| 5 | + |
| 6 | +Every source fact below was read live on 2026-09-14 by read-only recon agents. |
| 7 | +Re-verify line numbers before editing; `dev` moves. |
| 8 | + |
| 9 | +## Round 1 contents |
| 10 | + |
| 11 | +| # | Branch or PR | Owner | Deliverable | |
| 12 | +|---|---|---|---| |
| 13 | +| 1 | `codex/260914-l1-bridge-backend-model` | L1 | sidecar model bound to the bridge backend | |
| 14 | +| 2 | `codex/260914-l2-devin-catalog-supports-images` | L2 | catalog parser preserves field 5 as true/false/unknown | |
| 15 | +| 3 | `codex/260914-l3-cursor-spare-budget` | L3 | spare-budget restoration of recent invocations | |
| 16 | +| 4 | #4511 (`maoxin1234:fix/vision-native-model-capabilities`) | main | merge as-is | |
| 17 | +| 5 | #4512 (`maoxin1234:fix/audio-outcome-accounting`) | main | merge as-is | |
| 18 | + |
| 19 | +## L1 bottom — bridge backend/model agreement |
| 20 | + |
| 21 | +File: `src/web-search/passthrough-bridge.ts`. |
| 22 | + |
| 23 | +`sidecarSettingsForBridge` (677-705) takes `sidecar.model` from the global |
| 24 | +`config.webSearchSidecar` blob without checking that the global backend equals the |
| 25 | +bridge backend, and `core.ts:6290-6296` passes that blob whole. A global |
| 26 | +`{backend:"openai", model:"gpt-5.6-luna"}` therefore reaches |
| 27 | +`runAnthropicWebSearch` when a provider sets `webSearchBridge.backend: "anthropic"`. |
| 28 | +Credentials do not leak — `resolvePassthroughWebSearchBridgeAuth` (155-181) |
| 29 | +inspects only the named backend — so this is a model and settings defect, not a key |
| 30 | +defect, and the PR body must say exactly that. |
| 31 | + |
| 32 | +```diff |
| 33 | +- sidecar?: Pick<OcxWebSearchSidecarConfig, "model" | "reasoning" | "xSearch">; |
| 34 | ++ sidecar?: Pick<OcxWebSearchSidecarConfig, "backend" | "model" | "reasoning" | "xSearch">; |
| 35 | + |
| 36 | +- const model = backend === "anthropic" ? sidecar.model ?? DEFAULT_ANTHROPIC_BRIDGE_MODEL |
| 37 | +- : backend === "xai" ? sidecar.model ?? DEFAULT_XAI_BRIDGE_MODEL |
| 38 | +- : backend === "gemini" ? sidecar.model ?? DEFAULT_GEMINI_BRIDGE_MODEL |
| 39 | +- : sidecar.model ?? DEFAULT_OPENAI_BRIDGE_MODEL; |
| 40 | ++ const model = modelForBridgeBackend(backend, sidecar); |
| 41 | +``` |
| 42 | + |
| 43 | +`modelForBridgeBackend` applies `sidecar.model` only when |
| 44 | +`resolveSidecarBackend(sidecar.backend) === backend`, and otherwise returns the |
| 45 | +backend default. Reuse `resolveSidecarBackend` from `src/web-search/index.ts`; do |
| 46 | +not invent a second resolver. `planWebSearch` (index.ts:112-208) already pins the |
| 47 | +backend first and is the precedent to follow. |
| 48 | + |
| 49 | +Tests go in `tests/web-search/web-search-passthrough-bridge.test.ts`: a global |
| 50 | +openai model with an anthropic bridge yields `claude-sonnet-5`; a matching backend |
| 51 | +keeps the override; repeat the matrix for xai and gemini. Structure owner is |
| 52 | +`structure/runtime.md`, hosted-search bridge contract at L238-247. |
| 53 | + |
| 54 | +Destination policy stays out of this layer. That is L1 top. |
| 55 | + |
| 56 | +## L2 bottom — Devin catalog preserves supportsImages |
| 57 | + |
| 58 | +File: `src/adapters/devin/cloud-direct/catalog.ts`. |
| 59 | + |
| 60 | +`parseCatalogBuffer` (107-141) has arms for fields 1, 4, 18 and 22 and no default, |
| 61 | +so `ClientModelConfig` field 5 is dropped by omission. `disabled` defaults to |
| 62 | +`false` when absent; image support must not copy that pattern, because an absent |
| 63 | +field has to stay unknown. That is the #1796 precedent, and Antigravity already |
| 64 | +implements the tri-state at `src/providers/antigravity-models.ts`:587-592. |
| 65 | + |
| 66 | +```diff |
| 67 | + export interface ModelCatalogEntry { |
| 68 | + modelUid: string; label: string; disabled: boolean; contextWindow?: number; |
| 69 | ++ /** ClientModelConfig #5. Present true/false asserts; omitted means unknown. */ |
| 70 | ++ supportsImages?: boolean; |
| 71 | + } |
| 72 | ++ let supportsImages: boolean | undefined; |
| 73 | + } else if (sf.num === 4 && sf.wire === 0) { disabled = sf.value === 1n; |
| 74 | ++ } else if (sf.num === 5 && sf.wire === 0) { supportsImages = sf.value === 1n; |
| 75 | + byUid.set(modelUid, { modelUid, label: label || modelUid, disabled, |
| 76 | + ...(contextWindow > 0 ? { contextWindow } : {}), |
| 77 | ++ ...(supportsImages !== undefined ? { supportsImages } : {}), |
| 78 | + }); |
| 79 | +``` |
| 80 | + |
| 81 | +Extend the file-header schema comment with `#5 supportsImages bool` in the same |
| 82 | +commit; the comment is the only schema documentation this parser has. |
| 83 | + |
| 84 | +Test: extend `"the catalog parser reads the per-account context window"` in |
| 85 | +`tests/providers/devin-adapter.test.ts` (300-323) with three cases built from |
| 86 | +`encodeVarintField(5, 1)`, `encodeVarintField(5, 0)` and omission, asserting |
| 87 | +`true`, `false` and `undefined`. Encoder helpers already exist at |
| 88 | +`src/adapters/devin/cloud-direct/wire.ts`:54-63. |
| 89 | + |
| 90 | +PR #4511 touches only `src/vision/eligibility.ts` and its test, so there is no file |
| 91 | +overlap. Do not wait on it and do not restack into it. |
| 92 | + |
| 93 | +Corrections returned by L2 after doing the work: `encodeVarintField` is at |
| 94 | +`wire.ts`:63-65, not 54-63; `parseCatalogBuffer` spans 107-142; the file-header |
| 95 | +schema comment omits field 18 as well as field 5, so the patch documents both and |
| 96 | +carries per-field provenance instead of a blanket "verified against extension.js" |
| 97 | +claim, because field 5 identity is corroborated from external ClientModelConfig |
| 98 | +documentation rather than re-read from the vendor bundle. For this layer the only |
| 99 | +structure owner that actually documents the Devin adapter in prose is |
| 100 | +`structure/adapters/registry.md`; `structure/catalog.md` has no Devin mention and |
| 101 | +owns the round-2 provider-fetch surface instead. |
| 102 | + |
| 103 | +## L3 bottom — Cursor spare-budget restoration |
| 104 | + |
| 105 | +File: `src/adapters/cursor/protobuf-request.ts`. The per-call 2 KiB cap |
| 106 | +(`CURSOR_INVOCATION_ARGUMENTS_BYTE_LIMIT`, line 84) is applied at envelope |
| 107 | +construction in `toolCallArgumentsText` (937-967) and never revisited, even when |
| 108 | +almost all of the 192-root and 512 KiB envelope is unused. A 4,693-byte successful |
| 109 | +call loses its tail inside a 6,011-byte replay. |
| 110 | + |
| 111 | +Insert a second pass after `selected` is assembled (near line 694) and before the |
| 112 | +return. It spends only leftover aggregate bytes, newest `toolResult` first, skips |
| 113 | +`outputElided` roots, and never evicts a retained root. It does not remove the cap: |
| 114 | +admission still uses the 2 KiB prefix. |
| 115 | + |
| 116 | +Two review-surviving details from recon: |
| 117 | + |
| 118 | +- Gate on `echoToolResultInRoot && replayedCalls` rather than |
| 119 | + `externalModel && replayedCalls`. Native `composer-2.5` echoes results into roots |
| 120 | + but is not an external wire model, so the narrower gate would leave it capped. |
| 121 | +- Use the callback form of `String.prototype.replace` so replacement patterns |
| 122 | + appearing inside serialized arguments are not expanded by the replace call. |
| 123 | + |
| 124 | +The two existing 600 KiB tests in |
| 125 | +`tests/providers/cursor/cursor-tool-result-invocation.test.ts` stay unchanged and |
| 126 | +must stay green: `"PROBE a huge argument must not evict the result output from root |
| 127 | +replay"` (244) and `"the truncated invocation line stays within the declared |
| 128 | +argument budget"` (261). They are the proof that the cap still bites under |
| 129 | +pressure. |
| 130 | + |
| 131 | +The PR body states that this claims nothing about #3506 causation. The four |
| 132 | +rejected patches there were 1,648, 1,396, 1,670 and 1,900 bytes, all under the cap. |
| 133 | + |
| 134 | +## Merge track in round 1 |
| 135 | + |
| 136 | +Every contributor PR has Cross-platform CI queued and stuck at `action_required`; |
| 137 | +none has ever executed a job. Approving those runs is the first action of the |
| 138 | +round, not the last. |
| 139 | + |
| 140 | +- #4511 at `6d926244101cb6234b66634464007268a06b1d89`: no outstanding reviewer ask, |
| 141 | + non-draft, readiness 4/4. Approve CI, wait for green, merge. |
| 142 | +- #4512 at `0235ce604cb907185295e42b05754d11d11a0bb2`: non-draft, readiness 4/4, |
| 143 | + one open CodeRabbit ask for live `handleExternalLive` regressions. Do not push a |
| 144 | + carry commit onto that branch. The readiness gate binds to the exact head, so a |
| 145 | + new push resets the checklist and re-drafts the PR. Merge as-is and deliver the |
| 146 | + asked coverage as our own follow-up PR in round 2. |
| 147 | +- #4528 (2/4) and #4529 (0/4) are drafts. Approve their CI in round 1 so round 2 |
| 148 | + has real information, but plan them as carries rather than direct merges. |
| 149 | + |
| 150 | +## Merge and proof mechanics |
| 151 | + |
| 152 | +Each lane pushes with `--no-verify`, fast-forward only. Non-tip chain commits carry |
| 153 | +`[skip ci]`. For each PR, dispatch CI explicitly, because a sync or rebase does not |
| 154 | +reliably queue it: |
| 155 | + |
| 156 | +```sh |
| 157 | +gh workflow run ci.yml --ref <branch> -F lane=all |
| 158 | +``` |
| 159 | + |
| 160 | +One ruleset term the batch argument has to respect: |
| 161 | +`require_extra_approval_for_unattributed_changes` is true on `dev`. A carry that |
| 162 | +replays another author's commits can therefore need an approval beyond the standard |
| 163 | +one. The mitigation is to author each carry as our own commits with a |
| 164 | +`Co-authored-by` trailer rather than cherry-picking the contributor's commits; the |
| 165 | +trailer is what GitHub reads for credit, and the change stays attributed to the |
| 166 | +pushing author for the ruleset. |
| 167 | + |
| 168 | +Wait for that run at the exact head SHA, then merge. Because `dev` carries no |
| 169 | +required-status-check rule and no strict up-to-date rule, the five PRs may merge |
| 170 | +back to back inside one generation; their write-sets are disjoint, so the residual |
| 171 | +risk is semantic rather than textual. Close the round with one post-merge `dev` |
| 172 | +Cross-platform CI run and record its id. |
| 173 | + |
| 174 | +Every PR body fills Summary, Verification and Checklist, and states plainly that |
| 175 | +the local suite, typecheck, build and install were NOT RUN, naming the hosted run |
| 176 | +id and SHA as the only proof. |
| 177 | + |
| 178 | +One thing the lanes discovered that makes this policy stronger than intended: a |
| 179 | +fresh lane worktree has no `node_modules`, so a focused `bun test` cannot execute |
| 180 | +at all without `bun install`. Local focused runs are therefore impossible in a lane |
| 181 | +rather than merely disallowed, and hosted CI is the only evidence that could exist. |
| 182 | +The one check that runs without install is `bun run structure:check`, used for |
| 183 | +debugging the doc gate and never cited as proof. |
| 184 | + |
0 commit comments