orchestration-session-lifecycle
Skill14 starsChanged 8 months agoMITView on GitHub
How a PilotSwarm session maps to a duroxide orchestration. Read this before concluding that an "idle" session's orchestration is broken, stopped or stuck: most idle sessions are healthy, dehydrated and waiting for their next stimulus.
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
When you call read_session_info and see no recent activity, that
- Distinctive: line 72
no worker has picked it up
- Distinctive: line 93
When asked "is this session healthy?", do not say "the orchestration is not running" unless you have verified the four-condition stall test …
- Distinctive: line 102
"Stalled.": All four conditions of the stall test met.
- Distinctive: line 105
Use these phrases. They map cleanly to operator action.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Orchestration ↔ Session Lifecycle
You are the agent-manager. Before reporting that a session looks "stuck", "stopped", or "missing its orchestration", read this carefully. The single most common false-positive in tuner reports is conflating session idle with orchestration not running. They are not the same thing.
The contract
A PilotSwarm session is a long-lived logical entity. The duroxide orchestration backing it is an event-driven generator that runs only when there is work to do and is otherwise dehydrated to disk. This is by design — it's how PilotSwarm scales to thousands of sessions on a few worker pods.
A healthy session spends most of its lifetime with no live orchestration in memory. That is the steady state. Not a bug.
Concrete lifecycle states
| Session looks like | Orchestration is | Healthy? |
| Just created | Active, running first turn | ✅ |
| Mid-turn (LLM call in flight) | Active, awaiting activity | ✅ |
| Waiting for user input | Dehydrated; history persisted | ✅ |
| Cron'd background loop, between ticks | Dehydrated; durable timer pending | ✅ |
| Idle for hours, no recent events | Dehydrated; ready to wake | ✅ |
state = completed in CMS | Terminated, history retained | ✅ |
state = failed in CMS | Terminated, last error recorded | ⚠️ investigate |
Active in CMS but no recent iteration events for hours and no pending timer | Possibly stuck | ⚠️ investigate |
What "idle" actually means
When you call read_session_info and see no recent activity, that
does not mean the orchestration is dead. To distinguish a healthy
dormant session from a real stall, check all of:
- CMS state.
statefield.running/waiting/completed/failed/cancelled. Anything other thanfailedis not a fault per se. - Pending timers / events.
read_orchestration_stats(session_id)returnsqueue.pendingCountand KV counters. A non-zero queue means the orchestration has work waiting and will be picked up by the next worker. A zero queue withstate = waitingis also normal — it means the orchestration genuinely has nothing to do and is correctly dehydrated waiting on a stimulus (user input, cron wake-up, child completion). - Recent execution history.
read_execution_history(session_id, limit=20)shows the most recent activities and timers. If the last entry isWaitForUserInputorTimerFired waiting on cron, the session is idle by design. - Last checkpoint timestamp. From
read_session_metric_summary:lastCheckpointAt/lastDehydratedAt. A session dehydrated 3 hours ago, with no events since andstate = waiting, is healthy.
You only have a real stall when all of these are true:
stateisrunning- there is a pending event in the queue (
pendingCount > 0) - the last execution history entry is older than the orchestration turn timeout (typically minutes, not hours)
- no worker has picked it up
That combination usually means a worker crashed mid-turn or the session has lost affinity. Anything short of that is not a stall.
Cron sessions in particular
sweeper and facts-manager use low-frequency maintenance cron timers
(21600 seconds by default). pilotswarm and resourcemgr should not
maintain recurring cron loops; they wake from direct operator prompts or
runtime stimuli. Between ticks, cron sessions are dehydrated. Looking
at read_session_info for a sweeper between maintenance ticks, you will
see no live orchestration. That is correct.
The [cron 6h 0m] style chips you see in the sessions
pane mean "this session has a pending cron timer firing in N
seconds". The orchestration genuinely is not in memory — duroxide
will rehydrate it when the timer fires.
What to report instead
When asked "is this session healthy?", do not say "the orchestration is not running" unless you have verified the four-condition stall test above. Say one of:
- "Active and progressing." State=running, recent events.
- "Idle (waiting on user/cron/child) — healthy dormant." State=waiting or active-but-blocked, no pending stuck events.
- "Completed." State=completed.
- "Failed at
<step>with<error>." State=failed. - "Stalled." All four conditions of the stall test met. Recommend worker logs / restart.
Use these phrases. They map cleanly to operator action.
Things that look like bugs but are not
- No recent
agent_eventsinread_agent_events. Means no LLM turn has run recently. Expected for a dormant session. hydration_count == 0but the session is hours old. Means the session was created and ran exactly once, then dehydrated. Common for short reactive sessions.- Snapshot bytes growing. Normal — that's the point of the durable history.
pendingCount = 0and state =waiting. Healthy dormant. Not stuck.
In this repository50 other files it gives its agents.
- packages/sdk/examples/repo-workspaces/seed/home/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agent-repair-loopSkill
- duroxide-orchestration-versioningSkill
- editorial-standardsSkill
- finance-research-standardsSkill
- valuation-methodsSkill
- pilotswarm-architectureSkill
- deployment-safetySkill
- incident-responseSkill
- add-activitySkill
- add-eventSkill
- add-testSkill
- add-toolSkill
- agent-versioningSkill
- azure-ps-test-runner-vmSkill
- debug-orchestrationSkill
- debug-testSkill
- horizondb-idiosyncrasiesSkill
- horizon-facts-eval-sweepSkill
- investigate-duroxide-runtimeSkill
- pilotswarm-aks-deploySkill
- pilotswarm-aks-resetSkill
- pilotswarm-new-env-deploySkill
- pilotswarm-perfSkill
- pilotswarm-portal-app-regSkill
- pilotswarm-portal-auth-assignmentsSkill
- pilotswarm-releaseSkill
- pilotswarm-tuiSkill
- pilotswarm-vpn-client-profileSkill
- schema-migrationSkill
- notesSkill
- share-a-fileSkill
- cost-latency-analysisSkill
- graph-debugSkill
- resourcemgrSkill
- sweeperSkill
- canvas-appsSkill
- html-visualsSkill
- pilotswarm-agent-versioningSkill
- pilotswarm-aks-identitySkill
- pilotswarm-azure-deployerSkill
- pilotswarm-azure-lessonsSkill
- pilotswarm-cli-builderSkill
- pilotswarm-duroxide-versioningSkill
- pilotswarm-hybrid-datastoreSkill
- pilotswarm-knowledge-harvesterSkill
- pilotswarm-portal-builderSkill
- pilotswarm-sdk-builderSkill
- pilotswarm-three-tierSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

