Skip to content

workbuddy: omit unsupported REA surrogate guard from tool schemas - #1080

Merged
yetone merged 1 commit into
magpie-community:mainfrom
zhbcn:fix/workbuddy-rea-surrogate-pattern
Nov 13, 2026
Merged

yetone merged 1 commit into
magpie-community:mainfrom
zhbcn:fix/workbuddy-rea-surrogate-pattern

Conversation

@zhbcn

@zhbcn zhbcn commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

WorkBuddy AI's deepseek-v4.1-flash-sg rejects a fresh DeepSeek Harness request with 400: WorkBuddy AI: invalid function call parameters when the advertised tools include REA's exact ^[^\uD800-\uDFFF]*$ path guard. This fails before generation, even when the user does not call a tool.

Omit only this exact pattern in the existing recursive outbound schema normalization. Keep the surrounding allOf, NUL/absolute-path constraints, other patterns, and the tool server's own validation. Add regressions covering nested properties, array items and $defs, unchanged source input, idempotence, and preservation of other surrogate patterns. Bump WorkBuddy to 0.2.34.

Validation:

  • Before the fix, the new REA guard regression fails; after the fix, all 378 WorkBuddy tests pass on Windows with Bun 1.4.4 and an isolated temporary home.
  • bun scripts/check.mjs workbuddy and git diff --check pass.
  • Live gateway isolation: no tools and 44 non-REA tools succeed; REA's binary_session alone fails. Its NUL and absolute-path patterns each succeed individually; the surrogate guard alone reproduces the 400.
  • Applying this patch's fitted() to the original 299-tool catalog removes 15 guards across 14 tools: the same WorkBuddy AI DeepSeek route returns HTTP 200, both for a short reply and a valid binary_session({detail: "summary"}) tool call. No returned tool call was executed.

This addresses schema rejection. It does not claim to fix the separate GLM incident where generated tool arguments repeated until the output token limit.

@zhbcn
zhbcn force-pushed the fix/workbuddy-rea-surrogate-pattern branch from ebf4e93 to 2f4738e Compare November 13, 2026 07:22
@yetone

yetone commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Thanks @zhbcn, this is small and well scoped. Reviewed at 2f4738e:

  • Ran the workbuddy package on Linux (Bun 1.4.2, temp HOME): 378 pass. bun scripts/check.mjs workbuddy ok.
  • Broke it by hand: with the new if turned off, "REA's surrogate guard is omitted…" goes red, so the test guards the change.
  • The match is the exact pattern string, so a mixed class like ^[^\u0000\uD800-\uDFFF]*$ and the literal-escape form are left alone, and fitSchema copies before changing, so the caller's tools aren't mutated. Both are covered.

One note, no change needed: this applies to every WorkBuddy model, not only DeepSeek. That's fine, since the guard only rules out lone surrogates in a path, and REA still checks it server-side.

I'll merge it on the next pass (we don't merge in the same pass as a push).

@yetone
yetone merged commit d6dcb6e into magpie-community:main Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants