Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assistant/src/daemon/conversation-tool-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export const HOST_TOOL_TO_CAPABILITY = new Map<string, HostProxyCapability>([
export const HOST_TOOL_NAMES = new Set(HOST_TOOL_TO_CAPABILITY.keys());
/**
* Capabilities eligible for cross-client exposure on non-host-proxy
* transports (e.g. web, iphone routing to a connected macOS client).
* transports (e.g. web, ios routing to a connected macOS client).
* Adding a capability here exposes ALL tools that map to it (per
* HOST_TOOL_TO_CAPABILITY) on non-host-proxy transports — the daemon then
* routes the actual invocation to the connected capable client via the
Expand Down Expand Up @@ -409,7 +409,7 @@ export function isToolActiveForContext(
if (transport && capability && !supportsHostProxy(transport, capability)) {
// Cross-client exception: allow host tools whose capabilities have
// cross-client routing infrastructure (Phases 1–3) to be exposed for
// non-host-proxy transports (e.g. "web", "iphone") when at least one
// non-host-proxy transports (e.g. "web", "ios") when at least one
// capable client is connected via the event hub. Members of
// CROSS_CLIENT_EXPOSED_CAPABILITIES (host_bash, host_file) qualify;
// host_browser is intentionally excluded (chrome-extension is its
Expand Down
5 changes: 4 additions & 1 deletion assistant/src/tools/host-filesystem/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,11 @@ class HostFileEditTool implements Tool {
// and tool-execution). Scoped to !supportsHostProxy so macos turns —
// where local-fs fallback IS the intended offline behavior — still fall
// through if the LLM auto-fills a stale target_client_id from a prior
// cross-client turn. On web/iphone, the call must fail loudly rather
// cross-client turn. On web/ios, the call must fail loudly rather
// than silently target the daemon container's filesystem.
// Note: this scoping deliberately differs from host_bash
// (host-shell.ts:239-247), which rejects unconditionally; see PR #29613
// review discussion for rationale.
Comment thread
credence-the-bot[bot] marked this conversation as resolved.
if (
targetClientId != null &&
transportInterface != null &&
Expand Down
5 changes: 4 additions & 1 deletion assistant/src/tools/host-filesystem/read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ class HostFileReadTool implements Tool {
// and tool-execution). Scoped to !supportsHostProxy so macos turns —
// where local-fs fallback IS the intended offline behavior — still fall
// through if the LLM auto-fills a stale target_client_id from a prior
// cross-client turn. On web/iphone, the call must fail loudly rather
// cross-client turn. On web/ios, the call must fail loudly rather
// than silently target the daemon container's filesystem.
// Note: this scoping deliberately differs from host_bash
// (host-shell.ts:239-247), which rejects unconditionally; see PR #29613
// review discussion for rationale.
Comment thread
credence-the-bot[bot] marked this conversation as resolved.
if (
targetClientId != null &&
transportInterface != null &&
Expand Down
9 changes: 9 additions & 0 deletions assistant/src/tools/host-filesystem/transfer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ mock.module("../../daemon/host-transfer-proxy.js", () => ({
},
}));

// Mirror read/write/edit test files: stub the event hub so the multi-client
// guard at line ~100 of transfer.ts is exercised against an isolated stub
// rather than the live process-wide singleton.
mock.module("../../runtime/assistant-event-hub.js", () => ({
assistantEventHub: {
listClientsByCapability: () => [],
},
}));

const { hostFileTransferTool } = await import("./transfer.js");

const testDirs: string[] = [];
Expand Down
7 changes: 5 additions & 2 deletions assistant/src/tools/host-filesystem/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class HostFileTransferTool implements Tool {
) {
return {
content:
"Error: no client with host_file capability is connected. Connect a macOS client to use host_file_transfer from a non-desktop interface.",
"Error: no client with host_file capability is connected. Connect a macOS client to use host_file from a non-desktop interface.",
isError: true,
};
}
Expand All @@ -129,8 +129,11 @@ class HostFileTransferTool implements Tool {
// and tool-execution). Scoped to !supportsHostProxy so macos turns —
// where local-fs fallback IS the intended offline behavior — silently
// ignore a stale target_client_id auto-filled from a prior cross-client
// turn. On web/iphone, the call must fail loudly rather than silently
// turn. On web/ios, the call must fail loudly rather than silently
// target the daemon container's filesystem.
// Note: this scoping deliberately differs from host_bash
// (host-shell.ts:239-247), which rejects unconditionally; see PR #29613
// review discussion for rationale.
Comment thread
credence-the-bot[bot] marked this conversation as resolved.
if (
targetClientId != null &&
context.transportInterface != null &&
Expand Down
5 changes: 4 additions & 1 deletion assistant/src/tools/host-filesystem/write.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ class HostFileWriteTool implements Tool {
// and tool-execution). Scoped to !supportsHostProxy so macos turns —
// where local-fs fallback IS the intended offline behavior — still fall
// through if the LLM auto-fills a stale target_client_id from a prior
// cross-client turn. On web/iphone, the call must fail loudly rather
// cross-client turn. On web/ios, the call must fail loudly rather
// than silently target the daemon container's filesystem.
// Note: this scoping deliberately differs from host_bash
// (host-shell.ts:239-247), which rejects unconditionally; see PR #29613
// review discussion for rationale.
Comment thread
credence-the-bot[bot] marked this conversation as resolved.
if (
targetClientId != null &&
transportInterface != null &&
Expand Down
Loading