# Complete - m-edge-model-group-queue-scheduling/01_edge_queue_service

## 완료 일시

2026-06-16

## 요약

Edge queue service provider instance routing follow-up completed after 3 review loops; final verdict PASS.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_cloud_G07_0.log` | `code_review_cloud_G07_0.log` | FAIL | Provider policy, runnable candidate filtering, disconnect stale candidate, context cancellation gaps found. |
| `plan_cloud_G07_1.log` | `code_review_cloud_G07_1.log` | FAIL | Provider instance-key routing and ambiguous provider type contract gap found. |
| `plan_cloud_G07_2.log` | `code_review_cloud_G07_2.log` | PASS | Exact provider instance policy and ambiguous type route behavior verified. |

## 구현/정리 내용

- Edge queued SubmitRun path now resolves provider adapter requests by exact instance key first and applies that instance's capacity, max_queue, and queue_timeout_ms.
- Provider type-name route now remains runnable only for exactly one enabled instance, matching the Node router ambiguity contract for multiple instances.
- Added service-level regressions for exact provider instance policy and ambiguous provider type rejection.
- Review cleanup applied `gofmt` to `apps/edge/internal/service/run_dispatch.go` and `apps/edge/internal/service/service_test.go`.

## 최종 검증

- `go test -count=1 ./apps/edge/internal/service -run 'TestSubmitRunModelQueue(UsesProviderInstancePolicy|RejectsAmbiguousProviderType)'` - PASS; `ok iop/apps/edge/internal/service 0.056s`.
- `go test -count=1 ./apps/edge/internal/service` - PASS; `ok iop/apps/edge/internal/service 0.269s`.
- `go test -race -count=1 ./apps/edge/internal/service` - PASS; `ok iop/apps/edge/internal/service 1.281s`.
- `go test -count=1 ./apps/edge/...` - PASS; all edge packages passed, including `internal/openai` and `internal/service`.
- `gofmt -l apps/edge/internal/service/run_dispatch.go apps/edge/internal/service/service.go apps/edge/internal/service/service_test.go apps/edge/internal/openai/chat_handler.go apps/edge/internal/openai/responses_handler.go apps/edge/internal/openai/server_test.go` - PASS; no output.
- `git diff --check` - PASS; no output.

## Roadmap Completion

- Milestone: `agent-roadmap/phase/inference-provider-extension/milestones/edge-model-group-queue-scheduling.md`
- Completed task ids:
  - `edge-admission`: PASS; evidence=`agent-task/archive/2026/06/m-edge-model-group-queue-scheduling/01_edge_queue_service/plan_cloud_G07_2.log`, `agent-task/archive/2026/06/m-edge-model-group-queue-scheduling/01_edge_queue_service/code_review_cloud_G07_2.log`; verification=`go test -count=1 ./apps/edge/internal/service`, `go test -race -count=1 ./apps/edge/internal/service`, `go test -count=1 ./apps/edge/...`
  - `node-dispatch`: PASS; evidence=`agent-task/archive/2026/06/m-edge-model-group-queue-scheduling/01_edge_queue_service/plan_cloud_G07_2.log`, `agent-task/archive/2026/06/m-edge-model-group-queue-scheduling/01_edge_queue_service/code_review_cloud_G07_2.log`; verification=`go test -count=1 ./apps/edge/internal/service`, `go test -race -count=1 ./apps/edge/internal/service`, `go test -count=1 ./apps/edge/...`
- Not completed task ids: 없음

## 잔여 Nit

- 없음

## 후속 작업

- 없음
