Repository navigation
fix: close the remaining audit findings across the gateway - #17
Merged
Merged
Conversation
Round four of the audit. Every item below has a regression test that fails without its fix. Correctness: - filter the consolidated `text_end` through the turn's tool bridge, so the `[[OPENCODE_TOOL_CALL]]` envelope no longer reaches `content` next to the parsed `tool_calls` on any surface; - adopt a consolidated `reasoning_end` on streamed `/v1/chat/completions`, which was the only surface without it; - close the orchestrator generator on every early return of the `/v1/responses` stream, so a failed turn cannot leave a sticky session `busy: true`; - reject `max_tool_calls`, `prompt_cache_key` and `safety_identifier` on `/v1/responses` instead of stripping them; - treat `null` as unset for the optional Anthropic fields, matching the OpenAI surfaces; - drop the unreachable duplicate `best_of` / `suffix` rejections on `/v1/completions`. Media: - prove a local attachment is a regular file before `open()`, so a FIFO can no longer block the libuv threadpool; - measure the base64 bound on the payload without its line wrapping; - release the count slot when byte admission fails; - stop an empty `file_data` from shadowing a valid `file_url`; - map `ENXIO` / `ENODEV` to `invalid_attachment`. Upstream: - carry the log redaction across chunk boundaries, so a split `server password` marker cannot reach the log file in plaintext; - cancel unread response bodies on the 401, probe and event-stream failure paths; - release the log descriptor and the live-child entry when a spawn fails; - stop counting a deliberate `stop()` as a start failure; - clamp the reconnect delay and reset it in `stop()`; - enforce the session entry cap when the store is loaded; - drop the instance from the process-exit registry; - truncate the retained upstream error body; - hash the tool set once per turn and reuse the memoised root message JSON in `deriveKey`. HTTP, auth and configuration: - charge `/metrics` to the api bucket and add a global failed-auth ceiling behind a shared proxy address; - accept only the documented Basic form and compare fixed-width digests without short-circuiting; - reject a `trustProxy` CIDR prefix of `0`; - warn on an invalid boolean, reasoning default or log level; - match the Anthropic surface path exactly and append to `vary`; - memoise the per-request path and presented key. Docs follow the behaviour change; `docs/VERIFICATION.md` no longer claims a query-string key is a transport.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: close the remaining audit findings across the gateway
Round four of the audit. Every item below has a regression test that
fails without its fix.
Correctness:
text_endthrough the turn's tool bridge,so the
[[OPENCODE_TOOL_CALL]]envelope no longer reachescontentnext to the parsedtool_callson any surface;reasoning_endon streamed/v1/chat/completions, which was the only surface without it;/v1/responsesstream, so a failed turn cannot leave a stickysession
busy: true;max_tool_calls,prompt_cache_keyandsafety_identifieron/v1/responsesinstead of stripping them;nullas unset for the optional Anthropic fields, matchingthe OpenAI surfaces;
best_of/suffixrejections on/v1/completions.Media:
open(), so aFIFO can no longer block the libuv threadpool;
wrapping;
file_datafrom shadowing a validfile_url;ENXIO/ENODEVtoinvalid_attachment.Upstream:
server passwordmarker cannot reach the log file in plaintext;failure paths;
fails;
stop()as a start failure;stop();message JSON in
deriveKey.HTTP, auth and configuration:
/metricsto the api bucket and add a global failed-authceiling behind a shared proxy address;
digests without short-circuiting;
trustProxyCIDR prefix of0;vary;Docs follow the behaviour change;
docs/VERIFICATION.mdno longerclaims a query-string key is a transport.