Skip to content

An older bus never breaks a newer client: CoreAccess.serves, OptionalRead, a typed unexposed refusal - #4890

Merged
trissim merged 2 commits into
mainfrom
client-serves-tools
Nov 18, 2026
Merged

trissim merged 2 commits into
mainfrom
client-serves-tools

Conversation

@trissim

@trissim trissim commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

What broke

On 2026-11-18, Tristan's phone (runtime 11a019b19) was connected to the laptop's bus (runtime a73a3a12e, which predates message files). Every history page failed with:

RelationViolationError: The connector exposes no tool 'comms_message_files'.

Each page read asks for its messages' files (CommsMessageFilesTool, added in #4889). The older connector refused that call with an untyped ToolRefusedError, which the client could only decode as a generic refusal by its text.

Change

  • CoreAccess.serves(request_type): one way to ask whether a Core answers a request.
    • LocalCoreAccess serves every request it declares.
    • RemoteCoreAccess lists its connector's tools once per connection with tools/list, on the same kept connection. exchange and the list share one round_trip. A dropped connection may mean a restarted connector, so the list is read again next time.
  • OptionalRead (a ReadRequest) is a read its caller can do without. It declares absent(), which posted returns instead of sending when the Core doesn't serve the read.
    • CommsMessageFilesTool is one, with absent() = no files.
    • The per-file read (comms_message_file) stays required: it only runs from a chip the files list put on screen.
  • UnexposedToolError(ToolRefusedError, RelationViolationError) with its wire member CoreError "unexposed".
    • The connector refuses an unexposed tool with it.
    • It is still a RelationViolationError, so every existing handler keeps catching it (same shape as GoalRefused).
    • An OptionalRead that meets it because its tool list was stale returns absent() and lists the tools again.

Audit of other recent tools. Tools added since Oct 28 that toad calls: comms_owner_goal, comms_transcript_page, comms_input_delivery. All three predate every runtime any bus in the fleet runs, and none is read on every page. A lagging bus today lacks only the two file tools.

Tests (tests/test_connector.py)

These run the real connector application through a real RemoteCoreAccess; its kept connection forwards each request to the test server. Results with PYTHONPATH=src: 4 passed.

  • Older connector (the file tools removed from the caller's exposed set): the read is never posted, tools/list is the only request, and the read returns no files.
  • Current connector: the read is posted and answered.
  • Stale list: the call meets the typed refusal, returns no files, and the next serves lists the tools again.
  • Direct exchange of the unexposed tool: raises UnexposedToolError, which is a RelationViolationError.

The toad side (optional-reads: the composer offers Attach only where the bus takes files, pages from an older bus draw with no file chips) follows on this.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3

…serves, and a read

its caller can do without answers its declared nothing where it is not served

Tristan's phone (runtime 11a019b) on the laptop's bus (a73a3a1, older than message files)
failed every history page: the page's files read reached a connector that exposes no
comms_message_files, whose refusal decoded by text into RelationViolationError.

- CoreAccess.serves(request_type): an in-process Core serves every request it declares; a
  RemoteCoreAccess lists its connector's tools once per connection (tools/list, the same
  kept connection; a dropped connection may be a restarted connector and lists again).
- OptionalRead (a ReadRequest): a read its caller can do without declares absent(); posted
  to a Core that does not serve it, it answers that instead of sending. CommsMessageFilesTool
  is one: a bus without message files lists none on its pages.
- The connector refuses an unexposed tool as UnexposedToolError (CoreError "unexposed"), a
  ToolRefusedError that is still a RelationViolationError, so every earlier handler catches
  it; an OptionalRead meeting it (a stale list) answers absent() and lists again.

Tests drive the real connector application through a real RemoteCoreAccess: with the files
tools left out of the caller's exposed set (the older connector), the read is never posted
and answers no files; with them, it is answered; a stale list meets the typed refusal; a
direct call is refused as unexposed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

debt-tools at 84646ac passes.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

debt-src at 84646ac passes.

…only the remote Core reads tools/list

CoreAccess.serves is concrete (True) so every in-process Core, including the test Cores of
clients built before it (toad's ServedCore), keeps instantiating; RemoteCoreAccess answers
from its connector's tools. LocalCoreAccess's own copy of the default is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
@trissim
trissim merged commit d2e0546 into main Nov 18, 2026
8 of 11 checks passed
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