Repository navigation
Conversation
Honor allow_fetch=False for context-window and output-ceiling metadata, including a loaded LiteLLM whose SDK can query provider endpoints. Keep cached rows and explicitly allowed SDK lookups available. Cover cache misses, aliases, model options, and ACP session creation at EOF. Co-authored-by: Codex <noreply@openai.com>
gloryfromca
left a comment
There was a problem hiding this comment.
No blockers; this can merge as far as I am concerned.
Reviewed the full github/main...HEAD diff and the surrounding resolver, candidate-alias, OpenRouter-cache, model-picker, binding, and ACP call paths, plus the relevant history. The new policy gate prevents litellm.get_model_info from running when allow_fetch=False while preserving already-loaded static rows, cached OpenRouter rows, and the existing fetch-enabled default. The optional parameters preserve compatibility, and the tests add coverage without weakening existing assertions.
I also checked the repository rules in AGENTS.md/CLAUDE.md, the domain-term routing in CONTEXT-MAP.md, test naming, source language/comments, and the provider/RPC architecture constraints; I found no violations.
Verification: uv run pytest -n 0 tests/test_provider_rates.py tests/test_rpc_model.py tests/test_acp_server.py tests/test_acp_methods.py tests/test_acp_config_options.py tests/test_agent_loop_lazy_provider.py tests/test_lazy_provider.py tests/test_token_wise_pricing.py tests/test_rpc_session_init_bundle.py -q --tb=short passed (602 tests); uv run ty check raven/providers/rates.py and git diff --check github/main...HEAD also passed. An initial run in the newly created base environment failed during autouse setup because the optional workspace package raven_everos was absent; after the declared dev extra was synced, the three modified suites passed 358/358 and the broader run above passed.
|
No blockers in the reviewed scope. Scope: I reviewed the full PR diff (4 changed files), including tests and documentation, and traced affected callers and contracts at Checked both context-window and output-ceiling entry points, loaded-table aliases, SDK lookup refusal when allow_fetch=False, cached OpenRouter fallback, fetch-enabled compatibility, model-picker and binding callers, lazy providers, and ACP session/config-option paths. The no-fetch flag reaches both LiteLLM import policy and SDK metadata policy. Verification (native Windows, Python 3.12, isolated source snapshots; local JUnit-output options omitted below):
The local combined tree with #908 also passed
|
|
Windows compatibility review: no new issue found in the inspected scope. Reviewed head Native Windows / Python 3.13.12, detached temporary checkout with uv run pytest tests/test_provider_rates.py tests/test_rpc_model.py tests/test_acp_server.py -n 0 -x --tb=short --basetemp "$reviewRunDir/pr909/tests"Result: 358 passed. The ACP frame-loop test uses in-memory streams; it does not validate native inherited stdin or the separate Windows stdin repair. No live provider/Ollama service or full suite was run. This scoped result does not establish full Windows compatibility. |
Summary
Creating an ACP session or opening the model picker could query LiteLLM's provider metadata API even with
allow_fetch=False. Unknown Ollama models could blocksession/newbeyond the EOF cleanup grace period and drop its reply.get_model_infowhen fetching is disabled.model.optionshandling, and all three ACP handshake replies after EOF.Windows stdio validation uses the stdin fix from #908 in an isolated source snapshot. This PR carries only the metadata fix and its regression tests.
Type
Verification
Native Windows, Python 3.13.12: 602 relevant tests passed.
Before the fix, 12 new regression cases failed while both allowed-fetch controls passed. Removing only the output guard produced 5 failures; removing only the context-window guard produced 7 failures, including the RPC and ACP cases. Source was restored after each mutation.
Native stdio smoke: 6 passed, including the complete handshake, with
PYTHONPATHpointing at an isolated copy of this change plusraven/cli/acp_commands.pyfrom #908.A direct Windows smoke run on the branch alone remains blocked by the inherited
WinError 6stdin transport failure, reproduced before this fix. The combined run above verifies the two fixes together. No LLM calls or real Ollama service were used.The following checks passed; all 10 import contracts were kept.
No user-facing documentation update is needed: configuration and protocol contracts are unchanged. Resolver docstrings document the enforced lookup policy.
Risk
When every local source misses, callers requesting local metadata retain the existing unknown-value or configured-default behavior. A self-hosted model can set
agents.defaults.contextWindowTokensexplicitly. Fetch-enabled lookup behavior is preserved. Roll back by reverting this change.Related Issues
#908 (Windows stdin fix used for combined stdio validation).