Skip to content

feat(persona): wire the async-dispatch channel LIVE — personas send long-running commands away, not block - #1904

Merged
joelteply merged 1 commit into
canaryfrom
feat/persona-background-dispatch-live
Jul 7, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/persona-background-dispatch-live

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The final attachment of the async handle/event channel (#66 sink / #67 producer / #68 consumer). A live persona
that invokes a long-running command — code/cargo/test, code/cargo/check, cognition/full-evaluate,
forge/train — now dispatches it in the BACKGROUND (fire-and-poll) and its result streams back into working
memory by handle when it lands, instead of blocking the turn.

The clean thread (the core executor was walled off from cognition — global accessor removed, hidden behind the
client Connection): CommandToolExecutor now stores its core Arc<CommandExecutor> (it already had it at
for_persona) and exposes it via a new ToolExecutor::command_executor() (default None — harnesses/mocks run
sync). apply_act partitions long-running calls off to dispatch_background + record_dispatch_event(..Running)
and records a "dispatched — carry on" proprioception note; the rest run synchronously as before (no long-running
call → inert, zero behavior change). The per-persona listener spawns in build_workspace_cycle, gated on
cfg.defer_recall (live only — never the eval fork) + a running tokio runtime, folding completions back by handle.

Verified: full crate compiles; act_observe (10) + command_executor (12) + dispatch_listener + working_memory all
green; two new seam tests — a live persona's hands expose the core executor (harness hands don't), and the
long-running set matches the REAL command names (caught the live bug: code/cargo/test, not cargo/test). Live:
core boots clean, a normal turn still works (Asha answered "Four") — the apply_act change is safe.

NOT yet observed end-to-end live: a persona actually invoking a long-running command. Asha narrated "Running
cargo test…" and declined rather than emitting the tool call — the 14B competence gap (+ my wrong command names,
now fixed), not a wiring fault. The pipe is proven at every seam and safe live; a correct invocation now
backgrounds. Full end-to-end demo is gated on the model reliably emitting a long-running tool call (escalation/
training). Caveat: dispatch_background caller identity is None (local trust) for now — thread the persona
CallerIdentity as a follow-up. [[persona-async-dispatch-channel]]

Co-Authored-By: Claude Opus 4.8 [email protected]
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…ong-running commands away, not block

The final attachment of the async handle/event channel (#66 sink / #67 producer / #68 consumer). A live persona
that invokes a long-running command — `code/cargo/test`, `code/cargo/check`, `cognition/full-evaluate`,
`forge/train` — now dispatches it in the BACKGROUND (fire-and-poll) and its result streams back into working
memory by handle when it lands, instead of blocking the turn.

The clean thread (the core executor was walled off from cognition — global accessor removed, hidden behind the
client Connection): `CommandToolExecutor` now stores its core `Arc<CommandExecutor>` (it already had it at
`for_persona`) and exposes it via a new `ToolExecutor::command_executor()` (default None — harnesses/mocks run
sync). `apply_act` partitions long-running calls off to `dispatch_background` + `record_dispatch_event(..Running)`
and records a "dispatched — carry on" proprioception note; the rest run synchronously as before (no long-running
call → inert, zero behavior change). The per-persona listener spawns in `build_workspace_cycle`, gated on
`cfg.defer_recall` (live only — never the eval fork) + a running tokio runtime, folding completions back by handle.

Verified: full crate compiles; act_observe (10) + command_executor (12) + dispatch_listener + working_memory all
green; two new seam tests — a live persona's hands expose the core executor (harness hands don't), and the
long-running set matches the REAL command names (caught the live bug: `code/cargo/test`, not `cargo/test`). Live:
core boots clean, a normal turn still works (Asha answered "Four") — the apply_act change is safe.

NOT yet observed end-to-end live: a persona actually invoking a long-running command. Asha narrated "Running
cargo test…" and declined rather than emitting the tool call — the 14B competence gap (+ my wrong command names,
now fixed), not a wiring fault. The pipe is proven at every seam and safe live; a correct invocation now
backgrounds. Full end-to-end demo is gated on the model reliably emitting a long-running tool call (escalation/
training). Caveat: `dispatch_background` caller identity is `None` (local trust) for now — thread the persona
CallerIdentity as a follow-up. [[persona-async-dispatch-channel]]

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit dc85fa3 into canary Jul 7, 2026
@joelteply
joelteply deleted the feat/persona-background-dispatch-live branch July 7, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant