investigate-duroxide-runtime
Skill14 starsChanged 8 months agoMITView on GitHub
Investigate live Duroxide orchestration behavior, session-affined activities, worker routing, hydration/dehydration, and AKS log/DB evidence. Use when tracing which pod ran a session activity, why warm state was missing, or whether a failure was caused by affinity loss, explicit dehydration, or a worker crash.
- Reads credentials
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 16 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when the problem is a live runtime or forensics issue, not a pure replay-code audit.
- Very specific: line 17
If the issue is a deterministic replay bug caused by orchestration code shape, use the sibling skill …
- Very specific: line 21
When warm in-memory Copilot state matters, compare session-affined activity placement, especially runTurn.
- Distinctive: line 23
Do not use orchestration-start placement as affinity evidence.
- Very specific: line 51
If you are unsure about columns, inspect information_schema.columns first instead of guessing.
- Distinctive: line 70
Read the CMS row first.
- Distinctive: line 85
If a suspect pod has restarts, inspect previous logs too:
- Very specific: line 91
Search all worker pods, not just one chosen by deployment/...
- Distinctive: line 103
Do not compare orchestration-start pod to activity pod and call that an affinity failure.
- Distinctive: line 105
Check for explicit dehydration.
- Distinctive: line 106
Look for orchestration traces like:
- Very specific: line 112
Look for corresponding dehydrateSession, hydrateSession, or checkpointSession activity traces if present.
- Distinctive: line 113
If none exist for that session before failure, do not claim it was explicitly dehydrated.
- Distinctive: line 221
no matching durable history evidence
- Distinctive: line 231
If the session is already failed or completed and later logs show:
- Distinctive: line 239
If runtime logs show:
- Distinctive: line 249
Do not infer affinity failure from orchestration-start placement.
- Distinctive: line 250
Do not infer crash from an unrelated pod restart elsewhere in the deployment.
- Distinctive: line 251
Do not claim explicit dehydrate without direct evidence.
- Very specific: line 252
Do not alarm on completion from different execution by itself.
- Distinctive: line 253
Prefer exact session IDs, execution IDs, and pod names in the write-up.
- Distinctive: line 254
If evidence is incomplete, say exactly what is proven and what remains inference.
≈ “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
Investigate Duroxide Runtime
Use this skill when the problem is a live runtime or forensics issue, not a pure replay-code audit.
Typical cases:
- a session failed with missing resumable state
- an activity appears to have landed on the wrong worker
- you need to tell orchestration placement apart from session activity placement
- you need evidence for crash vs affinity miss vs explicit dehydrate
- child updates or queued messages are arriving after a session already failed
If the issue is a deterministic replay bug caused by orchestration code shape, use the sibling skill .github/skills/debug-orchestration/SKILL.md.
Core Rule
When warm in-memory Copilot state matters, compare session-affined activity placement, especially runTurn.
Do not use orchestration-start placement as affinity evidence. Orchestration executions are stateless and may move between pods by design.
The important question is:
Which pod ran the relevant session activity for this execution?
Canonical Targets
- AKS context:
toygres-aks - Namespace:
copilot-runtime - Worker deployment:
copilot-runtime-worker
Canonical Files
- Orchestration:
packages/sdk/src/orchestration.ts - Session-affined activity registration:
packages/sdk/src/session-proxy.ts - Warm session lookup / hydrate logic:
packages/sdk/src/session-manager.ts - Session tool flow:
packages/sdk/src/managed-session.ts - Remote reset script:
scripts/db-reset.js - Hydration spot-check helper:
scripts/db-check-hydration.js
Canonical Tables
duroxide.instancesduroxide.executionsduroxide.historycopilot_sessions.sessions
If you are unsure about columns, inspect information_schema.columns first instead of guessing.
What To Prove
Try to answer these in order:
- What is the exact
session_idandinstance_id? - What is the CMS-visible failure or wait state?
- Which pod ran the relevant
runTurnactivity? - Was there an explicit
dehydrate,hydrate, orcheckpointbefore the failure? - Is there evidence of a pod restart or previous-container crash on that same pod?
- Did the session become terminal and then continue receiving queued messages?
Investigation Workflow
- Pin the identifiers.
- Session ID from CMS / TUI.
- Instance ID is usually
session-<session_id>.
- Read the CMS row first.
- Inspect
state,current_iteration,updated_at,last_error, andwait_reason. - This tells you whether the user-visible failure matches runtime evidence.
- Inspect
- Inspect Duroxide persistence.
- Query
duroxide.instancesfor the instance row. - Query
duroxide.executionsordered byexecution_id. - Query
duroxide.historyordered bycreated_at, event_id. - Absence of history can itself be evidence; do not assume every failure leaves rows there.
- Query
- Inspect worker pod health.
- Check pod restarts:
kubectl get pods -n copilot-runtime -l app.kubernetes.io/component=worker -o wide - If a suspect pod has restarts, inspect previous logs too:
kubectl logs -n copilot-runtime pod/<pod-name> --previous
- Check pod restarts:
- Collect cross-pod log evidence.
- Search all worker pods, not just one chosen by
deployment/...logs. - Look for:
[runTurn] session=<id>invoking ManagedSession.runTurn for <id>ManagedSession.runTurn completed for <id>fatal missing session statedehydrating sessionhydrate=true/hydrate=falseDropping orphan queue messages
- Search all worker pods, not just one chosen by
- Compare the right things.
- Compare the prior turn's
runTurnactivity pod to the failing turn'srunTurnactivity pod. - Do not compare orchestration-start pod to activity pod and call that an affinity failure.
- Compare the prior turn's
- Check for explicit dehydration.
- Look for orchestration traces like:
[orch] dehydrating sessionreason=cronreason=idlereason=timerreason=input_required
- Look for corresponding
dehydrateSession,hydrateSession, orcheckpointSessionactivity traces if present. - If none exist for that session before failure, do not claim it was explicitly dehydrated.
- Look for orchestration traces like:
- Classify the outcome conservatively.
explicit dehydrate: only if there is a direct trace or durable evidenceaffinity miss: only if the session-affined activity landed on a different pod than the previous warmrunTurnsame-pod warm-state miss: if the failingrunTurnlanded on the same pod but still could not find the sessionpod crash / restart: only if the same pod shows restart evidence or previous-container logs line up with the timing
Useful Commands
Cross-pod activity search
for p in $(kubectl get pods -n copilot-runtime -l app.kubernetes.io/component=worker -o name); do
echo "=== ${p##*/} ==="
kubectl logs -n copilot-runtime "$p" --since=12h | \
rg -n "\\[runTurn\\] session=<SESSION_ID>|invoking ManagedSession.runTurn for <SESSION_ID>|ManagedSession.runTurn completed for <SESSION_ID>|fatal missing session state|dehydrating session|Dropping orphan queue messages"
donePrevious logs for a restarted pod
kubectl logs -n copilot-runtime pod/<pod-name> --previous | \
rg -n "<SESSION_ID>|fatal missing session state|dehydrating session"CMS + Duroxide DB query
node --env-file=.env.remote - <<'NODE'
const { Client } = require('pg');
(async () => {
const sessionId = '<SESSION_ID>';
const instanceId = `session-${sessionId}`;
const c = new Client({ connectionString: process.env.DATABASE_URL, ssl: { rejectUnauthorized: false } });
await c.connect();
const cms = await c.query(`
select session_id, state, current_iteration, created_at, updated_at, last_error, wait_reason
from copilot_sessions.sessions
where session_id = $1
`, [sessionId]);
const inst = await c.query(`
select *
from duroxide.instances
where instance_id = $1
`, [instanceId]);
const execs = await c.query(`
select *
from duroxide.executions
where instance_id = $1
order by execution_id
`, [instanceId]);
const hist = await c.query(`
select *
from duroxide.history
where instance_id = $1
order by created_at, event_id
`, [instanceId]);
console.log('CMS', JSON.stringify(cms.rows, null, 2));
console.log('INST', JSON.stringify(inst.rows, null, 2));
console.log('EXECS', JSON.stringify(execs.rows, null, 2));
console.log('HIST', JSON.stringify(hist.rows, null, 2));
await c.end();
})();
NODESchema inspection when columns are uncertain
node --env-file=.env.remote - <<'NODE'
const { Client } = require('pg');
(async () => {
const c = new Client({ connectionString: process.env.DATABASE_URL, ssl: { rejectUnauthorized: false } });
await c.connect();
const rows = await c.query(`
select table_schema, table_name, column_name, data_type
from information_schema.columns
where table_schema in ('duroxide', 'copilot_sessions')
order by table_schema, table_name, ordinal_position
`);
for (const row of rows.rows) {
console.log(`${row.table_schema}.${row.table_name}\t${row.column_name}\t${row.data_type}`);
}
await c.end();
})();
NODEInterpretation Guide
Evidence for affinity miss
- Failing turn's
runTurnactivity is on podB - prior warm turn's
runTurnactivity was on podA - there is no explicit dehydrate/checkpoint/hydrate before the handoff
Evidence against explicit dehydrate
- no
[orch] dehydrating sessiontrace for that session - no
dehydrateSession/hydrateSession/checkpointSessiontrace - no matching durable history evidence
Evidence for crash / restart
- same suspect pod shows restart timing that lines up with the failure
kubectl logs --previouscontains the session or surrounding runtime failure- the pod that previously ran the warm
runTurnno longer has continuity around the failure window
Terminal-orphan pattern
If the session is already failed or completed and later logs show:
Dropping orphan queue messages — events enqueued before orchestration started are not supported
that usually means children or other senders kept enqueueing to a dead parent after the parent became terminal.
Benign completion from different execution warnings
If runtime logs show:
completion from different execution
do not treat that warning alone as an incident.
This commonly appears when a session has already continued-as-new or moved to a newer execution and a late completion from the prior execution arrives afterward. It is useful context for timing analysis, but it is usually benign unless it is paired with dropped work, a failed execution, or a user-visible regression.
Rules
- Do not infer affinity failure from orchestration-start placement.
- Do not infer crash from an unrelated pod restart elsewhere in the deployment.
- Do not claim explicit dehydrate without direct evidence.
- Do not alarm on
completion from different executionby itself; explain it as late prior-execution completion noise unless stronger evidence says otherwise. - Prefer exact session IDs, execution IDs, and pod names in the write-up.
- If evidence is incomplete, say exactly what is proven and what remains inference.
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
- 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
- orchestration-session-lifecycleSkill
- 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.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

