feat: D1 Durable Dana Conversation — restart-resumable ACP agent#27
Open
ngoclam9415 wants to merge 11 commits into
Open
feat: D1 Durable Dana Conversation — restart-resumable ACP agent#27ngoclam9415 wants to merge 11 commits into
ngoclam9415 wants to merge 11 commits into
Conversation
Add DanaACPAgent implementing the ACP Agent protocol over stdio JSON-RPC, enabling dana-console to connect to Dana as a Custom ACP Agent. - dana/apps/acp/agent.py: DanaACPAgent translating ACP calls (initialize, session/new, session/load, session/resume, session/prompt, session/cancel) to AgentSession operations, streaming HostEvents back as session_update notifications - dana/apps/acp/translation.py: HostEvent → ACP update chunk translation (ACP types never enter STAR core) - dana/apps/acp/__main__.py: entry point with stderr-only logging - dana/__init__/init_environment.py: redirect structlog to stderr so stdout stays clean for JSON-RPC frames - pyproject.toml: dana-acp console script entry point - tests/integration/test_acp_agent.py: 14 in-process + subprocess tests covering load capability, replay-before-return, chunk streaming, burst ordering, busy, cancel, malformed content, stderr/stdout discipline
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
Dana now streams multi-turn text conversations through
dana-acpand automatically resumes the same session after the ACP process restarts. This is the first delivery (D1) of the ACP AgentSession kernel — a Session Journal backed by SQLite/PostgreSQL is the sole durable authority for every turn.What shipped
dana/core/session/{models,protected_state}.py—OwnerScope,JournalFact,FactType,ProtectedStateCodec(AES-GCM + HKDF + AAD)dana/core/session/journal/{sqlite,postgres,protocol,schema,models}.py— one contract, two real databases, optimistic concurrencydana/core/session/projections/{conversation,host_events}.py— ConversationView (committed-turn gating) + HostEvent streamdana/core/session/agent_session.py— serialized text turns, streaming seam, bounded flush, crash-safe journalingdana/core/session/legacy_timeline_migration.py— interrupted-turn detection + idempotent legacy Timeline importdana/apps/acp/—initialize,session/new,session/load,session/resume,session/prompt,session/canceldana/core/session/health.py— redacted operational reportKey invariants
TURN_STARTED+USER_CONTENT_FINALappended before the model callASSISTANT_CONTENT_FINAL+ terminal in one atomic batchbusyacp.*imports confined todana/apps/acp/; STAR core untouchedTest results
Dependencies added
agent-client-protocol>=0.10,<0.11aiosqlite>=0.20.0asyncpg>=0.30.0What's NOT changed
dana-code,adana,dana-replCLIs remain on legacy Timeline (incremental migration)STARAgent.query()/aquery()source-compatibleConsole companion PR
Branch
feat/acp-agent-session-restartin dana-console addssessionStoragesession-ID persistence +session/loadresume on reconnect.Design spec
Approved at
docs/superpowers/specs/2026-07-07-acp-star-adapter-design.md.