You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enabling hostInjectedCopilotAdapter without a client makes every memory search throw #2318
Turning on the host-injected Copilot memory adapter makes every governed memory search fail, even for plain local entries.
Repro
squad memory write --content "Use Vitest for SDK regression tests" --class LOCAL
squad memory provider --enable-copilot # same as --enable-host-injected-copilot-adapter
squad memory search --query vitest
The last command prints a stack trace and exits with code 1:
hostInjectedCopilotAdapter is enabled, but no host-injected Copilot memory client was supplied. This is not real provider=copilot persistence.
From an agent, memory.search through squad_state fails the same way. The tool returns a JSON-RPC -32603 error instead of a result, so the agent loses the local hits too. Writes keep working; COPILOT_MEMORY writes are rejected with a reason, which is fine.
Why
LocalMemoryStore.search() calls the adapter without a try/catch once the switch is on (packages/squad-sdk/src/memory/index.ts:912-916). The adapter's requireClient() throws when nobody passed a client (:482-489), and nothing in the shipped CLI or in squad state-mcp passes one. Both build LocalMemoryStore without hostInjectedCopilotAdapterClient. So the switch can be flipped from the CLI, but there's no client behind it anywhere.
Registered providers already handle this the other way. A failing provider search is caught, recorded as a content-free provider-error audit entry, and local results still come back. The same method also returns [] and audits for the defaultProvider: 'copilot' fail-closed case, instead of throwing.
.squad/memory/ isn't git-ignored by squad init, so once someone commits a config.json with the switch on, every clone gets the broken search.
Suggested fix
Treat the adapter like the registered providers in search(). If no client is available, skip it and audit a provider-error. If its search throws, catch it, audit the safe reason (no raw error text), and return the local results.
Activity
fix(sdk): keep governed memory search working when the host-injected …
fix(sdk): keep governed memory search working when the host-injected …