Skip to content

fix(agent): real ask_user/team/loop tools, never deferred; loops off Tasks#92

Open
meidad wants to merge 1 commit into
mainfrom
fix/agent-tools-ask-loops
Open

fix(agent): real ask_user/team/loop tools, never deferred; loops off Tasks#92
meidad wants to merge 1 commit into
mainfrom
fix/agent-tools-ask-loops

Conversation

@meidad

@meidad meidad commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Makes the in-loop Nomos tools first-class (never deferred behind ToolSearch) so the iOS interactive cards actually fire, routes ask_user through the elicitation manager directly, and stops autonomous loops from leaking onto the Tasks/Today surfaces.

Tools always-in-prompt

  • nomos-memory (ask_user), nomos-team (delegate_to_team), nomos-vault, and nomos-loops now pass alwaysLoad: true to createSdkMcpServer — the model calls them directly instead of improvising a fake "load the tool" Bash step.
  • ask_user routes elicitation through a direct elicit callback into the ElicitationManager. The SDK doesn't forward elicitation/create from in-process MCP servers (-32601 Method not found), so we prefer the callback over extra.sendRequest.
  • Block the SDK built-ins that shadow our tools (AskUserQuestion, Workflow, Task*/Cron*, RemoteTrigger, ScheduleWakeup) in getDisallowedTools so the agent can't sidestep the Nomos equivalents.

Loops vs Tasks

  • loop_create/list/cap now tag jobs source = 'loop' (was 'agent'), distinct from one-off schedule_task work.
  • curateConsumerTasks excludes INFRA_SOURCES {system,bundled,loop}; loops surface only on Loops via curateOwnedLoops (mobile-api + grpc-server).
  • Widen the cron_jobs source CHECK constraint + CronJobSource/Kysely types to include 'loop'; update the feature-manifest invariant.

Misc

  • Friendlier summarizeToolInput (no raw JSON fallback; Skill case), "Asking & planning" guidance in profile.ts, lint fixes across eval/, scripts/, knowledge-compiler.

Test plan

  • pnpm check — lint 0/0, typecheck clean
  • pnpm test — 673 passed

🤖 Generated with Claude Code

…Tasks

Make the in-loop Nomos tools first-class and route them correctly so the
iOS interactive cards actually fire, and stop autonomous loops leaking onto
the Tasks/Today surfaces.

Tools always-in-prompt (no ToolSearch deferral):
- nomos-memory (ask_user), nomos-team (delegate_to_team), nomos-vault, and
  nomos-loops now pass `alwaysLoad: true` to createSdkMcpServer so the model
  calls them directly instead of improvising a fake "load the tool" Bash step.
- ask_user routes elicitation through a direct `elicit` callback into the
  ElicitationManager. The SDK doesn't forward elicitation/create from
  in-process MCP servers (-32601 Method not found), so prefer the callback
  over extra.sendRequest. Threaded through createMemoryMcpServer.
- Block the SDK built-ins that shadow our tools (AskUserQuestion, Workflow,
  Task*/Cron*, RemoteTrigger, ScheduleWakeup) in getDisallowedTools so the
  agent can't sidestep the Nomos equivalents.

Loops vs Tasks:
- loop_create/list/cap now tag jobs `source = 'loop'` (was 'agent'), a
  distinct provenance from one-off schedule_task work.
- curateConsumerTasks excludes INFRA_SOURCES {system,bundled,loop}; loops
  surface only on Loops via curateOwnedLoops (mobile-api + grpc-server).
- Widen the cron_jobs source CHECK constraint + CronJobSource/Kysely types
  to include 'loop'; update the feature manifest invariant.

Misc: friendlier summarizeToolInput (no raw JSON fallback; Skill case),
"Asking & planning" guidance in profile.ts, lint fixes across eval/ +
scripts/ + knowledge-compiler.

Verified: pnpm check (lint 0/0, typecheck clean), pnpm test (673 passed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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