|
| 1 | +# Lane A — meaning preservation on the request path |
| 2 | + |
| 3 | +Status: OPEN. Branch `codex/260920-lane-a-meaning-preservation`, cut from `origin/dev` |
| 4 | +`0613aaec17`. One branch, five ordered commits, one pull request against `dev`. |
| 5 | + |
| 6 | +## What each commit restores |
| 7 | + |
| 8 | +### #5211 — tool choice policy on the Chat Completions path |
| 9 | + |
| 10 | +Two constraints reached the parser and were dropped on the way out, both under a normal 200. |
| 11 | + |
| 12 | +A `tool_choice` of type `allowed_tools` is a record, is not `type: "function"`, and carries no |
| 13 | +`function` member, so it fell past every branch of `toolChoiceToResponses` and `body.tool_choice` |
| 14 | +was never assigned. Chat nests the subset under `allowed_tools` and names each entry under a |
| 15 | +member keyed by its own type; the Responses shape `mapToolChoice` reads carries `mode` and |
| 16 | +`tools` on the choice itself with a flat `name`. Both levels are now flattened. An entry that |
| 17 | +cannot be named is refused rather than skipped, because skipping one widens the subset. |
| 18 | + |
| 19 | +`parallel_tool_calls` had three provider states and two branches, in two places. The unset state |
| 20 | +is the default for every provider that never configured the knob, and it dropped the caller's own |
| 21 | +explicit `false` — on the translated path and, from a second copy of the same branch, on the |
| 22 | +native Chat passthrough. The decision now lives in `src/adapters/openai-chat/parallel-tool-calls.ts`, |
| 23 | +which both builders read. An explicit `true` still omits the key, matching the configured opt-out. |
| 24 | + |
| 25 | +The passthrough half was found by adversarial review, not by the original report. |
| 26 | + |
| 27 | +### #5210 — tool declaration fields on the outbound adapters |
| 28 | + |
| 29 | +`strict` was kept deliberately by the Messages inbound and forwarded by the OpenAI Chat adapter, |
| 30 | +and dropped by Anthropic — the target that defines it. It is now emitted when it is explicitly |
| 31 | +`true`. An unstated `strict` stays absent, because the inbound records it as `false` and a |
| 32 | +`false` on the wire cannot be told apart from silence. |
| 33 | + |
| 34 | +`allowed_callers` had no carrier at all. It now rides `OcxTool.allowedCallers` from the Messages |
| 35 | +inbound, through the Responses tool schema — where an undeclared key is stripped, which is why it |
| 36 | +never reached `buildTools` — to the Anthropic wire. The OpenAI Chat and Gemini builders have no |
| 37 | +counterpart and refuse with a 400 rather than rebuild the declaration without the fence. The |
| 38 | +unrestricted `["direct"]` default is not a restriction. |
| 39 | + |
| 40 | +Gemini's `functionCallingConfig.mode: "VALIDATED"` was plumbed to the wire compiler but only |
| 41 | +reachable by matching a model name. A caller-declared strict tool now selects it in place of the |
| 42 | +absent-choice default; `NONE`, `ANY` and a forced-name choice are never overwritten. |
| 43 | + |
| 44 | +### #5213 — developer message position, then role |
| 45 | + |
| 46 | +Delivered as two commits because they are two acceptance conditions. |
| 47 | + |
| 48 | +Position carries #5237 by Yum-wu with a `Co-authored-by` trailer. The upstream branch had the |
| 49 | +right idea and a broken patch (a stray `];` and an assertion that put the deferred reminder |
| 50 | +before the tool result), so the change was reimplemented and the attribution kept. One |
| 51 | +destination already had chronological placement, keyed to a model id and a registry entry; that |
| 52 | +is a property of prompt-prefix caching rather than of that destination, so it is now universal |
| 53 | +and the model/registry test is gone. |
| 54 | + |
| 55 | +Role is separate. `developer` is part of the Chat Completions role set and is now forwarded as |
| 56 | +sent. A destination that genuinely rejects it sets `foldDeveloperRoleToSystem`, which converts |
| 57 | +the role in place and never moves the message, so the placement contract holds on both paths. |
| 58 | + |
| 59 | +### #5212 — inline document bytes |
| 60 | + |
| 61 | +Both inbound parsers reduced an attachment to its name before any adapter ran. |
| 62 | +`OcxContentPart` gains a document member carrying the media type and the base64 payload; |
| 63 | +Anthropic emits the document block, OpenAI Chat the file part, Gemini `inline_data`. |
| 64 | + |
| 65 | +Widening that union is the hazard, so the part also carries the marker every text-only consumer |
| 66 | +already falls back to, which keeps a wire with no document representation byte-identical to |
| 67 | +before. Six consumers needed more than the fallback: `ollama-native` and the Cursor tool-result |
| 68 | +decoder would have read a nonexistent `imageUrl`, and the Kiro, Devin, Cursor and coding-agent |
| 69 | +text serializers would have produced an empty turn. All were found by adversarial review. |
| 70 | + |
| 71 | +The untranslated-media refusal is narrowed only where a converter actually builds the part: |
| 72 | +user content on the Chat projection, user and developer messages on the Responses one. A file in |
| 73 | +a tool output, a system message or an assistant message is still refused. The scanner and the |
| 74 | +decoder share one predicate, so a request cannot be exempted in one and reduced to a marker in |
| 75 | +the other. |
| 76 | + |
| 77 | +## Known remaining gap |
| 78 | + |
| 79 | +Tool-result documents keep the #939 marker. The Responses tool-output vocabulary has no file |
| 80 | +block and every adapter's tool-result path flattens to text, so carrying bytes there is a |
| 81 | +separate change rather than a half-done one. |
| 82 | + |
| 83 | +## Union-defect check before push |
| 84 | + |
| 85 | +- File-size ratchet: `src/adapters/openai-chat.ts` was the only capped file in the touch set |
| 86 | + (cap 822). The `parallel_tool_calls` decision moved to a sibling module and the file is 811 |
| 87 | + lines. No cap was raised. |
| 88 | +- `PROVIDER_CONFIG_FIELD_POLICY` in `src/server/auth-cors.ts` is |
| 89 | + `satisfies Record<keyof OcxProviderConfig, ...>`, so `foldDeveloperRoleToSystem` is classified |
| 90 | + there and in `providerConfigSchema`. |
| 91 | +- Every new test file is registered in both `scripts/test-layout/layout.json` and |
| 92 | + `tests/fixtures/test-layout-expected.json`, which the layout guard asserts are equal. |
| 93 | +- No count is restated: the provider reference tables gained a row rather than a number. |
| 94 | + |
| 95 | +## Verification |
| 96 | + |
| 97 | +Static source review plus exact-head hosted CI. Local suites, individual tests, typecheck, |
| 98 | +build, install and live `ocx` execution were NOT RUN, per the lane constraints. Adversarial |
| 99 | +source review ran on every commit and produced the passthrough, Kiro/Devin/Cursor/coding-agent, |
| 100 | +role-aware-refusal and base64-predicate findings listed above. |
0 commit comments