Files
selfheal-lab-apps/ai
seon ed3d41d399 feat(ai): external responder for external-* model ids (reference runs)
모델 id가 external- 로 시작하면 ai-agent 가 LLM API 를 부르지 않고 각 턴(시스템
프롬프트·대화 이력·도구 정의·강제 제출 여부)을 GET /external/next 로 내어주고
POST /external/reply 로 답을 받는다. 진단 루프·프롬프트·도구·턴 상한은 다른 모델과
동일하므로, API 경로가 없는 모델(Claude Mythos 5.1 을 Claude Code 서브에이전트가
구동)의 참고 측정에 쓴다. 토큰 사용량은 알 수 없어 0 으로 기록한다.

external-* 진단은 EXTERNAL_DIAGNOSE_TIMEOUT_S(기본 1500초), 한 턴은
EXTERNAL_TURN_TIMEOUT_S(기본 1200초)까지 기다리고, 하네스는 같은 모델에 26분을
기다린다. /selfcheck 에 external_responder 상태(대기 턴·마지막 폴링 시각)를 추가.
2026-10-16 09:05:12 +09:00
..

ai

AI VM services of the self-healing lab (experiment design 6). Module github.com/selfheal-lab/selfheal-lab-apps/ai.

command role port
cmd/agent POST /diagnose: Responses API tool loop over the read-only tools (internal/tools, design 6.2), strict submit_diagnosis (design 6.3, internal/diag), sessions and prompt versions in pgvector (internal/rag), then proposal + HITL post or escalation (design 6.5/6.6, internal/agent) 8080
cmd/hitl Discord gateway bot (internal/hitl): Approve/Reject buttons, harness approval + execution, expiry to the escalation channel, escalation threads with the runbook 8081

Contracts: harness POST /diagnose {"alert","run_id","scenario_id"} -> diagnosis fields at top level plus session_id, model, prompt_version, disposition. Harness side: POST /proposals (registers the proposal at diagnosis time, returns the approval token), POST /proposals/{token}/approve, POST /proposals/{token}/reject, POST /actions/execute.

OpenAI: POST /v1/responses with function tools (strict: true, every property required, additionalProperties: false), previous_response_id chaining, function_call_output items; embeddings text-embedding-3-small (1536). Model id from OPENAI_MODEL.

Build: gcloud builds submit ai --project cms-d-414903 --config ai/cloudbuild.yaml --substitutions=_TAG=$(git rev-parse --short HEAD). Tests: cd ai && go test ./... (mock Responses API and Mimir; no network).