mirror of
https://github.com/NikkeTryHard/zerogravity.git
synced 2026-04-25 15:15:59 +03:00
[GH-ISSUE #23] [BUG] MITM custom tool injection can omit tools[].custom.input_schema (400 INVALID_ARGUMENT) #20
Labels
No labels
bug
enhancement
enhancement
notice
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/zerogravity#20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DarKWinGTM on GitHub (Feb 19, 2026).
Original GitHub issue: https://github.com/NikkeTryHard/zerogravity/issues/23
Summary
During
/v1/messagesprocessing, the MITM rewrite path injects custom tools but can send an invalid tool definition to upstream.Upstream rejects the request with:
HTTP 400 INVALID_ARGUMENTtools.0.custom.input_schema: Field requiredThis breaks tool-enabled requests even when token/auth is otherwise valid.
Observed error
Correlated log lines just before the failure:
Why this is a bug
tools[].custom.input_schemais required by upstream validation. If MITM injects custom tools, each injected custom tool must include a validinput_schema.Current behavior indicates injected tool payload can be incomplete.
Impact
/v1/messagesrequests fail hard with 400Repro (high level)
/v1/messagesrequest that triggers custom tool injectiontools.0.custom.input_schema: Field requiredExpected behavior
input_schemaInfo Diagram
Suggested fix direction
customtool exists, enforce presence + shape ofinput_schema@NikkeTryHard commented on GitHub (Feb 19, 2026):
v1.1.6-beta.1 includes fixes to the MITM tool injection pipeline (thought_signature persistence, parallel call recording, and cache cleanup). While this issue is specifically about missing
input_schema, the fixes touch the same MITM modify/proxy paths that handle tool injection.Please test with the beta to see if this is resolved:
Binary:
Docker:
If the issue persists after testing, please share the full trace (
zg trace) so we can see the exact payload being sent upstream.@DarKWinGTM commented on GitHub (Feb 19, 2026):
Update after retesting on
v1.1.6-beta.1withzg trace(as requested). I converted the evidence into redacted text/JSON and inlined it here (no binary attachment).Environment (redacted)
zerogravityzerogravity:1.1.6-beta.1-locald89bfeb2ae205247dd2148cc5631c86349b8c4592b408d868508fad1db5999c7 /usr/local/bin/zerogravitye0826647d237bd22726582f8fcb43fcf3fd5512de4b2768e9b68581b27936c33 /usr/local/bin/zgv1.1.6-beta.1x86_64 release checksums.1)
zg trace ls(latest window)2)
zg trace(latest failing trace)3)
zg trace errors(multiple repeated failures)4) Runtime log evidence (
/tmp/zerogravity-issue23.log)This 400 pattern repeats across many cascades (
144be912,d32da2fd,9b9d5100,b175b8c2,245cc37f,d29bcfde,94aa2a67,6e745e3f,98eddbc6,01d1bc9a, etc.).5) Redacted payload evidence (schema omitted)
Trace
18-56-48.611_fc0575fdTrace
18-57-54.479_01d1bc9aConclusion
Issue is still reproducible on
v1.1.6-beta.1in my environment.The traces consistently show injected tool declarations with no schema (
param_count: 0) and upstream rejects withtools.0.custom.input_schema: Field required.I kept this update fully text-based and redacted (no full raw trace bundle) to avoid leaking local/private context.
@NikkeTryHard commented on GitHub (Feb 19, 2026):
hold on im porting litellm logic which might be able to solve this in v1.1.6 hopefully
@DarKWinGTM commented on GitHub (Feb 19, 2026):
Update: retested with stable
v1.1.6release binaries. Core endpoints are healthy, but inference endpoints still hang/time out.Environment / Version Proof
2026-02-19T21:21:52Zzerogravityzerogravity:1.1.6-localsha256:78d0b9a5b6b944588b4423fd493c05f71fd5fd0537e520bc83601aaca0464a2aIn-container binary checksums:
dfff1e49dc03b1a5a52ed213e77eee1ef83e65e8c89a20e8912bd2c3dd7506cf /usr/local/bin/zerogravity70ffbca23987f114fa4c361c36a2c47db6ccb127cb4edcf42abe12b9b344f526 /usr/local/bin/zgThese match the published
v1.1.6x86_64 checksums:zerogravity-linux-x86_64:dfff1e49...7506cfzg-linux-x86_64:70ffbca2...44f526Direct Endpoint Tests (host ->
http://127.0.0.1:8741)Observed behavior:
/healthand/v1/modelsreturn immediately./v1/messagesand/v1/chat/completionsconsistently block until client timeout.Runtime Logs (excerpt)
During timeout tests, daemon receives requests and registers cascades, but no completion payload is returned to client:
Also seen repeatedly at startup:
Trace Commands Output (important)
Despite inference timeout reproductions, trace commands currently return empty:
So for this
v1.1.6run, I cannot provide non-empty trace artifacts; only daemon logs and direct endpoint timing are available.Summary
v1.1.6binaries are confirmed by checksum./health,/v1/modelsOK)./v1/messages,/v1/chat/completions) still hang and time out.zg trace*outputs are empty in this run, even while timeouts are reproducible.If you want, I can run another pass with a longer capture window and attach full raw log slices for the exact timeout intervals.
@NikkeTryHard commented on GitHub (Feb 19, 2026):
v1.1.6 stable version just released test again should be fixed
@DarKWinGTM commented on GitHub (Feb 20, 2026):
✅ Update: production-like test now works on stable
v1.1.6in my environmentThis is a real re-test after the latest local update flow (including cookie-derived token sync into
/v1/token).Environment / Build proof
2026-02-20T00:07:14Zzerogravity(running)zerogravity:1.1.6-localUpBinary checksums (inside container):
zerogravity:cbbfa6799bff10f1863fdb42c3f16009e5559ac5ff217a712eb899fd830d01b6zg:70ffbca23987f114fa4c361c36a2c47db6ccb127cb4edcf42abe12b9b344f526These match current published
v1.1.6x86_64 artifacts.Direct endpoint validation (
http://127.0.0.1:8741)GET /health→200(~0.00s)GET /v1/models→200(~0.00s)GET /v1/quota→200(~0.00s, non-empty quota payload)POST /v1/messages(model=opus-4.6,stream=false) →200(~6.53s), response containsthinking: ok+text: okPOST /v1/chat/completions(model=gemini-3-flash,stream=false) →200(~1.94s), contentokTrace status
zg trace lsnow shows successful outcomes (today):POST /v1/messages→end_turn(multiple)POST /v1/chat/completions→completedzg trace errors:No error traces today.Current conclusion
For this latest run, the previously reported failures (hang/timeout, upstream 401,
tools.0.custom.input_schema) are not reproduced.System is currently usable in real flow on my side.
I’ll continue monitoring and will report back if regression appears again.