iop/agent-spec/input/openai-compatible-surface.md
toki 7b90b7e5af refactor(chronos): IOP 경계를 분리한다
Chronos 이전 완료 증거를 보존하면서 IOP에는 provider 실행 책임만 남기기 위해 검토된 마일스톤 변경을 하나의 승격 커밋으로 고정한다.
2026-08-02 19:29:30 +09:00

46 lines
1.9 KiB
Markdown

---
spec_doc_type: spec
spec_id: input/openai-compatible-surface
status: 구현됨
source_evidence:
- type: contract
path: agent-contract/outer/openai-compatible-api.md
notes: Public compatibility behavior
- type: contract
path: agent-contract/outer/anthropic-compatible-api.md
notes: Anthropic Messages behavior
- type: code
path: apps/edge/internal/openai/routes.go
notes: HTTP routes and authentication
- type: code
path: apps/edge/internal/openai/chat_handler.go
notes: Chat validation, routing, and tools
- type: code
path: apps/edge/internal/openai/responses_handler.go
notes: Responses validation and normalized execution
- type: test
path: apps/edge/internal/openai/chat_handler_test.go
notes: Standard inference and routing regressions
---
# OpenAI-Compatible Input Surface
## Current implementation
Edge exposes model discovery, Chat Completions, Responses, legacy Completions, Anthropic Messages, and token-counting compatibility routes. Public model ids resolve to provider-pool candidates or direct provider routes.
Standard streaming, sampling, reasoning, tool definitions, tool choice, structured output, provider passthrough extensions, authentication, and compatible error envelopes are preserved. Provider-native tool calls remain structured; text fallback occurs only after an explicit native-tool rejection.
Caller metadata is a bounded string map. It is never treated as local process control or a filesystem execution context. Correlation values do not resume provider state.
## Execution paths
- OpenAI-compatible providers use the raw provider tunnel when selected by the pool.
- Normalized adapters use `RunRequest` and ordered run events.
- Disconnect and timeout cancellation use the active run id.
- Usage attribution follows the selected provider or configured model group.
## Verification
- `go test -count=1 ./apps/edge/internal/openai ./apps/node/internal/adapters/...`
- `make test-e2e`