feat: durable remote session adapters and session telemetry - #2384
feat: durable remote session adapters and session telemetry#2384jkyamog wants to merge 3 commits into
Conversation
Add named external AgentSessionAdapter selection, durable identity persistence, reload-safe discovery, retry controls, and replay hardening for workflow stages.
a4ef4e7 to
6f64254
Compare
Make the run, not the stage, the unit of remote placementThanks for the thought put into this. The continuation and resume hardening is the hard part of the problem, and most of it survives what I am about to propose. But Why the stage is the wrong place to split:
A run already owns one durable record, one artifact root, one intercom group, one worktree contract. Move a whole run and all of that still holds. Throughput does not suffer: run independent workflows at once, which is how we dispatch them anyway. Where this is goingI am looking at Coder, and at GitHub, so we can back several cloud providers. The model I want is one VM per workflow run, with the durable store on a hosted PostgreSQL so any VM can resume any run. One VM per run matches the run boundary exactly. A VM has one filesystem, one clone, one worktree, one set of local paths, which is what every stage and tool node in a run already assumes. Stage-level placement leaves two choices and both are bad: a VM per stage, which costs more and brings back every problem above, or all stages in one VM, which is run-level placement with extra plumbing. The hosted database needs little from us. The backend is already DBOS on Postgres, Note what that does not solve. DBOS keys durable state by workflow, and stage and tool checkpoints hang off a workflow ID, so a shared database hands us run-level resumption and nothing finer. It cannot give stage-level resumption, because what a remote stage needs back is the live session and its transcript, and that is not in Postgres. So the shared database makes the run the recoverable unit, and per-stage placement then splits recovery between a database one node owns and a session another node owns. Placing at the run also keeps the provider out of the workflow definition. Keep and changeKeep: Change: drop Tell me if there is a plan for the filesystem problem that I have missed. Otherwise let us talk through the rework before you spend time on it, since the part I want cut is separable from the part I want kept. |
This branch adds the Atomic-side support needed for extension-provided remote
session adapters, safe workflow continuation, and useful telemetry for stages
that do not expose a local
AgentSession.The branch is based on
origin/mainand contains three logical commits:feat(workflows): add named session adaptersfix(workflows): harden remote session continuation and resumefeat(ui): show adapter session telemetryWhat changed
conflict detection, and late-registration support.
policy, including
retryPolicy: "never"for adapters that require explicitworkflow control for reconnects.
resume_unfinished_turninstead of submitting the prompt twice;
duplicate continuation work;
including context usage, input/output tokens, cache read/write totals, cache
hit rate, and cost when supplied by the adapter.
session_statsevents without routingthose telemetry-only events through the ordinary transcript reducer.
continuation, resume, queued steering, replay, and telemetry behavior.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Greptile Summary
This update adds named session-adapter support for workflow conversations, preserves remote-session identity and configuration through recovery, and exposes adapter usage statistics in interactive views. Focused checks confirmed that failed RPC continuation returns an error rather than success, unavailable retained adapters return the documented unavailable result, and restored remote sessions retain their selected adapter and configuration.
Confidence Score: 5/5
Safe to merge based on the exercised continuation, unavailable-adapter, persistence, and remote-session recovery paths.
No blocking failure remains.
What T-Rex did
Reviews (3): Last reviewed commit: "feat(ui): show adapter session telemetry" | Re-trigger Greptile