You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR implements executor/runtime terminology alignment and session resume semantics by introducing local_attached execution binding, renaming worker-centric APIs to executor-centric with backward-compatibility aliases, adding JSONL/SQLite-backed durable session and runtime stores, implementing session resume with linked-run tracking and checkpoint context injection, and wiring managed session execution through CLI/REPL with new resume and inspection commands.
New ADRs 0054–0055 define executor/runtime terminology, resume-first direction, and session resume semantics with linked-run tracking and checkpoint injection. Task packets enumerate scope, references, and verification criteria.
Execution Binding & API Schemas coding-agent/src/coding_agent/server/execution_binding.py, coding-agent/src/coding_agent/server/schemas.py
Added LocalAttachedExecutionBinding dataclass and updated union type. Extended SessionSummaryResponse with resume/checkpoint fields. Added ResumeSessionRequest and ExecutorListResponse schemas. Updated worker request models to accept both worker_id and executor_id via validation aliases.
Runtime Store Backends coding-agent/src/coding_agent/runtime_store.py
Introduced JSONLRuntimeStore and SQLiteRuntimeStore for append-only JSONL and transactional SQLite persistence of runs, events, snapshots, and interactions. Updated PostgreSQL store to generalize run-claiming SQL for both external_worker and local_attached binding kinds.
Added FileSessionStore (JSON files) and SQLiteSessionStore (SQLite records) with thread-locking and atomic writes. Extended create_session_store factory to route fs, file, json, and sqlite backends.
Attached Executor API & Remote Integration coding-agent/src/coding_agent/remote/worker.py, coding-agent/src/coding_agent/remote/client.py
Refactored from "external worker" to "attached executor" API contract with AttachedExecutorError and AttachedExecutorConsumer. Renamed execution paths and updated endpoints to /executor/runs/*. Added remote executor listing/status functions and stream_resume_or_run_request SSE helper.
Introduced SessionResumeContext with metadata/checkpoint/tape-tail collection. Implemented request_attached_executor_run, resume_session orchestration with resume boundary anchors, and runtime event correlation. Changed IO guard to threading.Lock and added JSONL/file/SQLite backend routing. Propagates resume_context through observation recording and runtime metadata.
HTTP API Endpoints coding-agent/src/coding_agent/server/http_server.py
Renamed /worker/* routes to /executor/* with backward-compatible dispatch. Added /sessions/{session_id}/resume SSE endpoint and /executors list/detail endpoints. Implemented _session_summary_response helper enriching session payloads with resume metadata.
Extended AgentObservationRecorder.start_turn to accept optional attributes parameter, merged with sanitized allowed entries, and propagated into emitted child and turn spans.
Added resume command and sessions command group with list, status, checkpoints subcommands. Refactored batch/interactive execution to use SessionManager with asyncio-driven managed turns. Implemented async helpers for session inspection, resume, and wire-message streaming.
Updated InteractiveSession to use _local_session_manager() with explicit fs/jsonl backend configuration. Refactored _process_message to branch on session availability: if session exists, runs managed turn via asyncio task with concurrent wire streaming and root-TurnEnd detection; otherwise falls back to direct run_turn.
Updated to reflect attached-executor terminology by renaming commands and adding --executor-id support with --worker-id backward compatibility. Introduced remote executor, remote executors, remote executor-status, and remote resume commands. Extended session/run listing with executor id, resumable flag, and checkpoint columns.
Comprehensive Test Coverage coding-agent/tests/cli/test_*.py, coding-agent/tests/ui/test_*.py, coding-agent/tests/coding_agent/test_*.py
Added extensive contract/integration tests validating managed-session CLI execution, session resume flow with linked runs, local session inspection, checkpoint persistence across store instances, attached executor claiming, HTTP resume endpoints, runtime event correlation, and wire-message payload structure. Updated existing tests to assert executor terminology, resume fields, and new metadata expectations.
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs
delete-cloud/Coding-Agent-Loop#407: Implements the external-worker control-plane foundation that this PR refactors into attached-executor/resume semantics, extending claim/prompt/event endpoints and runtime store claiming logic.
delete-cloud/Coding-Agent-Loop#375: Restructures the CLI entrypoint that this PR extends with managed-session/resume commands in the same src/coding_agent/cli/main.py module.
delete-cloud/Coding-Agent-Loop#402: Modifies observability span emission in AgentObservationRecorder that this PR extends to propagate turn-level attributes into nested spans.
🐰 Session resume hops through the checkpoint forest, Old runs linked like clover chains, Executor names now loud and proud, Where workers once hid in the weeds, Fresh spawns bloom from durable seeds. 🌱
✨ Finishing Touches📝 Generate docstrings
Create stacked PR
Commit on current branch
🧪 Generate unit tests (beta)
Create PR with unit tests
Commit unit tests in branch executor-runtime-resume-first
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
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
Verification
uv run pytest tests/cli/test_repl.py tests/cli/test_entrypoint_contract.py tests/cli/test_remote_client.py tests/ui/test_execution_binding.py tests/ui/test_session_manager_runtime.py tests/ui/test_http_server.py tests/ui/test_session_manager_public_api.py tests/ui/test_sqlite_session_store.py tests/coding_agent/test_pg_runtime_store.py tests/coding_agent/test_jsonl_runtime_store.py tests/coding_agent/test_sqlite_runtime_store.py tests/coding_agent/test_agent_observability.py -v-> 549 passed, 96 warningsuv run ruff check <changed python files> --output-format=concise-> All checks passeduv run ruff format --check <changed python files>-> 23 files already formattedgit diff --check-> passedNote: full-repo
ruff check src testsand full-reporuff format --check src testsstill surface pre-existing unrelated issues outside this PR scope.