feat(runtime): add RuntimeHost command boundary #97
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/zara!97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/runtime-host"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #83.
Summary
Adds the second desktop P0 boundary: a Qt-neutral
RuntimeHostand application command vocabulary over the existing Zara runtime.AgentManager; no second LLM/tool implementation is introducedTurnCoordinatoras the canonical source of turn IDs, cancellation and stale-result rejectionturn_idandconversation_idall the way into the existing AgentManager/LangGraph event streamzara.desktop.qt_bridge.QtRuntimeBridge, a UI-free PySide6 adapter that drains runtime-event queues on the Qt thread and maps command futures to queued Qt signalszara.runtimeArchitecture
RuntimeHostis usable withoutQApplicationandzara.runtimeremains Qt-free. The bridge contains no windows, tray, or assistant logic.Cancellation invariant
SubmitTurnfirst asks the existingTurnCoordinatorfor the canonical turn ID.CancelTurnmarks that coordinator state cancelled before cancelling the asyncio task. Before any completed backend result can publishResponseText/OutputReady, RuntimeHost asks the coordinator whether that turn is still active. A backend that swallows cancellation therefore still cannot leak stale output.Startup/quit invariant
An explicit
ShutdownRuntimereceived while RuntimeHost is STARTING is queued instead of rejected. The shutdown queue is consumed atomically with the STARTING→RUNNING transition, so a quit request cannot fall through a state-transition race. This applies both to initial startup and toRestartRuntime; a queued quit tears the backend/coordinator down and does not emit a misleading newRuntimeStartedevent.Integration note
The default
AgentRuntimeBackendreuses the existing text-agent path and supports injected manager factories. Full desktop bootstrap will supply the existing integrated Zara services as subsequent P0 slices land; this PR deliberately does not duplicatewake.pyvoice/Prolog startup or pretend context attachments are already wired. Non-empty context IDs are rejected until #88 instead of silently ignored.Tests
Adds deterministic coverage for:
GitHub Actions /
nix develop -c bash scripts/test-all.shis the authoritative merge gate because the local/home/unseen/Documents/Projectscheckout is not mounted in this execution environment.