feat: per-request metadata to disable thinking/reasoning#19
Merged
Conversation
Let users attach a metadata object to every LLM request (the OpenAI
"metadata" field), passed verbatim to the backend. Backends such as
LocalAI use it for per-request flags, e.g. {"enable_thinking": "false"}
to disable a reasoning model's thinking.
- Config.Metadata (global) and AgentTypeConfig.Metadata (per-agent).
- Main session sends Config.Metadata; sub-agents merge global + per-agent
via mergeMetadata (per key: agent wins, global-only keys inherited).
- e2e tests assert metadata reaches the wire; README documents both.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Adds an option to attach a metadata object to every LLM request (the OpenAI
metadatafield), passed verbatim to the backend. Backends such as LocalAI use it for per-request flags — e.g.{"enable_thinking": "false"}to disable a reasoning model's thinking.Changes
Config.Metadata(global) andAgentTypeConfig.Metadata(per-agent).Config.Metadata; sub-agents merge global + per-agent viamergeMetadata(per key: agent wins, global-only keys inherited; inputs never mutated).github.com/mudler/cogitoto the release carrying the metadata passthrough (feat(client): per-request metadata passthrough (disable thinking/reasoning) cogito#56).Tests
mergeMetadataunit tests (merge precedence + no-mutation).chat.Sessionagainst a fake OpenAI server: metadata reaches the wire, and nometadatais sent when unconfigured.🤖 Generated with Claude Code