WIP: WI 2 — Implement peer dispatch in delegation tick (ACP session creation + async result return) #241

Draft
toasterson wants to merge 2 commits from claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati into main
Owner

Anima work item 019f8589-1bf9-77b0-aa24-3b7eeb73e758.

Implement the actual peer dispatch for the delegate tool's target="peer" path.

CURRENT STATE: delegate(target="peer") enqueues a DelegationTask into a pending Vec with no consumer. The delegation feature is off by default; even when on, only "local" has a real dispatch path (subprocess spawn). "peer" is a stored hint with no implementation.

CHANGE:

  • Delegation tick: when draining pending peer tasks, create an ACP session in the target akh's workspace (or same workspace for self-delegation)
  • Drive session/prompt with the task description
  • Collect streamed events
  • Return result ASYNCHRONOUSLY: delegate() returns a delegation ID immediately
  • Result delivered via session mailbox (WI 3) or a delegate_result polling tool
  • The delegation tick must NOT call Anima — pure internal ACP operation

FILES: src/agent/tools/delegate.rs, src/bin/akhomed.rs (delegation tick), src/acp/mod.rs (programmatic session creation API)

DEPENDS ON WI 1: the delegated session needs its own SessionContext (cognitive isolation from the calling session).

Anima work item `019f8589-1bf9-77b0-aa24-3b7eeb73e758`. Implement the actual peer dispatch for the delegate tool's target="peer" path. CURRENT STATE: delegate(target="peer") enqueues a DelegationTask into a pending Vec with no consumer. The delegation feature is off by default; even when on, only "local" has a real dispatch path (subprocess spawn). "peer" is a stored hint with no implementation. CHANGE: - Delegation tick: when draining pending peer tasks, create an ACP session in the target akh's workspace (or same workspace for self-delegation) - Drive session/prompt with the task description - Collect streamed events - Return result ASYNCHRONOUSLY: delegate() returns a delegation ID immediately - Result delivered via session mailbox (WI 3) or a delegate_result polling tool - The delegation tick must NOT call Anima — pure internal ACP operation FILES: src/agent/tools/delegate.rs, src/bin/akhomed.rs (delegation tick), src/acp/mod.rs (programmatic session creation API) DEPENDS ON WI 1: the delegated session needs its own SessionContext (cognitive isolation from the calling session).
WI 2 — Implement peer dispatch in delegation tick (ACP session creation + async result return)
Some checks failed
CI / publish-chart (pull_request) Failing after 7m31s
CI / publish-chart (push) Failing after 10m8s
CI / check-seshat (push) Successful in 10m32s
CI / check-seshat (pull_request) Successful in 11m2s
CI / docker-seshd (push) Successful in 15m56s
CI / docker-seshd (pull_request) Successful in 15m56s
d1c53228ee
Anima implementation session.
toasterson force-pushed claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati from d1c53228ee
Some checks failed
CI / publish-chart (pull_request) Failing after 7m31s
CI / publish-chart (push) Failing after 10m8s
CI / check-seshat (push) Successful in 10m32s
CI / check-seshat (pull_request) Successful in 11m2s
CI / docker-seshd (push) Successful in 15m56s
CI / docker-seshd (pull_request) Successful in 15m56s
to ddea4614b0
Some checks failed
CI / check-seshat (push) Successful in 15m48s
CI / publish-chart (pull_request) Failing after 16m0s
CI / publish-chart (push) Failing after 21m17s
CI / docker-seshd (push) Successful in 22m17s
CI / check-seshat (pull_request) Successful in 22m19s
CI / docker-seshd (pull_request) Successful in 22m1s
2026-07-24 03:18:58 +00:00
Compare
toasterson force-pushed claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati from ddea4614b0
Some checks failed
CI / check-seshat (push) Successful in 15m48s
CI / publish-chart (pull_request) Failing after 16m0s
CI / publish-chart (push) Failing after 21m17s
CI / docker-seshd (push) Successful in 22m17s
CI / check-seshat (pull_request) Successful in 22m19s
CI / docker-seshd (pull_request) Successful in 22m1s
to ac29b2e255
Some checks failed
CI / publish-chart (pull_request) Failing after 8m39s
CI / publish-chart (push) Failing after 8m40s
CI / check-seshat (push) Successful in 9m44s
CI / check-seshat (pull_request) Successful in 9m50s
CI / docker-seshd (push) Successful in 15m22s
CI / docker-seshd (pull_request) Successful in 15m35s
2026-07-24 06:45:10 +00:00
Compare
ci: adopt exit-0-free chart-publish workflow (Solstice failure fix)
Some checks failed
CI / check-seshat (push) Successful in 22m48s
CI / publish-chart (pull_request) Successful in 16m24s
CI / docker-seshd (push) Successful in 22m32s
CI / publish-chart (push) Failing after 24m23s
CI / check-seshat (pull_request) Failing after 24m47s
CI / docker-seshd (pull_request) Successful in 34m16s
9e8b443b05
The publish-chart skip path's mid-script exit 0 is mis-mapped to
exit_code=1 by the Solstice runner, reddening this branch's CI and
blocking merge. Adopt the develop/main if-else fall-through version.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Some checks failed
CI / check-seshat (push) Successful in 22m48s
CI / publish-chart (pull_request) Successful in 16m24s
CI / docker-seshd (push) Successful in 22m32s
CI / publish-chart (push) Failing after 24m23s
CI / check-seshat (pull_request) Failing after 24m47s
CI / docker-seshd (pull_request) Successful in 34m16s
This pull request has changes conflicting with the target branch.
  • Cargo.toml
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati:claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati
git switch claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati
git switch claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati
git rebase main
git switch main
git merge --ff-only claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati
git switch claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati
git rebase main
git switch main
git merge --no-ff claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati
git switch main
git merge --squash claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati
git switch main
git merge --ff-only claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati
git switch main
git merge claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
toasterson/akh-medu!241
No description provided.