2 Commits

Author SHA1 Message Date
Shutong Wu 852703d842 [Feature] Meta tool: toggle tool context in realtime (#854)
* Initial update on tool list update

* clean up and doc update

* Update for Stdio mode

* UI change and doc update

* fix based on audit

* Update manage_tools.py

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-03 00:07:14 -05:00
dsarno 4055fe5e4d Add per-call unity_instance routing via middleware argument interception (#772)
Any tool call can now include a unity_instance parameter to route that
specific call to a target Unity instance without changing the session
default and without requiring a set_active_instance call first.

The middleware pops unity_instance from tool call arguments before
Pydantic validation runs, resolves it (port number, hash prefix, or
Name@hash), and injects it into request-scoped state for that call only.

- Port numbers resolve to the matching Name@hash via status file lookup
  rather than synthetic direct:{port} IDs, so the transport layer can
  route them correctly
- HTTP mode rejects port-based targeting with a clear error
- set_active_instance now also accepts port numbers for consistency
- Multi-instance scenarios log available instances with ports when
  auto-select cannot choose
- _discover_instances() helper DRYs up transport-aware instance
  discovery previously duplicated across the codebase
- Server instructions updated to document both routing approaches
- 18 new tests covering pop behaviour, per-call vs session routing,
  port resolution, transport modes, and edge cases

Closes #697

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 14:05:11 -08:00