[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FCJTQWM6PQK2GD2TKY2PYT":3,"skill-same:01M7FCJTQWM6PQK2GD2TKY2PYT":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7FCJTQWM6PQK2GD2TKY2PYT","stress-test",null,"Full stress-test suite for stablehand — exercises tools, chaining, HITL, multi-model, code execution","iofold\u002Fstablehand","iofold","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F222223034?v=4","01M7FCJF2ZRV1TVCFJ14Q0DNQZ","iofold labs","01M7FCJF3JYVGWJJYFQMV5BWZP",15,"MIT","https:\u002F\u002Fgithub.com\u002Fiofold\u002Fstablehand\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fstress-test\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: stress-test\ndescription: Full stress-test suite for stablehand — exercises tools, chaining, HITL, multi-model, code execution\n---\n\n# Full stress test plan\n\n## API reference (quick)\n\n| Endpoint | Method | Returns |\n|----------|--------|---------|\n| `\u002Fapi\u002Fhealth` | GET | `{ status: \"ok\", ... }` |\n| `\u002Fapi\u002Fagents` | GET | `[ { id, name, harness, ... }, ... ]` |\n| `\u002Fapi\u002Fagents\u002F:id\u002Fmessage` | POST `{ content }` | `{ sessionId, messageId, conversationId }` |\n| `\u002Fapi\u002Fagents\u002F:id\u002Fsession` | POST `{ task }` | `{ sessionId }` (background run) |\n| `\u002Fapi\u002Fagents\u002F:id\u002Fsessions` | GET | `{ sessions: [{ id, status, ... }] }` |\n| `\u002Fapi\u002Fagents\u002F:id\u002Fconversations` | GET | `[ { id, agentId, ... } ]` (plain array) |\n| `\u002Fapi\u002Fagents\u002F:id\u002Fconversations\u002F:id\u002Fmessages` | GET | `[ { id, role, content, ... } ]` |\n| `\u002Fapi\u002Fagents\u002F:id\u002Finterrupts` | GET | `{ interrupts: [{ sessionId, toolName, ... }] }` |\n| `\u002Fapi\u002Fagents\u002F:id\u002Finterrupt` | POST `{ action, sessionId }` | `{ resolved: true, ... }` |\n| `\u002Fapi\u002Fsettings` | GET | `{ maxGlobalContainers, ... }` (13 keys, no wrapper) |\n| `\u002Fapi\u002Fsettings` | PUT `{ key: value }` | Updated settings object |\n| `\u002Fapi\u002Fevents` | GET `?type=...&limit=...` | `{ events: [...] }` |\n| `\u002Fapi\u002Ftriggers\u002Femit` | POST `{ type, payload }` | `{ ok: true }` |\n\n**UI routes** (SPA):\n- `\u002F` — Dashboard (agents list)\n- `\u002Fagents\u002F:id` — Agent detail (tabs: Overview, Sessions, Tools, etc.)\n- `\u002Fagents\u002F:id\u002Fconversations\u002Fnew` — New chat conversation\n- `\u002Fagents\u002F:id\u002Fconversations\u002F:conversationId` — Existing conversation\n- `\u002Fevents`, `\u002Ftools`, `\u002Fflow`, `\u002Fknowledge`, `\u002Ftriggers`, `\u002Fartifacts`, `\u002Fsettings`\n\n## Prerequisites\n\nThe full stack **must** be running with the sandbox profile before starting.\n\n```bash\ndocker compose up --build -d\n```\n\nVerify readiness:\n\n```bash\n# API responds\ncurl -sf http:\u002F\u002Flocalhost:3002\u002Fapi\u002Fagents > \u002Fdev\u002Fnull && echo \"API: OK\" || echo \"API: DOWN\"\n\n# Egress proxy is healthy (required for sandbox → LLM API connectivity)\ndocker compose ps egress-proxy --format '{{.Status}}' | grep -q healthy && echo \"Proxy: OK\" || echo \"Proxy: DOWN\"\n\n# MinIO is running (required for artifact tests)\ncurl -sf http:\u002F\u002Flocalhost:9000\u002Fminio\u002Fhealth\u002Flive > \u002Fdev\u002Fnull 2>&1 && echo \"MinIO: OK\" || echo \"MinIO: DOWN — artifact tests will be skipped\"\n\n# Sandbox harness images exist\nfor img in langgraph claude-agents pi-agent; do\n  docker image inspect \"stablehand\u002Fharness-${img}:latest\" > \u002Fdev\u002Fnull 2>&1 && echo \"Image ${img}: OK\" || echo \"Image ${img}: MISSING — run: docker compose up --build\"\ndone\n```\n\nAll checks must pass before proceeding. Without the sandbox profile, agents cannot reach external LLM APIs and tool proxying (emit-event, request-approval) will fail silently.\n\n## Known issues\n\n> **HITL lifecycle conflict (BUG-1): RESOLVED (2026-04-07).** Sessions now complete after interrupt\n> approval. The `stress.hitl.complete` event is reliably emitted. The original issue — lifecycle policy\n> destroying the container during `request-approval` blocking — has been fixed.\n\n> **Event chain agent compliance (BUG-2):** The trigger mechanism works correctly (trigger fires, chain-responder\n> session spawns and completes). However, the chain-responder agent does not reliably call `emit-event` with\n> `stress.chain.done`. This is an LLM instruction-following issue, not a system bug. The chain plumbing\n> itself is verified working.\n\n## Shared setup\n\n```bash\nset -euo pipefail\nAPI_BASE=\"http:\u002F\u002Flocalhost:3002\"\n\nagent_id() {\n  local name=\"$1\"\n  curl -s \"$API_BASE\u002Fapi\u002Fagents\" | jq -r --arg name \"$name\" 'first(.[] | select(.name == $name) | .id)'\n}\n\n# POST \u002Fapi\u002Fagents\u002F:id\u002Fmessage returns { sessionId, messageId, conversationId }\nsend_message() {\n  local agent_id=\"$1\"\n  local content=\"$2\"\n  curl -s -X POST \"$API_BASE\u002Fapi\u002Fagents\u002F$agent_id\u002Fmessage\" \\\n    -H 'Content-Type: application\u002Fjson' \\\n    -d \"$(jq -nc --arg content \"$content\" '{content: $content}')\" \\\n    | jq -r '.sessionId'\n}\n\n# GET \u002Fapi\u002Fagents\u002F:id\u002Fsessions returns { sessions: [...] }\nwait_for_session() {\n  local agent_id=\"$1\"\n  local session_id=\"$2\"\n  local ok_statuses=\"$3\"\n  local timeout=\"${4:-180}\"\n  local elapsed=0\n\n  while true; do\n    status=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$agent_id\u002Fsessions\" \\\n      | jq -r --arg sid \"$session_id\" 'first(.sessions[]? | select(.id == $sid) | .status) \u002F\u002F empty')\"\n    echo \"session=$session_id status=${status:-missing} (${elapsed}s)\"\n    [[ \" $ok_statuses \" == *\" $status \"* ]] && return 0\n    [[ \"$status\" =~ ^(failed|cancelled|rejected)$ ]] && return 1\n    # HITL: session may error due to container lifecycle but interrupt is persisted\n    if [[ \"$status\" == \"error\" ]]; then\n      has_interrupt=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$agent_id\u002Finterrupts\" \\\n        | jq --arg sid \"$session_id\" '[.interrupts[]? | select(.sessionId == $sid)] | length')\"\n      if [[ \"$has_interrupt\" -gt 0 ]]; then\n        echo \"  session errored but has pending interrupt (durable HITL)\"\n        return 0\n      fi\n      return 1\n    fi\n    ((elapsed+=3))\n    [[ $elapsed -ge $timeout ]] && { echo \"TIMEOUT after ${timeout}s\"; return 1; }\n    sleep 3\n  done\n}\n\n# Wait for a pending interrupt to appear for a session\nwait_for_interrupt() {\n  local agent_id=\"$1\"\n  local session_id=\"$2\"\n  local timeout=\"${3:-120}\"\n  local elapsed=0\n\n  while true; do\n    interrupt=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$agent_id\u002Finterrupts\" \\\n      | jq --arg sid \"$session_id\" 'first(.interrupts[]? | select(.sessionId == $sid))')\"\n    [[ \"$interrupt\" != \"null\" ]] && [[ -n \"$interrupt\" ]] && { echo \"$interrupt\"; return 0; }\n    ((elapsed+=3))\n    echo \"  waiting for interrupt... (${elapsed}s)\" >&2\n    [[ $elapsed -ge $timeout ]] && { echo \"TIMEOUT waiting for interrupt\" >&2; return 1; }\n    sleep 3\n  done\n}\n\n# POST \u002Fapi\u002Fagents\u002F:id\u002Finterrupt accepts { action, sessionId }\nresolve_interrupt() {\n  local agent_id=\"$1\"\n  local session_id=\"$2\"\n  local action=\"$3\"\n  curl -s -X POST \"$API_BASE\u002Fapi\u002Fagents\u002F$agent_id\u002Finterrupt\" \\\n    -H 'Content-Type: application\u002Fjson' \\\n    -d \"$(jq -nc --arg action \"$action\" --arg sessionId \"$session_id\" '{action: $action, sessionId: $sessionId}')\"\n}\n```\n\n---\n\n## Phase 1: Seed all agents\n\n```bash\nnpx tsx tests\u002Fstress\u002Fseed.ts\n\nLG_OPENAI_ID=\"$(agent_id stress-lg-openai)\"\nLG_GEMINI_ID=\"$(agent_id stress-lg-gemini)\"\nPI_OPENAI_ID=\"$(agent_id stress-pi-openai)\"\nPI_GEMINI_ID=\"$(agent_id stress-pi-gemini)\"\nCLAUDE_ID=\"$(agent_id stress-claude-sonnet)\"\nCHAIN_ID=\"$(agent_id stress-chain-responder)\"\nHITL_ID=\"$(agent_id stress-hitl)\"\n```\n\nExpected:\n- 7 stress agents imported\n- trigger registered: `stress.tools.complete -> stress-chain-responder`\n\nPass\u002Ffail:\n- Pass if every id above is non-empty\n- Fail if seed exits non-zero or any id is missing\n\n---\n\n## Phase 2: Tool execution (`stress-lg-openai`)\n\nRun the LangGraph agent with GPT-5.4 and verify it can call emit-event.\n\n```bash\nLG_OPENAI_SID=\"$(send_message \"$LG_OPENAI_ID\" \"Run the stress test now. Confirm you are operational and emit stress.tools.complete.\")\"\n\nwait_for_session \"$LG_OPENAI_ID\" \"$LG_OPENAI_SID\" \"completed error\"\n\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?type=stress.tools.complete&agentId=$LG_OPENAI_ID&limit=20\" \\\n  | jq '.events | length'\n```\n\nExpected:\n- Session reaches `completed` after emitting the event\n- `stress.tools.complete` event exists for this agent\n\nPass\u002Ffail:\n- Pass if event count > 0\n- Fail if no completion event is persisted\n\n---\n\n## Phase 3: Multi-model validation (`stress-lg-gemini`, `stress-pi-gemini`)\n\n### LangGraph + Gemini\n\n```bash\nLG_GEMINI_SID=\"$(send_message \"$LG_GEMINI_ID\" \"Verify Gemini LangGraph execution and emit stress.gemini.complete.\")\"\n\nwait_for_session \"$LG_GEMINI_ID\" \"$LG_GEMINI_SID\" \"completed\"\n\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?type=stress.gemini.complete&limit=20\" | jq '.events | length'\n```\n\n### PI Agent + Gemini\n\n```bash\nPI_GEMINI_SID=\"$(send_message \"$PI_GEMINI_ID\" \"Verify Gemini PI-agent execution and emit stress.pi-gemini.complete.\")\"\n\nwait_for_session \"$PI_GEMINI_ID\" \"$PI_GEMINI_SID\" \"completed\"\n\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?type=stress.pi-gemini.complete&limit=20\" | jq '.events | length'\n```\n\nExpected:\n- Both Gemini-backed agents complete successfully\n- Each emits its model-specific event\n\nPass\u002Ffail:\n- Pass if both sessions are `completed` and both event counts are > 0\n- Fail if either session errors or either event is missing\n\n---\n\n## Phase 4: Event chain (`stress-lg-openai` -> `stress-chain-responder`)\n\nEmit the trigger event externally, then verify the responder runs.\n\n```bash\nCHAIN_BEFORE=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$CHAIN_ID\u002Fsessions\" | jq '.sessions | length')\"\n\ncurl -s -X POST \"$API_BASE\u002Fapi\u002Ftriggers\u002Femit\" \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"type\":\"stress.tools.complete\",\"payload\":{\"source\":\"stress-test-skill\",\"ts\":0}}' \\\n  | jq .\n\n# Wait for a new session to appear\ntimeout=60 elapsed=0\nwhile true; do\n  CHAIN_SID=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$CHAIN_ID\u002Fsessions\" \\\n    | jq -r --argjson before \"$CHAIN_BEFORE\" 'if (.sessions | length) > $before then .sessions[0].id else empty end')\"\n  [[ -n \"$CHAIN_SID\" ]] && break\n  ((elapsed+=2))\n  [[ $elapsed -ge $timeout ]] && { echo \"TIMEOUT\"; break; }\n  sleep 2\ndone\n\nwait_for_session \"$CHAIN_ID\" \"$CHAIN_SID\" \"completed\"\n\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?type=stress.chain.done&limit=20\" | jq '.events | length'\n```\n\nExpected:\n- Trigger emission returns 200\n- `stress-chain-responder` receives a new session\n- `stress.chain.done` is persisted\n\nPass\u002Ffail:\n- Pass if a new responder session appears and completes\n- Fail if the trigger emits but no responder session starts\n\n---\n\n## Phase 5: Code execution (`stress-claude-sonnet`)\n\n```bash\nCLAUDE_SID=\"$(send_message \"$CLAUDE_ID\" \"Write the stress test file now, verify it exists, and emit stress.claude.complete.\")\"\n\nwait_for_session \"$CLAUDE_ID\" \"$CLAUDE_SID\" \"completed\"\n\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?type=stress.claude.complete&limit=20\" | jq '.events | length'\n```\n\nExpected:\n- Claude agent completes\n- event proves the write\u002Fverify workflow finished\n\nPass\u002Ffail:\n- Pass if session is `completed` and event count > 0\n- Fail otherwise\n\n---\n\n## Phase 6: HITL (`stress-hitl`) — approve, then reject\n\n> HITL lifecycle is fully functional. Sessions survive the interrupt and complete after approval\u002Frejection.\n\n### Approve path\n\n```bash\nHITL_APPROVE_SID=\"$(send_message \"$HITL_ID\" \"Request approval for writing stress test results, then emit stress.hitl.complete.\")\"\n\n# Wait for interrupt to appear (session may show running or error)\nINTERRUPT=\"$(wait_for_interrupt \"$HITL_ID\" \"$HITL_APPROVE_SID\")\"\necho \"$INTERRUPT\" | jq '{id, toolName, status}'\n\n# Approve\nresolve_interrupt \"$HITL_ID\" \"$HITL_APPROVE_SID\" \"approve\" | jq .\n\n# Check resolution\ncurl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$HITL_ID\u002Finterrupts\" \\\n  | jq --arg sid \"$HITL_APPROVE_SID\" '[.interrupts[]? | select(.sessionId == $sid)] | length'\n```\n\n### Reject path\n\n```bash\nHITL_REJECT_SID=\"$(send_message \"$HITL_ID\" \"Request approval again — this one will be rejected.\")\"\n\nINTERRUPT=\"$(wait_for_interrupt \"$HITL_ID\" \"$HITL_REJECT_SID\")\"\necho \"$INTERRUPT\" | jq '{id, toolName, status}'\n\nresolve_interrupt \"$HITL_ID\" \"$HITL_REJECT_SID\" \"reject\" | jq .\n\ncurl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$HITL_ID\u002Finterrupts\" \\\n  | jq --arg sid \"$HITL_REJECT_SID\" '[.interrupts[]? | select(.sessionId == $sid)] | length'\n```\n\nExpected:\n- Both runs produce a durable interrupt with `request-approval` tool\n- Approve and reject both resolve the interrupt (pending count → 0)\n- Sessions complete normally after approval; `stress.hitl.complete` event emitted on approve path\n\nPass\u002Ffail:\n- Pass if both interrupts are persisted and both resolutions clear the pending list\n- Fail if interrupts are not persisted or resolution fails\n\n---\n\n## Phase 7: Verify events persisted in `\u002Fapi\u002Fevents`\n\n```bash\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?limit=200\" | jq '[.events[].type] | unique'\n```\n\nConfirm these event types exist:\n- `stress.tools.complete`\n- `stress.gemini.complete`\n- `stress.pi-gemini.complete`\n- `stress.claude.complete`\n- `stress.hitl.complete`\n- `stress.chain.done` (unreliable — see BUG-2; chain mechanism works but agent may not emit)\n\nPass\u002Ffail:\n- Pass if the first 5 types are present in persisted events\n- `stress.chain.done` is best-effort due to BUG-2 (LLM compliance)\n- Fail if any of the first 5 event types is missing\n\n---\n\n## Phase 8: System settings API\n\n```bash\ncurl -s \"$API_BASE\u002Fapi\u002Fsettings\" | jq .\n\nSETTINGS_COUNT=\"$(curl -s \"$API_BASE\u002Fapi\u002Fsettings\" | jq 'keys | length')\"\nORIGINAL_MAX_CONCURRENT=\"$(curl -s \"$API_BASE\u002Fapi\u002Fsettings\" | jq -r '.maxConcurrentSessionsPerAgent')\"\n\ncurl -s -X PUT \"$API_BASE\u002Fapi\u002Fsettings\" \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"maxConcurrentSessionsPerAgent\":4}' \\\n  | jq .\n\nINVALID_SETTINGS_RESPONSE=\"$(curl -s -w $'\\n%{http_code}' -X PUT \"$API_BASE\u002Fapi\u002Fsettings\" \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"maxConcurrentSessionsPerAgent\":-1}')\"\nINVALID_SETTINGS_STATUS=\"${INVALID_SETTINGS_RESPONSE##*$'\\n'}\"\nINVALID_SETTINGS_BODY=\"${INVALID_SETTINGS_RESPONSE%$'\\n'*}\"\n\necho \"$INVALID_SETTINGS_BODY\" | jq .\n\nCURRENT_MAX_CONCURRENT=\"$(curl -s \"$API_BASE\u002Fapi\u002Fsettings\" | jq -r '.maxConcurrentSessionsPerAgent')\"\n\ncurl -s -X PUT \"$API_BASE\u002Fapi\u002Fsettings\" \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d \"$(jq -nc --argjson value \"$ORIGINAL_MAX_CONCURRENT\" '{maxConcurrentSessionsPerAgent: $value}')\" \\\n  | jq .\n```\n\nExpected:\n- `GET \u002Fapi\u002Fsettings` returns all 13 settings\n- `PUT \u002Fapi\u002Fsettings` persists a valid update to `maxConcurrentSessionsPerAgent`\n- invalid update returns 400 and does not overwrite the valid value\n- final restore returns the original value\n\nPass\u002Ffail:\n- Pass if `SETTINGS_COUNT=13`, `INVALID_SETTINGS_STATUS=400`, and `CURRENT_MAX_CONCURRENT=4` before restore\n- Fail if any settings key is missing, validation accepts the negative value, or the round-trip update does not persist\n\n---\n\n## Phase 9: Artifact storage\n\n```bash\n# MinIO must be running for artifact tests\nif curl -sf http:\u002F\u002Flocalhost:9000\u002Fminio\u002Fhealth\u002Flive > \u002Fdev\u002Fnull 2>&1; then\n  echo \"MinIO: OK\"\n\n  ARTIFACT_PAYLOAD=\"stress-test-artifact-payload\"\n\n  ARTIFACT_UPLOAD_RESPONSE=\"$(curl -s -X POST \"$API_BASE\u002Fapi\u002Fartifacts\u002Fupload-url\" \\\n    -H 'Content-Type: application\u002Fjson' \\\n    -d \"$(jq -nc --arg agentId \"$LG_OPENAI_ID\" --arg name \"stress-test-artifact.txt\" --arg mimeType \"text\u002Fplain\" --argjson sizeBytes 100 '{agentId: $agentId, name: $name, mimeType: $mimeType, sizeBytes: $sizeBytes}')\")\"\n\n  echo \"$ARTIFACT_UPLOAD_RESPONSE\" | jq .\n\n  ARTIFACT_ID=\"$(echo \"$ARTIFACT_UPLOAD_RESPONSE\" | jq -r '.artifactId')\"\n  ARTIFACT_UPLOAD_URL=\"$(echo \"$ARTIFACT_UPLOAD_RESPONSE\" | jq -r '.uploadUrl')\"\n\n  curl -s -X PUT \"$ARTIFACT_UPLOAD_URL\" \\\n    -H 'Content-Type: text\u002Fplain' \\\n    --data-binary \"$ARTIFACT_PAYLOAD\" \\\n    > \u002Fdev\u002Fnull\n\n  # List: GET \u002Fapi\u002Fartifacts?agentId=... returns { artifacts: [...] }\n  curl -s \"$API_BASE\u002Fapi\u002Fartifacts?agentId=$LG_OPENAI_ID\" | jq '.artifacts | length'\n\n  # Get single: GET \u002Fapi\u002Fartifacts\u002F:id returns the raw Artifact object (no wrapper)\n  curl -s \"$API_BASE\u002Fapi\u002Fartifacts\u002F$ARTIFACT_ID\" | jq '{id, name, mimeType, sizeBytes}'\n\n  ARTIFACT_DOWNLOAD_RESPONSE=\"$(curl -s \"$API_BASE\u002Fapi\u002Fartifacts\u002F$ARTIFACT_ID\u002Fdownload-url\")\"\n  ARTIFACT_DOWNLOAD_URL=\"$(echo \"$ARTIFACT_DOWNLOAD_RESPONSE\" | jq -r '.url')\"\n  DOWNLOADED_ARTIFACT_PAYLOAD=\"$(curl -s \"$ARTIFACT_DOWNLOAD_URL\")\"\n\n  curl -s -X DELETE \"$API_BASE\u002Fapi\u002Fartifacts\u002F$ARTIFACT_ID\" | jq .\n\n  REMAINING_ARTIFACTS=\"$(curl -s \"$API_BASE\u002Fapi\u002Fartifacts?agentId=$LG_OPENAI_ID\" | jq --arg artifact_id \"$ARTIFACT_ID\" '[.artifacts[]? | select(.id == $artifact_id)] | length')\"\nelse\n  echo \"MinIO: DOWN (skip artifact tests)\"\nfi\n```\n\nExpected:\n- Full artifact lifecycle works end-to-end: upload URL, direct upload, list, get, download URL, download, and delete\n- downloaded artifact content matches the original payload\n- deleted artifact no longer appears in the agent artifact list\n\nPass\u002Ffail:\n- Pass if upload succeeds, `DOWNLOADED_ARTIFACT_PAYLOAD` matches `ARTIFACT_PAYLOAD`, and `REMAINING_ARTIFACTS=0`\n- Fail if any artifact step returns non-200, MinIO is up but the lifecycle breaks, or downloaded content mismatches\n\n---\n\n## Phase 10: Durable HITL interrupt persistence\n\n```bash\nHITL_PERSIST_SID=\"$(send_message \"$HITL_ID\" \"Request approval for the durable interrupt persistence stress test, then emit stress.hitl.complete.\")\"\n\n# Wait for interrupt to appear\nPERSISTED_INTERRUPT=\"$(wait_for_interrupt \"$HITL_ID\" \"$HITL_PERSIST_SID\")\"\n\necho \"$PERSISTED_INTERRUPT\" | jq .\n\nPERSISTED_INTERRUPT_ID=\"$(echo \"$PERSISTED_INTERRUPT\" | jq -r '.id \u002F\u002F empty')\"\nPERSISTED_SESSION_ID=\"$(echo \"$PERSISTED_INTERRUPT\" | jq -r '.sessionId \u002F\u002F empty')\"\nPERSISTED_TOOL_NAME=\"$(echo \"$PERSISTED_INTERRUPT\" | jq -r '.toolName \u002F\u002F empty')\"\nPERSISTED_ARGS=\"$(echo \"$PERSISTED_INTERRUPT\" | jq -c '.args \u002F\u002F empty')\"\n\nresolve_interrupt \"$HITL_ID\" \"$HITL_PERSIST_SID\" \"approve\" | jq .\n\nsleep 3\n\nPENDING_AFTER_RESOLUTION=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$HITL_ID\u002Finterrupts\" \\\n  | jq --arg sid \"$HITL_PERSIST_SID\" '[.interrupts[]? | select(.sessionId == $sid)] | length')\"\n```\n\nExpected:\n- interrupt appears in `GET \u002Fapi\u002Fagents\u002F$HITL_ID\u002Finterrupts` with durable fields\n- pending interrupt response includes id, sessionId, toolName, and args\n- `POST \u002Fapi\u002Fagents\u002F$HITL_ID\u002Finterrupt` resolves the interrupt\n- resolved interrupt no longer appears in the pending interrupts list\n\nPass\u002Ffail:\n- Pass if `PERSISTED_INTERRUPT_ID`, `PERSISTED_SESSION_ID`, `PERSISTED_TOOL_NAME`, and `PERSISTED_ARGS` are present before resolution and `PENDING_AFTER_RESOLUTION=0`\n- Fail if the interrupt is not persisted, the resolve call fails, or the interrupt remains pending after resolution\n\n---\n\n## Post-run cleanup (manual, after human verification)\n\nDo NOT run cleanup as part of the test. Cleanup deletes agents and cascade-deletes\ntheir events, sessions, and messages — making post-hoc verification impossible.\n\nRun only after the human has reviewed all results:\n\n```bash\nnpx tsx tests\u002Fstress\u002Fseed.ts --clean\n```\n","# Full stress test plan\n\n## API reference (quick)\n\n| Endpoint | Method | Returns |\n|----------|--------|---------|\n| `\u002Fapi\u002Fhealth` | GET | `{ status: \"ok\", ... }` |\n| `\u002Fapi\u002Fagents` | GET | `[ { id, name, harness, ... }, ... ]` |\n| `\u002Fapi\u002Fagents\u002F:id\u002Fmessage` | POST `{ content }` | `{ sessionId, messageId, conversationId }` |\n| `\u002Fapi\u002Fagents\u002F:id\u002Fsession` | POST `{ task }` | `{ sessionId }` (background run) |\n| `\u002Fapi\u002Fagents\u002F:id\u002Fsessions` | GET | `{ sessions: [{ id, status, ... }] }` |\n| `\u002Fapi\u002Fagents\u002F:id\u002Fconversations` | GET | `[ { id, agentId, ... } ]` (plain array) |\n| `\u002Fapi\u002Fagents\u002F:id\u002Fconversations\u002F:id\u002Fmessages` | GET | `[ { id, role, content, ... } ]` |\n| `\u002Fapi\u002Fagents\u002F:id\u002Finterrupts` | GET | `{ interrupts: [{ sessionId, toolName, ... }] }` |\n| `\u002Fapi\u002Fagents\u002F:id\u002Finterrupt` | POST `{ action, sessionId }` | `{ resolved: true, ... }` |\n| `\u002Fapi\u002Fsettings` | GET | `{ maxGlobalContainers, ... }` (13 keys, no wrapper) |\n| `\u002Fapi\u002Fsettings` | PUT `{ key: value }` | Updated settings object |\n| `\u002Fapi\u002Fevents` | GET `?type=...&limit=...` | `{ events: [...] }` |\n| `\u002Fapi\u002Ftriggers\u002Femit` | POST `{ type, payload }` | `{ ok: true }` |\n\n**UI routes** (SPA):\n- `\u002F` — Dashboard (agents list)\n- `\u002Fagents\u002F:id` — Agent detail (tabs: Overview, Sessions, Tools, etc.)\n- `\u002Fagents\u002F:id\u002Fconversations\u002Fnew` — New chat conversation\n- `\u002Fagents\u002F:id\u002Fconversations\u002F:conversationId` — Existing conversation\n- `\u002Fevents`, `\u002Ftools`, `\u002Fflow`, `\u002Fknowledge`, `\u002Ftriggers`, `\u002Fartifacts`, `\u002Fsettings`\n\n## Prerequisites\n\nThe full stack **must** be running with the sandbox profile before starting.\n\n```bash\ndocker compose up --build -d\n```\n\nVerify readiness:\n\n```bash\n# API responds\ncurl -sf http:\u002F\u002Flocalhost:3002\u002Fapi\u002Fagents > \u002Fdev\u002Fnull && echo \"API: OK\" || echo \"API: DOWN\"\n\n# Egress proxy is healthy (required for sandbox → LLM API connectivity)\ndocker compose ps egress-proxy --format '{{.Status}}' | grep -q healthy && echo \"Proxy: OK\" || echo \"Proxy: DOWN\"\n\n# MinIO is running (required for artifact tests)\ncurl -sf http:\u002F\u002Flocalhost:9000\u002Fminio\u002Fhealth\u002Flive > \u002Fdev\u002Fnull 2>&1 && echo \"MinIO: OK\" || echo \"MinIO: DOWN — artifact tests will be skipped\"\n\n# Sandbox harness images exist\nfor img in langgraph claude-agents pi-agent; do\n  docker image inspect \"stablehand\u002Fharness-${img}:latest\" > \u002Fdev\u002Fnull 2>&1 && echo \"Image ${img}: OK\" || echo \"Image ${img}: MISSING — run: docker compose up --build\"\ndone\n```\n\nAll checks must pass before proceeding. Without the sandbox profile, agents cannot reach external LLM APIs and tool proxying (emit-event, request-approval) will fail silently.\n\n## Known issues\n\n> **HITL lifecycle conflict (BUG-1): RESOLVED (2026-04-07).** Sessions now complete after interrupt\n> approval. The `stress.hitl.complete` event is reliably emitted. The original issue — lifecycle policy\n> destroying the container during `request-approval` blocking — has been fixed.\n\n> **Event chain agent compliance (BUG-2):** The trigger mechanism works correctly (trigger fires, chain-responder\n> session spawns and completes). However, the chain-responder agent does not reliably call `emit-event` with\n> `stress.chain.done`. This is an LLM instruction-following issue, not a system bug. The chain plumbing\n> itself is verified working.\n\n## Shared setup\n\n```bash\nset -euo pipefail\nAPI_BASE=\"http:\u002F\u002Flocalhost:3002\"\n\nagent_id() {\n  local name=\"$1\"\n  curl -s \"$API_BASE\u002Fapi\u002Fagents\" | jq -r --arg name \"$name\" 'first(.[] | select(.name == $name) | .id)'\n}\n\n# POST \u002Fapi\u002Fagents\u002F:id\u002Fmessage returns { sessionId, messageId, conversationId }\nsend_message() {\n  local agent_id=\"$1\"\n  local content=\"$2\"\n  curl -s -X POST \"$API_BASE\u002Fapi\u002Fagents\u002F$agent_id\u002Fmessage\" \\\n    -H 'Content-Type: application\u002Fjson' \\\n    -d \"$(jq -nc --arg content \"$content\" '{content: $content}')\" \\\n    | jq -r '.sessionId'\n}\n\n# GET \u002Fapi\u002Fagents\u002F:id\u002Fsessions returns { sessions: [...] }\nwait_for_session() {\n  local agent_id=\"$1\"\n  local session_id=\"$2\"\n  local ok_statuses=\"$3\"\n  local timeout=\"${4:-180}\"\n  local elapsed=0\n\n  while true; do\n    status=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$agent_id\u002Fsessions\" \\\n      | jq -r --arg sid \"$session_id\" 'first(.sessions[]? | select(.id == $sid) | .status) \u002F\u002F empty')\"\n    echo \"session=$session_id status=${status:-missing} (${elapsed}s)\"\n    [[ \" $ok_statuses \" == *\" $status \"* ]] && return 0\n    [[ \"$status\" =~ ^(failed|cancelled|rejected)$ ]] && return 1\n    # HITL: session may error due to container lifecycle but interrupt is persisted\n    if [[ \"$status\" == \"error\" ]]; then\n      has_interrupt=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$agent_id\u002Finterrupts\" \\\n        | jq --arg sid \"$session_id\" '[.interrupts[]? | select(.sessionId == $sid)] | length')\"\n      if [[ \"$has_interrupt\" -gt 0 ]]; then\n        echo \"  session errored but has pending interrupt (durable HITL)\"\n        return 0\n      fi\n      return 1\n    fi\n    ((elapsed+=3))\n    [[ $elapsed -ge $timeout ]] && { echo \"TIMEOUT after ${timeout}s\"; return 1; }\n    sleep 3\n  done\n}\n\n# Wait for a pending interrupt to appear for a session\nwait_for_interrupt() {\n  local agent_id=\"$1\"\n  local session_id=\"$2\"\n  local timeout=\"${3:-120}\"\n  local elapsed=0\n\n  while true; do\n    interrupt=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$agent_id\u002Finterrupts\" \\\n      | jq --arg sid \"$session_id\" 'first(.interrupts[]? | select(.sessionId == $sid))')\"\n    [[ \"$interrupt\" != \"null\" ]] && [[ -n \"$interrupt\" ]] && { echo \"$interrupt\"; return 0; }\n    ((elapsed+=3))\n    echo \"  waiting for interrupt... (${elapsed}s)\" >&2\n    [[ $elapsed -ge $timeout ]] && { echo \"TIMEOUT waiting for interrupt\" >&2; return 1; }\n    sleep 3\n  done\n}\n\n# POST \u002Fapi\u002Fagents\u002F:id\u002Finterrupt accepts { action, sessionId }\nresolve_interrupt() {\n  local agent_id=\"$1\"\n  local session_id=\"$2\"\n  local action=\"$3\"\n  curl -s -X POST \"$API_BASE\u002Fapi\u002Fagents\u002F$agent_id\u002Finterrupt\" \\\n    -H 'Content-Type: application\u002Fjson' \\\n    -d \"$(jq -nc --arg action \"$action\" --arg sessionId \"$session_id\" '{action: $action, sessionId: $sessionId}')\"\n}\n```\n\n---\n\n## Phase 1: Seed all agents\n\n```bash\nnpx tsx tests\u002Fstress\u002Fseed.ts\n\nLG_OPENAI_ID=\"$(agent_id stress-lg-openai)\"\nLG_GEMINI_ID=\"$(agent_id stress-lg-gemini)\"\nPI_OPENAI_ID=\"$(agent_id stress-pi-openai)\"\nPI_GEMINI_ID=\"$(agent_id stress-pi-gemini)\"\nCLAUDE_ID=\"$(agent_id stress-claude-sonnet)\"\nCHAIN_ID=\"$(agent_id stress-chain-responder)\"\nHITL_ID=\"$(agent_id stress-hitl)\"\n```\n\nExpected:\n- 7 stress agents imported\n- trigger registered: `stress.tools.complete -> stress-chain-responder`\n\nPass\u002Ffail:\n- Pass if every id above is non-empty\n- Fail if seed exits non-zero or any id is missing\n\n---\n\n## Phase 2: Tool execution (`stress-lg-openai`)\n\nRun the LangGraph agent with GPT-5.4 and verify it can call emit-event.\n\n```bash\nLG_OPENAI_SID=\"$(send_message \"$LG_OPENAI_ID\" \"Run the stress test now. Confirm you are operational and emit stress.tools.complete.\")\"\n\nwait_for_session \"$LG_OPENAI_ID\" \"$LG_OPENAI_SID\" \"completed error\"\n\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?type=stress.tools.complete&agentId=$LG_OPENAI_ID&limit=20\" \\\n  | jq '.events | length'\n```\n\nExpected:\n- Session reaches `completed` after emitting the event\n- `stress.tools.complete` event exists for this agent\n\nPass\u002Ffail:\n- Pass if event count > 0\n- Fail if no completion event is persisted\n\n---\n\n## Phase 3: Multi-model validation (`stress-lg-gemini`, `stress-pi-gemini`)\n\n### LangGraph + Gemini\n\n```bash\nLG_GEMINI_SID=\"$(send_message \"$LG_GEMINI_ID\" \"Verify Gemini LangGraph execution and emit stress.gemini.complete.\")\"\n\nwait_for_session \"$LG_GEMINI_ID\" \"$LG_GEMINI_SID\" \"completed\"\n\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?type=stress.gemini.complete&limit=20\" | jq '.events | length'\n```\n\n### PI Agent + Gemini\n\n```bash\nPI_GEMINI_SID=\"$(send_message \"$PI_GEMINI_ID\" \"Verify Gemini PI-agent execution and emit stress.pi-gemini.complete.\")\"\n\nwait_for_session \"$PI_GEMINI_ID\" \"$PI_GEMINI_SID\" \"completed\"\n\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?type=stress.pi-gemini.complete&limit=20\" | jq '.events | length'\n```\n\nExpected:\n- Both Gemini-backed agents complete successfully\n- Each emits its model-specific event\n\nPass\u002Ffail:\n- Pass if both sessions are `completed` and both event counts are > 0\n- Fail if either session errors or either event is missing\n\n---\n\n## Phase 4: Event chain (`stress-lg-openai` -> `stress-chain-responder`)\n\nEmit the trigger event externally, then verify the responder runs.\n\n```bash\nCHAIN_BEFORE=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$CHAIN_ID\u002Fsessions\" | jq '.sessions | length')\"\n\ncurl -s -X POST \"$API_BASE\u002Fapi\u002Ftriggers\u002Femit\" \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"type\":\"stress.tools.complete\",\"payload\":{\"source\":\"stress-test-skill\",\"ts\":0}}' \\\n  | jq .\n\n# Wait for a new session to appear\ntimeout=60 elapsed=0\nwhile true; do\n  CHAIN_SID=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$CHAIN_ID\u002Fsessions\" \\\n    | jq -r --argjson before \"$CHAIN_BEFORE\" 'if (.sessions | length) > $before then .sessions[0].id else empty end')\"\n  [[ -n \"$CHAIN_SID\" ]] && break\n  ((elapsed+=2))\n  [[ $elapsed -ge $timeout ]] && { echo \"TIMEOUT\"; break; }\n  sleep 2\ndone\n\nwait_for_session \"$CHAIN_ID\" \"$CHAIN_SID\" \"completed\"\n\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?type=stress.chain.done&limit=20\" | jq '.events | length'\n```\n\nExpected:\n- Trigger emission returns 200\n- `stress-chain-responder` receives a new session\n- `stress.chain.done` is persisted\n\nPass\u002Ffail:\n- Pass if a new responder session appears and completes\n- Fail if the trigger emits but no responder session starts\n\n---\n\n## Phase 5: Code execution (`stress-claude-sonnet`)\n\n```bash\nCLAUDE_SID=\"$(send_message \"$CLAUDE_ID\" \"Write the stress test file now, verify it exists, and emit stress.claude.complete.\")\"\n\nwait_for_session \"$CLAUDE_ID\" \"$CLAUDE_SID\" \"completed\"\n\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?type=stress.claude.complete&limit=20\" | jq '.events | length'\n```\n\nExpected:\n- Claude agent completes\n- event proves the write\u002Fverify workflow finished\n\nPass\u002Ffail:\n- Pass if session is `completed` and event count > 0\n- Fail otherwise\n\n---\n\n## Phase 6: HITL (`stress-hitl`) — approve, then reject\n\n> HITL lifecycle is fully functional. Sessions survive the interrupt and complete after approval\u002Frejection.\n\n### Approve path\n\n```bash\nHITL_APPROVE_SID=\"$(send_message \"$HITL_ID\" \"Request approval for writing stress test results, then emit stress.hitl.complete.\")\"\n\n# Wait for interrupt to appear (session may show running or error)\nINTERRUPT=\"$(wait_for_interrupt \"$HITL_ID\" \"$HITL_APPROVE_SID\")\"\necho \"$INTERRUPT\" | jq '{id, toolName, status}'\n\n# Approve\nresolve_interrupt \"$HITL_ID\" \"$HITL_APPROVE_SID\" \"approve\" | jq .\n\n# Check resolution\ncurl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$HITL_ID\u002Finterrupts\" \\\n  | jq --arg sid \"$HITL_APPROVE_SID\" '[.interrupts[]? | select(.sessionId == $sid)] | length'\n```\n\n### Reject path\n\n```bash\nHITL_REJECT_SID=\"$(send_message \"$HITL_ID\" \"Request approval again — this one will be rejected.\")\"\n\nINTERRUPT=\"$(wait_for_interrupt \"$HITL_ID\" \"$HITL_REJECT_SID\")\"\necho \"$INTERRUPT\" | jq '{id, toolName, status}'\n\nresolve_interrupt \"$HITL_ID\" \"$HITL_REJECT_SID\" \"reject\" | jq .\n\ncurl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$HITL_ID\u002Finterrupts\" \\\n  | jq --arg sid \"$HITL_REJECT_SID\" '[.interrupts[]? | select(.sessionId == $sid)] | length'\n```\n\nExpected:\n- Both runs produce a durable interrupt with `request-approval` tool\n- Approve and reject both resolve the interrupt (pending count → 0)\n- Sessions complete normally after approval; `stress.hitl.complete` event emitted on approve path\n\nPass\u002Ffail:\n- Pass if both interrupts are persisted and both resolutions clear the pending list\n- Fail if interrupts are not persisted or resolution fails\n\n---\n\n## Phase 7: Verify events persisted in `\u002Fapi\u002Fevents`\n\n```bash\ncurl -s \"$API_BASE\u002Fapi\u002Fevents?limit=200\" | jq '[.events[].type] | unique'\n```\n\nConfirm these event types exist:\n- `stress.tools.complete`\n- `stress.gemini.complete`\n- `stress.pi-gemini.complete`\n- `stress.claude.complete`\n- `stress.hitl.complete`\n- `stress.chain.done` (unreliable — see BUG-2; chain mechanism works but agent may not emit)\n\nPass\u002Ffail:\n- Pass if the first 5 types are present in persisted events\n- `stress.chain.done` is best-effort due to BUG-2 (LLM compliance)\n- Fail if any of the first 5 event types is missing\n\n---\n\n## Phase 8: System settings API\n\n```bash\ncurl -s \"$API_BASE\u002Fapi\u002Fsettings\" | jq .\n\nSETTINGS_COUNT=\"$(curl -s \"$API_BASE\u002Fapi\u002Fsettings\" | jq 'keys | length')\"\nORIGINAL_MAX_CONCURRENT=\"$(curl -s \"$API_BASE\u002Fapi\u002Fsettings\" | jq -r '.maxConcurrentSessionsPerAgent')\"\n\ncurl -s -X PUT \"$API_BASE\u002Fapi\u002Fsettings\" \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"maxConcurrentSessionsPerAgent\":4}' \\\n  | jq .\n\nINVALID_SETTINGS_RESPONSE=\"$(curl -s -w $'\\n%{http_code}' -X PUT \"$API_BASE\u002Fapi\u002Fsettings\" \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"maxConcurrentSessionsPerAgent\":-1}')\"\nINVALID_SETTINGS_STATUS=\"${INVALID_SETTINGS_RESPONSE##*$'\\n'}\"\nINVALID_SETTINGS_BODY=\"${INVALID_SETTINGS_RESPONSE%$'\\n'*}\"\n\necho \"$INVALID_SETTINGS_BODY\" | jq .\n\nCURRENT_MAX_CONCURRENT=\"$(curl -s \"$API_BASE\u002Fapi\u002Fsettings\" | jq -r '.maxConcurrentSessionsPerAgent')\"\n\ncurl -s -X PUT \"$API_BASE\u002Fapi\u002Fsettings\" \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d \"$(jq -nc --argjson value \"$ORIGINAL_MAX_CONCURRENT\" '{maxConcurrentSessionsPerAgent: $value}')\" \\\n  | jq .\n```\n\nExpected:\n- `GET \u002Fapi\u002Fsettings` returns all 13 settings\n- `PUT \u002Fapi\u002Fsettings` persists a valid update to `maxConcurrentSessionsPerAgent`\n- invalid update returns 400 and does not overwrite the valid value\n- final restore returns the original value\n\nPass\u002Ffail:\n- Pass if `SETTINGS_COUNT=13`, `INVALID_SETTINGS_STATUS=400`, and `CURRENT_MAX_CONCURRENT=4` before restore\n- Fail if any settings key is missing, validation accepts the negative value, or the round-trip update does not persist\n\n---\n\n## Phase 9: Artifact storage\n\n```bash\n# MinIO must be running for artifact tests\nif curl -sf http:\u002F\u002Flocalhost:9000\u002Fminio\u002Fhealth\u002Flive > \u002Fdev\u002Fnull 2>&1; then\n  echo \"MinIO: OK\"\n\n  ARTIFACT_PAYLOAD=\"stress-test-artifact-payload\"\n\n  ARTIFACT_UPLOAD_RESPONSE=\"$(curl -s -X POST \"$API_BASE\u002Fapi\u002Fartifacts\u002Fupload-url\" \\\n    -H 'Content-Type: application\u002Fjson' \\\n    -d \"$(jq -nc --arg agentId \"$LG_OPENAI_ID\" --arg name \"stress-test-artifact.txt\" --arg mimeType \"text\u002Fplain\" --argjson sizeBytes 100 '{agentId: $agentId, name: $name, mimeType: $mimeType, sizeBytes: $sizeBytes}')\")\"\n\n  echo \"$ARTIFACT_UPLOAD_RESPONSE\" | jq .\n\n  ARTIFACT_ID=\"$(echo \"$ARTIFACT_UPLOAD_RESPONSE\" | jq -r '.artifactId')\"\n  ARTIFACT_UPLOAD_URL=\"$(echo \"$ARTIFACT_UPLOAD_RESPONSE\" | jq -r '.uploadUrl')\"\n\n  curl -s -X PUT \"$ARTIFACT_UPLOAD_URL\" \\\n    -H 'Content-Type: text\u002Fplain' \\\n    --data-binary \"$ARTIFACT_PAYLOAD\" \\\n    > \u002Fdev\u002Fnull\n\n  # List: GET \u002Fapi\u002Fartifacts?agentId=... returns { artifacts: [...] }\n  curl -s \"$API_BASE\u002Fapi\u002Fartifacts?agentId=$LG_OPENAI_ID\" | jq '.artifacts | length'\n\n  # Get single: GET \u002Fapi\u002Fartifacts\u002F:id returns the raw Artifact object (no wrapper)\n  curl -s \"$API_BASE\u002Fapi\u002Fartifacts\u002F$ARTIFACT_ID\" | jq '{id, name, mimeType, sizeBytes}'\n\n  ARTIFACT_DOWNLOAD_RESPONSE=\"$(curl -s \"$API_BASE\u002Fapi\u002Fartifacts\u002F$ARTIFACT_ID\u002Fdownload-url\")\"\n  ARTIFACT_DOWNLOAD_URL=\"$(echo \"$ARTIFACT_DOWNLOAD_RESPONSE\" | jq -r '.url')\"\n  DOWNLOADED_ARTIFACT_PAYLOAD=\"$(curl -s \"$ARTIFACT_DOWNLOAD_URL\")\"\n\n  curl -s -X DELETE \"$API_BASE\u002Fapi\u002Fartifacts\u002F$ARTIFACT_ID\" | jq .\n\n  REMAINING_ARTIFACTS=\"$(curl -s \"$API_BASE\u002Fapi\u002Fartifacts?agentId=$LG_OPENAI_ID\" | jq --arg artifact_id \"$ARTIFACT_ID\" '[.artifacts[]? | select(.id == $artifact_id)] | length')\"\nelse\n  echo \"MinIO: DOWN (skip artifact tests)\"\nfi\n```\n\nExpected:\n- Full artifact lifecycle works end-to-end: upload URL, direct upload, list, get, download URL, download, and delete\n- downloaded artifact content matches the original payload\n- deleted artifact no longer appears in the agent artifact list\n\nPass\u002Ffail:\n- Pass if upload succeeds, `DOWNLOADED_ARTIFACT_PAYLOAD` matches `ARTIFACT_PAYLOAD`, and `REMAINING_ARTIFACTS=0`\n- Fail if any artifact step returns non-200, MinIO is up but the lifecycle breaks, or downloaded content mismatches\n\n---\n\n## Phase 10: Durable HITL interrupt persistence\n\n```bash\nHITL_PERSIST_SID=\"$(send_message \"$HITL_ID\" \"Request approval for the durable interrupt persistence stress test, then emit stress.hitl.complete.\")\"\n\n# Wait for interrupt to appear\nPERSISTED_INTERRUPT=\"$(wait_for_interrupt \"$HITL_ID\" \"$HITL_PERSIST_SID\")\"\n\necho \"$PERSISTED_INTERRUPT\" | jq .\n\nPERSISTED_INTERRUPT_ID=\"$(echo \"$PERSISTED_INTERRUPT\" | jq -r '.id \u002F\u002F empty')\"\nPERSISTED_SESSION_ID=\"$(echo \"$PERSISTED_INTERRUPT\" | jq -r '.sessionId \u002F\u002F empty')\"\nPERSISTED_TOOL_NAME=\"$(echo \"$PERSISTED_INTERRUPT\" | jq -r '.toolName \u002F\u002F empty')\"\nPERSISTED_ARGS=\"$(echo \"$PERSISTED_INTERRUPT\" | jq -c '.args \u002F\u002F empty')\"\n\nresolve_interrupt \"$HITL_ID\" \"$HITL_PERSIST_SID\" \"approve\" | jq .\n\nsleep 3\n\nPENDING_AFTER_RESOLUTION=\"$(curl -s \"$API_BASE\u002Fapi\u002Fagents\u002F$HITL_ID\u002Finterrupts\" \\\n  | jq --arg sid \"$HITL_PERSIST_SID\" '[.interrupts[]? | select(.sessionId == $sid)] | length')\"\n```\n\nExpected:\n- interrupt appears in `GET \u002Fapi\u002Fagents\u002F$HITL_ID\u002Finterrupts` with durable fields\n- pending interrupt response includes id, sessionId, toolName, and args\n- `POST \u002Fapi\u002Fagents\u002F$HITL_ID\u002Finterrupt` resolves the interrupt\n- resolved interrupt no longer appears in the pending interrupts list\n\nPass\u002Ffail:\n- Pass if `PERSISTED_INTERRUPT_ID`, `PERSISTED_SESSION_ID`, `PERSISTED_TOOL_NAME`, and `PERSISTED_ARGS` are present before resolution and `PENDING_AFTER_RESOLUTION=0`\n- Fail if the interrupt is not persisted, the resolve call fails, or the interrupt remains pending after resolution\n\n---\n\n## Post-run cleanup (manual, after human verification)\n\nDo NOT run cleanup as part of the test. Cleanup deletes agents and cascade-deletes\ntheir events, sessions, and messages — making post-hoc verification impossible.\n\nRun only after the human has reviewed all results:\n\n```bash\nnpx tsx tests\u002Fstress\u002Fseed.ts --clean\n```\n",{"name":5,"description":7},"master","a9a59695ebb742b916e971e66698adf3febd5ded",".claude\u002Fskills\u002Fstress-test",2,"https:\u002F\u002Fgithub.com\u002Fiofold\u002Fstablehand","https:\u002F\u002Fgithub.com\u002Fiofold","https:\u002F\u002Fiofold.com","2026-10-25 03:18:01",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add iofold\u002Fstablehand --skill stress-test",{"tool":38,"command":39},"bunx","bunx skills add iofold\u002Fstablehand --skill stress-test",{"tool":41,"command":42},"pnpm","pnpm dlx skills add iofold\u002Fstablehand --skill stress-test","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fiofold\u002Fstablehand\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fstress-test\u002FSKILL.md",true,[],[47,52,59,66,73],{"skillNo":48,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M7FCK9GNTR4E28Y26KQ0EAKE","https:\u002F\u002Fgithub.com\u002Fiofold\u002Fstablehand\u002Fblob\u002Fmaster\u002Ftests\u002Fstress\u002Fskills\u002Fstress-test\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7FCK6RBDVT7CPWYYRTAD9ZW","smoke-test","Quick stress-test smoke validation for stablehand — verifies each harness and model works","https:\u002F\u002Fgithub.com\u002Fiofold\u002Fstablehand\u002Fblob\u002Fmaster\u002Ftests\u002Fstress\u002Fskills\u002Fsmoke-test\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7FCK3G6N72SGSJVAYECX16F","code-review","Provides code review guidelines and best practices","https:\u002F\u002Fgithub.com\u002Fiofold\u002Fstablehand\u002Fblob\u002Fmaster\u002Fpackages\u002Fexamples\u002Fkitchen-sink\u002Fagents\u002Ftest-claude-features\u002Fskills\u002Fcode-review\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7FCJZ2G9HJYF8JTVH3RWRN3","stablehand-cli","Use when operating, debugging, or inspecting a stablehand app via its HTTP API. Wraps agent\u002Fturn\u002Fconversation\u002Fsandbox-session\u002Fevent\u002Fartifact\u002Ffile\u002Fsecret\u002Fsetting\u002Ftrigger\u002Fwebhook operations, feedback submission, SSE and AG-UI wire streaming, multipart uploads, and gzip uploads with bundled Bun TypeScript CLIs.","https:\u002F\u002Fgithub.com\u002Fiofold\u002Fstablehand\u002Fblob\u002Fmaster\u002F.codex\u002Fskills\u002Fstablehand-cli\u002FSKILL.md",[],[],{"skillNo":74,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7FCJQE4893SAHM3HY3P8N2J","https:\u002F\u002Fgithub.com\u002Fiofold\u002Fstablehand\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fsmoke-test\u002FSKILL.md",[],[]]