Versions: @opencomputer/cli 0.5.1, @opencomputer/agent 0.4.1, Node 26, macOS.
Repro
Take the exact lookup_order example from the tools docs and define it in agent.ts (or any file outside the agent's tools/ directory), then attach it:
const lookupOrder = defineTool({ name: "lookup_order", ... });
export default function Agent() {
useModel("anthropic/claude-sonnet-4.6");
useTool(lookupOrder);
return "...";
}
opencomputer dev syncs and deploys with no warning. Every session turn then fails with only:
opencomputer: The agent could not complete this request.
The real error is visible only in the raw /api/managed-agents/sessions/{id}/events feed:
useTool() referenced "lookup_order", which is not part of this deployment
Cause
The bundler only registers tools discovered by static scan of agents/<agent>/tools/*.ts (definedToolIds in project.js). Tools defined in agent.ts or a sibling file compile fine but never make it into the deployment manifest, so the runtime rejects the useTool() reference.
The same static-scan scope also affects secrets: a defineConnection() in a non-tools/ module produces Skipped GITHUB_TOKEN: it is not referenced by a defineConnection() declaration during .env.local sync.
Expected
Either bundle tools defined in agent.ts/imported modules, or fail at build/sync time with a clear message ("tools must live in agents//tools/"). The docs (tools.md, reactive-agents.md) never state the tools/ directory requirement.
🤖 Filed with Claude Code
Versions:
@opencomputer/cli0.5.1,@opencomputer/agent0.4.1, Node 26, macOS.Repro
Take the exact
lookup_orderexample from the tools docs and define it inagent.ts(or any file outside the agent'stools/directory), then attach it:opencomputer devsyncs and deploys with no warning. Every session turn then fails with only:The real error is visible only in the raw
/api/managed-agents/sessions/{id}/eventsfeed:Cause
The bundler only registers tools discovered by static scan of
agents/<agent>/tools/*.ts(definedToolIdsinproject.js). Tools defined inagent.tsor a sibling file compile fine but never make it into the deployment manifest, so the runtime rejects theuseTool()reference.The same static-scan scope also affects secrets: a
defineConnection()in a non-tools/module producesSkipped GITHUB_TOKEN: it is not referenced by a defineConnection() declarationduring.env.localsync.Expected
Either bundle tools defined in
agent.ts/imported modules, or fail at build/sync time with a clear message ("tools must live in agents//tools/"). The docs (tools.md, reactive-agents.md) never state thetools/directory requirement.🤖 Filed with Claude Code