Skip to content

fix: the slots accept any Mapping at runtime; eight docstrings stop calling cloud tool scoping server-side - #429

Merged
rejojer merged 1 commit into
mainfrom
fix/client-config-followups
Aug 26, 2026
Merged

fix: the slots accept any Mapping at runtime; eight docstrings stop calling cloud tool scoping server-side#429
rejojer merged 1 commit into
mainfrom
fix/client-config-followups

Conversation

@rejojer

@rejojer rejojer commented Aug 26, 2026

Copy link
Copy Markdown
Member

Follow-ups to #424 / #428, from the round-10 review of #427.

  • index= / chat= were widened to Mapping[str, Any] in 4e9c56c so the exported TypedDicts pass a checker, but _resolve_index_slot / _resolve_chat_slot still dispatched on isinstance(..., dict) — a MappingProxyType or ChainMap was pyright-clean and raised "must be a string or a dict" at construction. They now narrow on Mapping; the existing comprehension already copies, so a read-only proxy proves the caller's mapping is never mutated (test_slots_take_any_mapping, red on the previous head).
  • The eight remaining "scoping is server-side" docstrings (four as_*, three *_agent_config, _tool_specs) said the same untrue thing about doc_id on cloud that 4e9c56c corrected at three sites — cloud tools carry no allowlist, targeting is prompt-level. Deleted rather than reworded; the runtime error already explains it.
  • local_chat.py's module docstring predates own-model chat over the cloud bridge; storage_path's prose now names the os.PathLike that 5e2dc9b typed.

435 tests green (434 + 1); pyright on the three touched files unchanged; the without-frameworks leg simulated locally on the new test.

https://claude.ai/code/session_01VQ6mruXZBgw9Hjii8KPbQP

…its; eight docstrings stop calling cloud tool scoping server-side

4e9c56c widened index=/chat= to Mapping[str, Any] so the exported
TypedDicts pass a checker, but _resolve_index_slot/_resolve_chat_slot
still dispatched on isinstance(..., dict): a MappingProxyType or ChainMap
was pyright-clean and raised "must be a string or a dict" at construction.
The resolvers now narrow on Mapping — the comprehension already copies,
so a read-only proxy proves the caller's mapping is never mutated.

4e9c56c corrected three of eleven "scoping is server-side" sites; the
remaining eight said the same untrue thing about doc_id on cloud (its
tools carry no allowlist — targeting is prompt-level, as the runtime
error already explains). Deleted rather than reworded.

local_chat.py's module docstring predates own-model chat over the cloud
bridge; storage_path's prose now names the PathLike 5e2dc9b typed.

Claude-Session: https://claude.ai/code/session_01VQ6mruXZBgw9Hjii8KPbQP
@rejojer
rejojer merged commit 174f95f into main Aug 26, 2026
14 checks passed
rejojer added a commit that referenced this pull request Aug 26, 2026
Two post-0.2.11 follow-up squashes (b9a9a3b, 174f95f) land on the review
branch the same way f6fa99b did: main's tree recorded as merged, history
kept, so PR #400 keeps spanning 0.2.9 → current main.

Claude-Session: https://claude.ai/code/session_01VQ6mruXZBgw9Hjii8KPbQP
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