Repository navigation
fix(workbuddy): adapt gateway compliance headers and tool schema contracts (#16978) - #17046
Merged
diegosouzapw merged 2 commits intoOct 18, 2026
Conversation
fitSchema, fitEnum, fitShape and fitTools exceeded the cognitive-complexity ratchet (20/24/41/42 > 15), pushing the repo past its 1437 baseline. Extract per-concern helpers with identical behavior (differential fuzz against the original: 60,000 random schemas/tool bodies, byte-identical results and change flags). Drop the unused randomUUID import, type the test's any casts and cover fitSchema/fitShape directly.
diegosouzapw
merged commit Oct 18, 2026
edc79d9
into
cheaper-inference:release/v3.8.52
8 checks passed
diegosouzapw
added a commit
that referenced
this pull request
Oct 18, 2026
…te-path golden #17046 (gateway compliance for WorkBuddy, #16978) deliberately changed the headers the WorkBuddy executor sends: User-Agent WorkBuddy/5.5.6, the X-Agent-* and X-IDE-* set, X-Domain and X-Requested-With. It shipped its own test but did not regenerate tests/snapshots/provider/translate-path.json, so provider-translate-path-golden has been red on the release branch since it merged (19:03Z). Regenerated with UPDATE_GOLDEN=1: the only provider entry that changed is "workbuddy" (apiKey, nonStream and oauth header blocks). The golden and workbuddy-gateway-compliance suites pass together (12/12). Refs #15306
diegosouzapw
added a commit
that referenced
this pull request
Oct 18, 2026
…stry test #17046 (#16978) placed four gateway-compliance rewrites ahead of the generic Codex/OpenAI pairs in the WorkBuddy registry entry: the Anthropic billing header is dropped, and the Claude Code and Codex CLI identity sentences are reworded. It did not touch workbuddy-provider.test.ts, whose bodyStringReplacements assertion still listed only the four old pairs, so the suite has been red on the release branch since 19:03Z. The assertion now pins all eight pairs in order: the long Codex sentence must be rewritten whole before the generic "Codex CLI" / "OpenAI" pairs touch it. workbuddy-provider + workbuddy-gateway-compliance + provider-translate-path golden: 40/40. Refs #15306
diegosouzapw
added a commit
that referenced
this pull request
Oct 18, 2026
…and two WorkBuddy contracts left by #17046 (#17102) * test(quota): time the shared throttle, not the first fetch's start-up (#6911) Since #15885 every quota fetcher calls fetchWithConnectionProxy() between the throttle's acquire() and the upstream fetch. The first call of the process pays one-time costs inside that window: it lazily imports the proxy transport and the error helpers, then imports the DB settings module and opens SQLite with every migration to look up the connection's proxy (first lookup measured at ~4.9 s, the next ones 6-12 ms). The second call, released 200 ms later, waits on the same imports, so both fetches left together (spread 20-50 ms) and the first test of the file, DeepSeek, failed whatever the throttle did. The suite now answers the proxy lookup through the documented connectionProxyTestOverride (as the proxy suites do) and pays the lazy imports once in test.before, so the spread it measures is the throttle's again. The assertions are unchanged; removing `await throttleQuotaFetch()` from the DeepSeek fetcher still fails the suite (spread 3 ms). Refs #15306 * test(providers): record WorkBuddy's compliance headers in the translate-path golden #17046 (gateway compliance for WorkBuddy, #16978) deliberately changed the headers the WorkBuddy executor sends: User-Agent WorkBuddy/5.5.6, the X-Agent-* and X-IDE-* set, X-Domain and X-Requested-With. It shipped its own test but did not regenerate tests/snapshots/provider/translate-path.json, so provider-translate-path-golden has been red on the release branch since it merged (19:03Z). Regenerated with UPDATE_GOLDEN=1: the only provider entry that changed is "workbuddy" (apiKey, nonStream and oauth header blocks). The golden and workbuddy-gateway-compliance suites pass together (12/12). Refs #15306 * test(providers): pin WorkBuddy's compliance body rewrites in the registry test #17046 (#16978) placed four gateway-compliance rewrites ahead of the generic Codex/OpenAI pairs in the WorkBuddy registry entry: the Anthropic billing header is dropped, and the Claude Code and Codex CLI identity sentences are reworded. It did not touch workbuddy-provider.test.ts, whose bodyStringReplacements assertion still listed only the four old pairs, so the suite has been red on the release branch since 19:03Z. The assertion now pins all eight pairs in order: the long Codex sentence must be rewritten whole before the generic "Codex CLI" / "OpenAI" pairs touch it. workbuddy-provider + workbuddy-gateway-compliance + provider-translate-path golden: 40/40. Refs #15306
diegosouzapw
added a commit
that referenced
this pull request
Oct 18, 2026
… registry entry "workbuddy registry entry › declares the replayed-history flags and the streaming requirement" pinned the original four bodyStringReplacements; #17046 prepended the billing-header line, the Claude Code self-description, the branch hint and the Codex project blurb. The fixture now lists the eight pairs the registry ships, in order. Same root cause as the golden in this PR.
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.
Summary
Adapt WorkBuddy AI reverse-proxy gateway compliance by porting battle-tested headers, tool schema contracts, and turn order alignment from Magpie to resolve error codes 10085, 11101, 11128, 11133, and 11153 (#16978).
Changes
Fixes #16978.