Repository navigation
feat(persona): wire the async-dispatch channel LIVE — personas send long-running commands away, not block - #1904
Merged
Conversation
…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
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.
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 workingmemory 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):
CommandToolExecutornow stores its coreArc<CommandExecutor>(it already had it atfor_persona) and exposes it via a newToolExecutor::command_executor()(default None — harnesses/mocks runsync).
apply_actpartitions long-running calls off todispatch_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 oncfg.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, notcargo/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_backgroundcaller identity isNone(local trust) for now — thread the personaCallerIdentity 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