Skip to content

feat(delegation): callee agents poke the caller on "really done" + goal on any agent call (v0.190.0)#318

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/agent-poke-goal
Jul 14, 2026
Merged

feat(delegation): callee agents poke the caller on "really done" + goal on any agent call (v0.190.0)#318
vikasprogrammer merged 1 commit into
mainfrom
feat/agent-poke-goal

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

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 }):

  • Stamps the caller's agent id + pinned claude transcript on the task (new nullable columns caller_agent / caller_claude_id / poke_on_done).
  • The caller ends its turn — no polling.
  • When the delegate closes the loop (task_updatedone 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.
  • Wake fires immediately via new Automations.pokeCaller (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 (which blocks). Implies autoDispatch. ask_agent stays sync-only (the caller is already waiting, so a poke there is moot).

Goal on any agent call

  • task_create / task_dispatch accept goal as the ergonomic synonym for criteria (the single-line objective that drives a headless delegate under a /goal convergence condition).
  • ask_agent gains the same optional goal, so a taskless synchronous consult can hand the delegate an objective it converges on before answering.
  • One vocabulary whether or not a task mediates the hand-off.

Design decisions (confirmed with the user)

  • Poke = resume the caller's transcript (context-preserving wake) over an inbox-card-only or fresh-run approach.
  • Opt-in per call (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 typecheck clean; npm run build clean.
  • Governance conformance 68/68.
  • Isolated store smoke test: caller fields round-trip, the done-notice carries the poke fields, latestNote returns 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

… + 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>
@vikasprogrammer vikasprogrammer changed the title feat(delegation): callee agents poke the caller on "really done" + goal on any agent call (v0.189.0) feat(delegation): callee agents poke the caller on "really done" + goal on any agent call (v0.190.0) Jul 14, 2026
@vikasprogrammer vikasprogrammer merged commit b421761 into main Jul 14, 2026
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