fix: Aug 18-19 review hardening — five max-effort rounds across tools, chat, and flash - #413
Merged
Conversation
…, chat, and flash Squash-port of feat/local-chat's post-dev5 wave (03ffab3..49a24e1): five review rounds of reproduced-then-fixed findings. Highlights: standalone agent_instructions back on the strict shadow check (the *_agent_config bundles keep the relaxed in-set check they can prove); caller-owned http_client survives the per-call backend closes; get_tree keeps key_items under the flash merge default; OpenAI-protocol classification follows litellm's own routing (azure/openrouter/deepseek/groq/xai); thinking-aware max_tokens default shared by messages() and anthropic_runner_config(thinking=); 401/403 re-raise instead of retry-coaching envelopes, bridge errors carry status_code; cloud discovery + instructions ride the ?tools=read endpoint matching the tool gate (live-verified); the chat lane's litellm model resolution deduplicated into utils._litellm_model; explicit optimize= wins over the deprecated optimize_expand (DeprecationWarning added); mcp 2.0 compatibility; spawn-worker and doc-scope guard fixes; the suite is .env-independent and pins the LitellmModel._fetch_response seam. Per-finding rationale in the ported commit messages on feat/local-chat.
| global _litellm_preload_started | ||
| if _litellm_preload_started: | ||
| return | ||
| _litellm_preload_started = True |
| def test_cloud_bridge_rebuilds_on_credential_change(monkeypatch): | ||
| """CloudAPI re-reads client.api_key on every REST call; the MCP half | ||
| must not keep authenticating with a rotation-stale snapshot.""" | ||
| import pageindex.mcp_bridge as mcp_bridge |
| assert cloud.submit_document("x.pdf", wait=True) == {"doc_id": "pi-fake"} | ||
|
|
||
|
|
||
| import pageindex.utils # noqa: F401 — its import loads .env |
| process, outside our completion helpers — the py3.10 type repair must | ||
| run at config time, and only for LiteLLM-routed models.""" | ||
| pytest.importorskip("agents") | ||
| import pageindex.utils |
| def _import() -> None: | ||
| try: | ||
| import litellm # noqa: F401 | ||
| except Exception: |
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.
Squash-port of feat/local-chat's post-dev5 wave (03ffab3..49a24e1) for the
v0.2.10.dev6cut — five review rounds of reproduced-then-fixed findings across the tool layer, chat lanes, and flash.Highlights: standalone
agent_instructionsback on the strict shadow check; caller-ownedhttp_clientsurvives per-call closes;get_treekeepskey_itemsunder the flash merge default; OpenAI-protocol classification follows litellm's own routing; thinking-awaremax_tokensdefault onmessages()andanthropic_runner_config(thinking=); 401/403 re-raise instead of retry-coaching envelopes; cloud discovery + instructions ride the?tools=readendpoint matching the tool gate (live-verified); chat-lane litellm resolution deduplicated intoutils._litellm_model; explicitoptimize=wins over deprecatedoptimize_expand; mcp 2.0 compatibility;.env-independent test suite.Tree verified byte-identical to feat/local-chat (
git diff port/v0210-dev6 feat/local-chatempty). Review record and per-finding rationale live in #400 and the ported commit messages.