Skip to content

feat(temporal): Added commands for a session nobody is sitting in front of. - #8

Closed
moetemp wants to merge 1 commit into
moe/deployment-profilefrom
moe/l3-detached-sessions
Closed

moetemp wants to merge 1 commit into
moe/deployment-profilefrom
moe/l3-detached-sessions

Conversation

@moetemp

@moetemp moetemp commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds session start, session running and session watch, so the detached lifecycle the durable executor already supports can be driven from a command line.

A session is a workflow rather than a process, the running set comes from Temporal visibility, the store is shared, and a live tail re-reads. Put together, a session can outlive its client; nothing said so, and nothing on the command line could use it. The commands are thin HTTP clients against any serve in the deployment, because the serves are interchangeable, and they never talk to Temporal.

start hands a prompt over and returns the session id. running reads the executor's own answer, so it survives a restart of whichever process answers. watch follows a session from a machine that has never seen it and exits when the turn stops. The turn now publishes its own durable ending, session.next.turn.ended, because a step ending is not a turn ending (a steer or a queued prompt continues the same turn) and a follower in another process has only the replayable stream to read. A turn the user stopped or a provider error ended has no ordinary ending, so a slow poll of the running set is the backstop.

scripts/detached-session-check.sh proves it against real processes: a Temporal dev server, one standalone worker, two serve processes and one shared store. Serve A starts a turn and is killed with a tool still running; the turn finishes on the worker; serve B, which never saw the session, reports it running and replays the transcript; then start, running and watch work from a cold client. The assertions were mutation-checked: giving serve B its own store makes exactly the cross-process ones fail.

The schedule command, the container check, the worktree quarantine and the turn budget, which used to ride in this PR, are their own PRs in the stack now.

@moetemp
moetemp force-pushed the moe/l2-tool-activities branch from de37977 to d2db32f Compare September 7, 2026 23:27
@moetemp
moetemp force-pushed the moe/l3-detached-sessions branch from 9b0cc30 to 442ee26 Compare September 7, 2026 23:27
@moetemp
moetemp force-pushed the moe/l2-tool-activities branch from d2db32f to a5b5d00 Compare September 14, 2026 18:11
@moetemp
moetemp force-pushed the moe/l3-detached-sessions branch from 7a62ca2 to b567cbf Compare September 14, 2026 18:11
@moetemp
moetemp force-pushed the moe/l2-tool-activities branch from a5b5d00 to 10af0ac Compare September 14, 2026 22:34
@moetemp
moetemp force-pushed the moe/l3-detached-sessions branch from b567cbf to ada95ac Compare September 14, 2026 22:34
@moetemp
moetemp force-pushed the moe/l2-tool-activities branch from 10af0ac to 039a3b1 Compare September 15, 2026 00:44
@moetemp
moetemp force-pushed the moe/l3-detached-sessions branch from ada95ac to c980eb6 Compare September 15, 2026 00:44
@moetemp moetemp changed the title feat(temporal): Made a session outlive the client that started it. feat(temporal): Added commands for a session nobody is sitting in front of. Sep 15, 2026
@moetemp
moetemp changed the base branch from moe/l2-tool-activities to moe/deployment-profile September 15, 2026 00:46
@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

`session start` hands over a prompt and returns, `session running` reads the running set off the executor, and `session watch` follows a turn from a machine that never had it. They are plain HTTP clients against any serve in the deployment. The turn now publishes its own durable ending, `session.next.turn.ended`, because a step ending is not a turn ending and a follower in another process has only the replayable stream to read.
@moetemp
moetemp force-pushed the moe/deployment-profile branch from cecf750 to 4b9e69b Compare September 15, 2026 01:01
@moetemp
moetemp force-pushed the moe/l3-detached-sessions branch from c980eb6 to 494742b Compare September 15, 2026 01:01
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant