Repository navigation
Conversation
httpPost() attached diagnostic metadata to the same object it later serialized, so every request body carried a __meta property holding a second copy of the system and user prompts. Strict OpenAI-compatible providers reject unknown top-level properties (Groq: "property '__meta' is unsupported"). - copy the payload before attaching __meta so Show Last Payload keeps working - route fetch and curl bodies through toRequestBody(), which strips __meta - add node:test coverage for the serializer and a tripwire against regressions Fixes kargnas#17
Groq's on-demand tier caps input tokens per minute, so the default context budget can be rejected even when the request body is valid. Point users at the settings that shrink the prompt.
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.
Problem
httpPost()attached its diagnostic metadata to the same object it later serialized:Both transports then sent that object, so every request body carried a
__metaproperty containing a second copy of the system and user prompts. OpenRouter's gateway does not reject unknown top-level fields, so this went unnoticed; strict OpenAI-compatible endpoints do. Groq returns:{ "error": { "message": "property '__meta' is unsupported", "type": "invalid_request_error" } }Fixes #17
Fix
lastPayloadis now a shallow copy, so "Show Last Payload" keeps the prompts while the request payload stays clean.lib/serialize.jsaddstoRequestBody(), which strips__metabefore serialization. Both transports (fetch and curl) use it, so a future diagnostic field cannot leak back onto the wire.Tests
npm test(node:test) covers:__metais stripped and the remaining fields are preserved verbatim__metaserialize unchangedextension.jsregainslastPayload.__meta =orJSON.stringify(payload), or loses eithertoRequestBody(payload)call siteVerification
npm ci && npm test→ 5/5 passnpx @vscode/vsce package→ packages cleanly;lib/included,test/excludedhttpPostfrom the built extension and drove both transports against a local echo server: wire body keys are exactlymodel,messages,temperature,response_format, with no__meta, while "Show Last Payload" still renders__meta.promptsNo version bump: the release workflow handles that on merge.
Docs
Adds a
Troubleshootingentry forHTTP 413provider token-budget failures, with the settings that shrink the prompt.