Repository navigation
feat(host): add protocol, in-process host, session store, and client (ENG-379) - #2
Merged
Merged
Conversation
added 2 commits
October 17, 2026 01:47
…(ENG-379) Implement the v1 13-message Pydantic protocol, queue-backed in-process transport, atomic per-step session store, single-turn runner with RequestScope and ApprovalBroker, and AldwinClient API.
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.
Summary
Builds the protocol contract (
aldwin.protocol), the in-process transport and turn runner (aldwin.host), the per-step session store (aldwin.host.sessions), and the async client (aldwin.client). Doors can now stream turns, answer approval prompts, stop active turns within a second, switch models, and resume saved conversations without importingaldwin.coreoragentling.Ticket
Changes
src/aldwin/protocol/messages.py,docs/protocol.md): Added thev1envelope, 6 request models (hello,turn,stop,approve,history,set_model), 7 event models (text,tool_call,tool_result,approval,history,done,error), discriminated unions (Request,Event,Message),ConfigDict(extra="ignore"), and JSON parsers.src/aldwin/host/in_process.py): AddedClientTransportandInProcessTransportusing inbound and outboundasyncio.Queues with JSON wire validation and clean close sentinels.src/aldwin/host/sessions.py): AddedSessionStore,StoredSession, andSessionMetafor atomic0600per-step saves insessions/<YYYY-MM-DD>_<shortid>.json, latest-session resume, 60-character title derivation,/newsession creation, andrender_history(limit=20)with one-line tool summaries.src/aldwin/host/runner.py): AddedRequestScope(enforcing one terminal event per request),ApprovalBroker(ask,resolve,cancel_all),classify_turn_error, andAldwinHost(handshake check, streaming event mapping, mid-stream and mid-approvalstop,set_model, andnew_conversation).src/aldwin/client/client.py): AddedAldwinClient(connect,turn,stop,approve,history,set_model,new_conversation,close) withre-keyed event demultiplexing.tests/): AddedFakeModelandFakeTurnintests/fakes/model.py, plustests/test_protocol.py,tests/test_sessions.py,tests/test_host_runner.py, andtests/test_client.pycoveringTC-01throughTC-30.How it was tested
uv run pytest -v --cov=aldwin(91 passed in 0.61s, 94% total coverage; 100% onprotocol/, 100% onhost/in_process.py, 95% onhost/sessions.py, 93% onhost/runner.py, 93% onclient/client.py)uv run ruff check src testsanduv run ruff format --check src tests(all passed)uv run mypy --strict src tests(0 issues across 28 files)TC-01throughTC-30and manual checksM-01throughM-03inENG-391.