Operations Runbook
Operations Runbook
หัวข้อที่มีชื่อว่า “Operations Runbook”1. Startup Checklist
หัวข้อที่มีชื่อว่า “1. Startup Checklist”kobi-aipoints to engine withAGENT_SERVICE_URL.- BFF and engine share the same internal contract version (
INTERNAL_API_CONTRACT_VERSION). - BFF service token and engine validation token are aligned (
ENGINE_SERVICE_AUTH_TOKEN/INTERNAL_ENGINE_TOKEN). - Engine points to running MCP URL (
MCP_SERVER_URL). - MCP has valid Supabase env names (runtime expects
SUPABASE_SERVICE_KEY). - All services expose health endpoints and return success.
2. Health Checks
หัวข้อที่มีชื่อว่า “2. Health Checks”curl http://localhost:8000/healthcurl -X POST http://localhost:3100/health -H "Content-Type: application/json" -d "{}"BFF AI Route (requires user token)
หัวข้อที่มีชื่อว่า “BFF AI Route (requires user token)”curl -X POST http://localhost:3000/api/ai/chat \ -H "Authorization: Bearer <USER_ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{"userMessage":"ping","threadId":"<thread_uuid>","agentType":"chat","projectId":"<project_uuid>","metadata":{}}'BFF Canvas Read Routes (requires user token)
หัวข้อที่มีชื่อว่า “BFF Canvas Read Routes (requires user token)”curl -G http://localhost:3000/api/canvas/workspace \ -H "Authorization: Bearer <USER_ACCESS_TOKEN>" \ --data-urlencode "agentId=strategy" \ --data-urlencode "projectId=<project_uuid>" \ --data-urlencode "threadId=<thread_uuid>" \ --data-urlencode "includeEdges=true"curl -G http://localhost:3000/api/canvas/context \ -H "Authorization: Bearer <USER_ACCESS_TOKEN>" \ --data-urlencode "agentId=strategy" \ --data-urlencode "projectId=<project_uuid>" \ --data-urlencode "threadId=<thread_uuid>" \ --data-urlencode "maxNodes=50" \ --data-urlencode "includeContent=true" \ --data-urlencode "includeRelationships=true"For full examples including internal route headers, see API and Event Contracts.
3. Critical Runtime Verifications
หัวข้อที่มีชื่อว่า “3. Critical Runtime Verifications”- First message path materializes thread via
/api/chat/threadsbefore/api/ai/*. /api/ai/*calls include normalized metadata only.- BFF forwards internal headers (
X-Contract-Version,X-User-Id,X-Project-Id,X-Thread-Id,X-Agent-Type). - Engine accepts request and logs workflow execution.
- MCP receives tool calls with approved context fields for side-effect tools.
- No legacy auto-reply fallback path is executed in chat runtime.
4. 400 and 403 Triage Order
หัวข้อที่มีชื่อว่า “4. 400 and 403 Triage Order”- BFF schema/allowlist errors:
- Unknown request keys.
- Unknown metadata keys.
threadId/sessionIdmismatch.- missing thread materialization (
threadIdmissing ornew).
- Engine internal contract errors:
- Missing/invalid
X-Contract-Version. - Missing required trusted headers.
- Header/body claim mismatch.
- Scope ownership errors:
- Thread not found for user.
- Project and thread mismatch.
- MCP/tool errors:
- Missing
approved/scope IDs for mutation tools. - Tool not registered in MCP.
5. Smoke Test Matrix
หัวข้อที่มีชื่อว่า “5. Smoke Test Matrix”- Non-streaming chat success path.
- Streaming chat emits
done. - HITL interrupt and approve resume path.
- HITL interrupt and reject resume path.
- Canvas workspace/context reads with scoped query.
- Canvas mutation with idempotency key.
- One MCP mutating tool call verifies persistence and idempotent retry.
6. Known Current Gaps
หัวข้อที่มีชื่อว่า “6. Known Current Gaps”- Engine configs still include some non-registered interaction tool names.
propose_deep_researchMCP registration currently lacks shared auth+gate set wiring in tool registry lists.- Internal canvas pull endpoint is ready in BFF, but current engine path does not call it.