Skip to content

fix: Aug 18-19 review hardening — five max-effort rounds across tools, chat, and flash - #413

Merged
rejojer merged 1 commit into
mainfrom
port/v0210-dev6
Aug 19, 2026
Merged

fix: Aug 18-19 review hardening — five max-effort rounds across tools, chat, and flash#413
rejojer merged 1 commit into
mainfrom
port/v0210-dev6

Conversation

@rejojer

@rejojer rejojer commented Aug 19, 2026

Copy link
Copy Markdown
Member

Squash-port of feat/local-chat's post-dev5 wave (03ffab3..49a24e1) for the v0.2.10.dev6 cut — five review rounds of reproduced-then-fixed findings across the tool layer, chat lanes, and flash.

Highlights: standalone agent_instructions back on the strict shadow check; caller-owned http_client survives per-call closes; get_tree keeps key_items under the flash merge default; OpenAI-protocol classification follows litellm's own routing; thinking-aware max_tokens default on messages() and anthropic_runner_config(thinking=); 401/403 re-raise instead of retry-coaching envelopes; cloud discovery + instructions ride the ?tools=read endpoint matching the tool gate (live-verified); chat-lane litellm resolution deduplicated into utils._litellm_model; explicit optimize= wins over deprecated optimize_expand; mcp 2.0 compatibility; .env-independent test suite.

Tree verified byte-identical to feat/local-chat (git diff port/v0210-dev6 feat/local-chat empty). Review record and per-finding rationale live in #400 and the ported commit messages.

…, 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.
Comment thread pageindex/client.py
global _litellm_preload_started
if _litellm_preload_started:
return
_litellm_preload_started = True
Comment thread tests/test_agent_tools.py
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
Comment thread tests/test_agent_tools.py
assert cloud.submit_document("x.pdf", wait=True) == {"doc_id": "pi-fake"}


import pageindex.utils # noqa: F401 — its import loads .env
Comment thread tests/test_agent_tools.py
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
Comment thread pageindex/client.py
def _import() -> None:
try:
import litellm # noqa: F401
except Exception:
@rejojer
rejojer merged commit ba0ef02 into main Aug 19, 2026
8 checks passed
@rejojer
rejojer deleted the port/v0210-dev6 branch August 19, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant