Gemini thinkingConfig API Parameter

type: capability

description: Production-ready API parameter in google-genai SDK v1.61.0 that enables explicit deep reasoning in Gemini 2.5 models. Requires include_thoughts=True to receive separate thought blocks. thinking_budget controls token allocation (0=disabled, -1=auto, 1-32768=explicit). Thought tokens billed separately as output tokens.


ThinkingConfig Full Schema

description: Complete field reference for google.genai.types.ThinkingConfig. Fields: thinking_budget (int, 0=off, -1=auto, 1-32768), include_thoughts (bool, must be True to get separate thought blocks), thinking_level (str enum: THINKING_LEVEL_UNSPECIFIED|LOW|MEDIUM|HIGH|MINIMAL — only supported on Pro models, returns 400 on Flash). usage_metadata.thoughts_token_count gives actual thought tokens consumed.

thinking_level_pro_support: unverified


Claude Extended Thinking

description: Extended thinking feature in Anthropic API. Two modes: adaptive (thinking.type=adaptive, Claude decides when/how much) and manual (thinking.type=enabled, budget_tokens=N). Adaptive mode is recommended for claude-sonnet-4-6 and claude-opus-4-6. Manual mode deprecated on Opus 4.6. Returns thinking blocks (summarized in Claude 4 models — you are billed for full tokens not summary). Minimum budget: 1024 tokens. Above 32K: use batch processing.


Claude Adaptive Thinking Mode

description: Recommended thinking mode for claude-sonnet-4-6 and claude-opus-4-6. Set thinking.type=adaptive, control depth with output_config.effort=[low|medium|high|max]. Effort=high (default) means Claude almost always thinks. Effort=max is Opus 4.6 only. Adaptive mode automatically enables interleaved thinking (Claude thinks between tool calls). No beta header required for interleaved in adaptive mode.

low: minimize thinking, skip on simple tasks

medium: moderate thinking, may skip trivial

high: almost always thinks, deep reasoning (default)

max: always thinks, no constraints (opus-4-6 only)

deprecated_alternative: type: enabled with budget_tokens


Claude Extended Thinking Cost Model

description: Billing rules for Claude extended thinking: (1) You are billed for FULL thinking tokens generated internally, NOT the summarized tokens you see in the response. (2) The billed output token count will NOT match the visible token count. (3) Input tokens exclude thinking tokens from previous turns. (4) Thinking blocks from last assistant turn in tool use loops count as input tokens when cached. (5) Changing budget_tokens invalidates message cache breakpoints but NOT system prompt cache.

cache_invalidation: changing budget_tokens breaks message cache, not system prompt cache


name: Claude Extended Thinking with Tool Use Pattern

description: When using extended thinking with tool use, thinking blocks MUST be preserved and returned verbatim to the API in subsequent calls. Failure to include thinking blocks causes API errors. Pattern: (1) Get response with thinking+tool_use blocks, (2) Execute tool, (3) Return [thinking_block, tool_use_block] as assistant content, (4) Add tool_result as user content. Entire tool use loop is considered one assistant turn — cannot toggle thinking mid-loop.


Sequential Thinking MCP

description: Custom Genesis MCP server implementing Chain-of-Thought reasoning as an explicit tool call. Connected and active in Genesis. Location: /mnt/e/genesis-system/mcp-servers/sequential-thinking/index.js. Binary: mcp-server-sequential-thinking via npm. Exposes ONE tool: sequential_thinking(thought, next_step, confidence, is_conclusion). Returns [THINKING]/[NEXT]/[CONFI] formatted response. Zero extra token cost beyond the tool call itself. Primary value: forces observable, logged, structured reasoning — each step is a traceable tool invocation.

thought: string required — current reasoning step

next_step: string required — what to do next

confidence: number required — 0.0 to 1.0

is_conclusion: boolean optional — is this the final answer

extra_cost: zero

config_key: sequential-thinking


name: Sequential Thinking MCP Genesis Use Cases

description: Five validated use cases for Sequential Thinking MCP in Genesis: (1) GHL automation planning — create logged step-by-step plan before Playwright executes (zero cost audit trail). (2) Gemini swarm decomposition — log task splitting reasoning before spawning agents. (3) Revenue/pricing decision gates — force explicit, auditable reasoning on commercial decisions. (4) Memory consolidation validation — confirm KG write quality before committing. (5) Production debug tracing — log each hypothesis with confidence score for root cause analysis.

pattern: call sequential_thinking BEFORE high-consequence actions to create observable reasoning trail


name: Genesis Reasoning Stack Decision Framework

description: Standard framework for selecting reasoning tools in Genesis. Tier 0 (free): Sequential Thinking MCP for planning/decision gates. Tier 1 (low cost): Gemini Flash + thinking_budget=2048 for fast analysis (~991 thought tokens, 10s). Tier 2 (medium): Gemini Flash + budget=8192 OR Claude Manual budget=4096 for architecture decisions (20-30s). Tier 3 (deep): Gemini Pro + budget=16384 OR Claude Adaptive effort=high for strategy/research (27-90s). Tier 4 (max): budget=32K, use batch processing, for flagship DT sessions.

sequential_thinking_mcp, zero cost

gemini_flash_budget_2048, ~7-10s

gemini_flash_budget_8192 or claude_manual_4096, 10-30s

gemini_pro_budget_16384 or claude_adaptive_high, 20-90s

budget_32k_batch, 2-10min


deep_think_bridge.py Known Bugs

description: Four bugs found in /mnt/e/genesis-system/scripts/deep_think_bridge.py: (1) Default model gemini-2.5-flash-thinking does not exist in current API. Use gemini-2.5-flash instead. (2) Raw dict generation_config does not propagate thinking_config to new genai API — must use genai.types.GenerateContentConfig(thinking_config=genai.types.ThinkingConfig(...)). (3) include_thoughts=True never set so thought blocks are never returned separately. (4) Thought block detection looks for [THINKING] text markers which Gemini no longer produces — must check part.thought attribute instead.

status: UNFIXED — documented for future remediation