-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(responses): fence helper spellings from every manufactured bare alias #4819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Follow-up: the preview read-fence test asserts shape, not behaviour | ||
|
|
||
| Raised by the third regression audit on the 2.57.0 candidate, deferred past the | ||
| release on purpose. | ||
|
|
||
| ## What the test does today | ||
|
|
||
| `tests/responses/responses-preview-main-read-fence.test.ts` reads | ||
| `src/server/responses/request-prepare.ts` and `src/codex/auth-context.ts` as | ||
| text and asserts with regexes that both native-main read fences carry the | ||
| request-owned ownership term, that both preview sites validate ownership the way | ||
| `resolveCodexAuthContext` does, that no main exclusion is guarded by drain state | ||
| alone, and that `nativeMainSelectionOnly` stays derived from the drain. | ||
|
|
||
| It was written that way deliberately, for the reason recorded in its own header: | ||
| driving the divergence end to end needs a `thread_spawn` whose caller bearer is | ||
| forwardable, an account-gated candidate model, and a denial cache whose only | ||
| entry is main. The sibling contract in | ||
| `tests/routing/subagent-fallback-preview-sites.test.ts` made the same call for | ||
| the same subsystem. | ||
|
|
||
| ## Why that is not sufficient | ||
|
|
||
| A structural assertion catches the regression that has actually recurred twice -- | ||
| a fence reconstructed inline from drain state, losing the ownership half -- and | ||
| nothing else. It cannot see a fence that is present but wired to the wrong | ||
| headers, an ownership term computed against a stale route, or a consumer that | ||
| stops reading `nativeMainReadsForbidden`. Any of those is a semantic routing | ||
| regression that would keep this file green, which means the file reports more | ||
| confidence than it holds. | ||
|
|
||
| ## What the replacement needs | ||
|
|
||
| A behavioural case that drives `prepareResponsesRequest` with a forwardable | ||
| caller bearer on a `thread_spawn` and observes that the preview performs no | ||
| credential-validating read of the physical main token and scores main the same | ||
| way final authentication does. The expensive part is the fixture, not the | ||
| assertion: an account-gated model, a populated denial cache, and an injected | ||
| entitlement resolver that records whether main was consulted. The existing pool | ||
| harness in `tests/routing/subagent-fallback-handle-responses.test.ts` already | ||
| carries most of it, but that file is at its size cap, so the work is a new file | ||
| in `tests/routing/` plus its two layout registrations. | ||
|
|
||
| Keep the structural file when the behavioural one lands. They fail on different | ||
| things, and the cheap one is what catches the inline-reconstruction regression | ||
| before review. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ export { | |
| isAllowedToolChoice, | ||
| toolChoiceToolPredicate, | ||
| declaresCodeModeExec, | ||
| NAMESPACED_BARE_ALIAS_EXCLUDED_NAMES, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This change updates AGENTS.md reference: src/AGENTS.md:L11-L11 Useful? React with 👍 / 👎. |
||
| } from "./types/tools"; | ||
|
|
||
| export type { UpstreamHttpVersion, ReasoningSummaryDelivery, CodexAccountMode } from "./types/wire"; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a streaming provider echoes an explicitly selected namespaced helper by its bare name, withholding it from
declaredToolNamesmakesresponse.function_call_arguments.donefail withundeclared_tool_call:restoreRoutedNamespaceCallsonly rewritesfunction_callandcustom_tool_callobjects, so the bare name in this standard follow-up event remains unchanged before the guard checks it. Extend namespace restoration to this event shape (and itsnamespacefield), otherwise a stream can accept the added item and then abort at arguments completion.AGENTS.md reference: src/AGENTS.md:L19-L19
Useful? React with 👍 / 👎.