feat(delegation): callee agents poke the caller on "really done" + goal on any agent call (v0.190.0)#318
Merged
Merged
Conversation
… + goal on any agent call (v0.190.0)
Agent→agent delegation was fundamentally synchronous: a caller either blocked on
task_wait/ask_agent or fired-and-forgot and never heard back. This adds an async
poke-back and a shared "goal" vocabulary across both delegation surfaces.
Poke-back (opt-in, task path): task_create({ assignee:"agent:<id>", poke_on_done:true })
stamps the caller's agent id + pinned claude transcript on the task (new nullable
columns caller_agent/caller_claude_id/poke_on_done). When the delegate closes the loop
(status → done or blocked), the task notifier resumes the caller's OWN transcript with
the outcome via the new Automations.pokeCaller — an immediate --resume (not the
1-min-floored schedule()), guarded so it never spawns a competing run on a still-live
caller. Provenance poke:<task> (console badge "Poke · …"), audited agent.poked. The
async counterpart to wait; implies autoDispatch.
Goal on any agent call: task_create/task_dispatch take `goal` as the ergonomic synonym
for `criteria` (the /goal convergence objective), and ask_agent gains the same optional
`goal` so a taskless synchronous consult can hand the delegate an objective to converge
on before answering — one vocabulary whether or not a task mediates.
Typecheck clean, governance 68/68, store round-trip smoke test passes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9e505ae to
6d460e6
Compare
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.
What & why
Agent→agent delegation was fundamentally synchronous: a caller either blocked (
task_wait/ask_agent) or fired-and-forgot and never heard back. This adds an async poke-back and a shared goal vocabulary across both delegation surfaces — answering "can a callee poke the caller when it's really done?" and "let me state a goal when calling an agent, with or without a task in between."Poke-back (opt-in, task path)
task_create({ assignee:"agent:<id>", goal:"…", poke_on_done:true }):caller_agent/caller_claude_id/poke_on_done).task_update→ done or blocked), the task notifier resumes the caller's own transcript with the outcome (✅ Really done: …/⛔ Handed back: …), so it picks its plan back up with full context.Automations.pokeCaller(not the 1-min-flooredschedule()), guarded so it never spawns a competing run on a still-live caller. Provenancepoke:<task>(console badge "Poke · …"), auditedagent.poked.wait(which blocks). ImpliesautoDispatch.ask_agentstays sync-only (the caller is already waiting, so a poke there is moot).Goal on any agent call
task_create/task_dispatchacceptgoalas the ergonomic synonym forcriteria(the single-line objective that drives a headless delegate under a/goalconvergence condition).ask_agentgains the same optionalgoal, so a taskless synchronous consult can hand the delegate an objective it converges on before answering.Design decisions (confirmed with the user)
poke_on_done) over poke-by-default — no surprise reruns; today's fire-and-forget stays the default.Files
src/state/{db,tasks}.ts,src/types.ts,src/edge/automations.ts,src/terminal.ts,src/server.ts,src/tenant-registry.ts,src/memory/memory-mcp.ts,docs/agent-mcp-tools.md,CHANGELOG.md,package.json(→ v0.189.0).Validation
npm run typecheckclean;npm run buildclean.latestNotereturns the delegate's note, and a human-filed task stays quiet (no accidental wake).Follow-up (not in this PR)
A taskless fire-and-forget
call_agent(async delegate + poke, no board entry) is the natural next increment; this PR covers the task-mediated async poke + goal on both surfaces.🤖 Generated with Claude Code