Repository navigation
feat!: replace OpenRouter with OpenAI Responses - #217
Merged
Merged
Conversation
- Add an ADK model adapter over OpenAI's Responses API - Store raw output items on ADK parts and replay them unchanged - Always send store=false; keep encrypted reasoning in sessions - Retry once without reasoning when OpenAI rejects it - Add a static GPT-6 catalog for /model, /thinking and pricing - Record estimated costs from catalog prices in the ledger - Use a text-only compaction summarizer at low effort - Keep commentary out of replies and secrets out of logs - Remove the OpenRouter adapter, settings and deploy secret - Add the OpenSpec change with specs, design and tasks BREAKING CHANGE: OPENAI_API_KEY replaces OPENROUTER_API_KEY and ROOT_AGENT_MODEL takes OpenAI model ids such as gpt-6.1-terra. Legacy openrouter/openai/<id> values are still accepted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks
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
Blacki now calls OpenAI's Responses API directly, through its own ADK adapter, and OpenRouter is removed. Each model output item (reasoning, message, function call) is stored on its ADK part and sent back unchanged to the same model. Encrypted reasoning therefore carries across tool calls and survives restarts. Every request sets
store: false.Why
OpenAIResponsesLlmdrops reasoning on replay (OpenAIResponsesLlm drops reasoning items between tool calls (never replayed or chained) google/adk-python#8110) and would need an ADK upgrade from 2.5.0.The plan is in
openspec/changes/replace-openrouter-with-openai-responses/. A subagent reviewed it before implementation, and its findings are included.How
models/openai_responses.py, withopenai_request.pyandopenai_response.pyfor translation andopenai_items.pyfor the stored-item contract. It handles streaming and non-streaming calls.models/catalog.pylistsgpt-6-luna,gpt-6.1-terra,gpt-6.1-solandgpt-6-astra, with prices read from OpenAI's model pages./modeland/thinkinguse it, and legacyopenrouter/openai/<id>values are still accepted.cost_kind=estimate,cost_source=catalog_price).Tests
uv run ruff format: 270 files left unchangeduv run ruff check: all checks passeduv run mypy .: no issues in 270 source filesuv run pytest --cov=src: 2887 passed, 1 skipped, 100.00% coverageuv run --group docs mkdocs build --strict: built with no warningsactionlintondocker-publish.ymlopenspec validate --stricton the changepart_metadatapersistence in SQLite, andadk-id clearinggpt-6.1-terraat efforthigh, through the real factory, streaming andDatabaseSessionService. Each request after the first replayed the earlier reasoning items before their function calls, including after a simulated restart. Answers were correct, and there was one estimated ledger row per call (5 calls).Breaking Changes
OPENAI_API_KEYreplacesOPENROUTER_API_KEY.ROOT_AGENT_MODELtakes a catalog id.openrouter/openai/<id>is still accepted; any otheropenrouter/...value fails at startup.OPENAI_API_KEYGitHub Actions secret before deploying.Related Issues
🤖 Generated with Claude Code