fix(mcp): raise output_schema_hint_bytes default to 1024 and fix stub event name#3106
Merged
fix(mcp): raise output_schema_hint_bytes default to 1024 and fix stub event name#3106
Conversation
… event name The 512-byte default caused stub fallback for most real-world MCP tool schemas, making forward_output_schema largely ineffective at default config. Raised default to 1024 in zeph-config and both LLM backend struct defaults. The WARN emitted on the budget-exceeded path used event="mcp.output_schema.forwarded_to_llm", implying the real schema was forwarded when only a stub was sent. Changed to event="mcp.output_schema.stub_used" in openai and claude backends so operators can distinguish the two paths in telemetry and log search. Added 6 unit tests: default value assertion in zeph-config, boundary tests for schema-fits vs stub path in openai and claude. Closes #3084, #3087
dcd0133 to
92a0e97
Compare
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
output_schema_hint_bytesdefault from 512 → 1024 bytes, fixing silent stub fallback for most real-world MCP tool schemas whenforward_output_schema = true(fix(mcp): default output_schema_hint_bytes=512 too small — most real-world MCP tool schemas use stub fallback #3084)mcp.output_schema.forwarded_to_llmtomcp.output_schema.stub_usedin openai and claude backends, making telemetry unambiguous (fix(mcp): output_schema WARN emits event=mcp.output_schema.forwarded_to_llm when stub is used, not schema #3087)Files changed
crates/zeph-config/src/channels.rs—default_output_schema_hint_bytes()512 → 1024, doc comment updatedcrates/zeph-llm/src/openai/mod.rs— struct default + event name fixcrates/zeph-llm/src/openai/tests.rs— 2 new boundary testscrates/zeph-llm/src/claude/mod.rs— struct default + event name fixcrates/zeph-llm/src/claude/tests.rs— 2 new boundary testsTest plan
cargo nextest run --config-file .github/nextest.toml --workspace --lib --bins— 8177 tests passcargo +nightly fmt --check— cleancargo clippy --workspace --lib --bins -- -D warnings— cleanevent="mcp.output_schema.stub_used"in WARN log with Todoist MCP connectedCloses #3084, #3087