fix(agent): real ask_user/team/loop tools, never deferred; loops off Tasks#92
Open
meidad wants to merge 1 commit into
Open
fix(agent): real ask_user/team/loop tools, never deferred; loops off Tasks#92meidad wants to merge 1 commit into
meidad wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the in-loop Nomos tools first-class (never deferred behind ToolSearch) so the iOS interactive cards actually fire, routes
ask_userthrough 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, andnomos-loopsnow passalwaysLoad: truetocreateSdkMcpServer— the model calls them directly instead of improvising a fake "load the tool" Bash step.ask_userroutes elicitation through a directelicitcallback into theElicitationManager. The SDK doesn't forward elicitation/create from in-process MCP servers (-32601 Method not found), so we prefer the callback overextra.sendRequest.AskUserQuestion,Workflow,Task*/Cron*,RemoteTrigger,ScheduleWakeup) ingetDisallowedToolsso the agent can't sidestep the Nomos equivalents.Loops vs Tasks
loop_create/list/cap now tag jobssource = 'loop'(was'agent'), distinct from one-offschedule_taskwork.curateConsumerTasksexcludesINFRA_SOURCES {system,bundled,loop}; loops surface only on Loops viacurateOwnedLoops(mobile-api + grpc-server).cron_jobssource CHECK constraint +CronJobSource/Kysely types to include'loop'; update the feature-manifest invariant.Misc
summarizeToolInput(no raw JSON fallback; Skill case), "Asking & planning" guidance inprofile.ts, lint fixes acrosseval/,scripts/,knowledge-compiler.Test plan
pnpm check— lint 0/0, typecheck cleanpnpm test— 673 passed🤖 Generated with Claude Code