<!-- task=m-openai-compatible-think-control/05+01,02,03,04_dev_smoke plan=1 tag=REVIEW_TEST -->

# Plan - Review Follow-up: Provider별 Think-Control Dev Smoke

## 이 파일을 읽는 구현 에이전트에게

이 plan은 이전 TEST loop의 FAIL Required를 닫기 위한 좁은 후속 작업이다. 새 코드나 문서 변경을 만들지 말고, dev-runtime provider pool에서 `dev-smoke` S05 evidence만 보강한다. 사용자에게 직접 질문하지 말고, Milestone lock 결정이 아니라면 `사용자 리뷰 요청`을 채우지 않는다. token, bearer value, private key path, node registration token 원문은 어떤 출력에도 남기지 않는다.

## Roadmap Targets

- Milestone: `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/openai-compatible-think-control.md`
- Task ids:
  - `dev-smoke`: 실제 dev provider pool에서 `think=false`, omitted default, `include_reasoning=false` 요청을 실행하고 provider raw trace와 Edge SSE를 비교한다.
- Completion mode: check-on-pass

## Archive Evidence Snapshot

- Archived plan: `agent-task/m-openai-compatible-think-control/05+01,02,03,04_dev_smoke/plan_cloud_G07_0.log`
- Archived review: `agent-task/m-openai-compatible-think-control/05+01,02,03,04_dev_smoke/code_review_cloud_G07_0.log`
- Verdict: FAIL
- Required summary:
  - `code_review_cloud_G07_0.log` records that all TEST-3 `omitted_default`, `think=false`, and `include_reasoning=false` stream/trace cases were handled by `gx10-vllm` only.
  - Milestone `dev-smoke` requires smoke across dev-runtime three providers: mac vLLM-MLX, GX10 vLLM, and OneXPlayer Lemonade.
  - SDD S05 Evidence Map requires `dev-smoke` completion evidence with provider별 observations.
- Affected files:
  - No source files should change.
  - Active evidence artifact to fill: `agent-task/m-openai-compatible-think-control/05+01,02,03,04_dev_smoke/CODE_REVIEW-cloud-G07.md`
- Verification evidence already trusted from prior loop and review rerun:
  - Remote source ref `eea8dd0`; remote checkout clean and aligned with `origin/main`.
  - Remote `go test ./...` passed on `2026-07-03` during review rerun.
  - Local targeted `go test -count=1 ./apps/edge/internal/openai ./apps/node/internal/adapters/openai_compat` passed during review rerun.
  - Remote `build/dev-runtime/bin/edge --config build/dev-runtime/edge.yaml config check` returned OK.
  - Remote `/v1/models` exposed `qwen3.6:35b`.
  - Remote Control Plane status showed `mac-codex-node`, `gx10-vllm-node`, and `onexplayer-lemonade-node` connected with providers healthy and recovered to `in_flight=0`, `queued=0`.
- Allowed archive reread:
  - Read only the two archived files listed above if exact previous-loop context is needed. Do not scan `agent-task/archive/**`.
- Roadmap carryover:
  - `dev-smoke` is still incomplete until provider별 S05 stream/trace observations are recorded.

## 분석 결과

### 문제

The previous smoke proved deployment freshness, overall capacity health, and `gx10-vllm` behavior. It did not prove live think-control behavior on `mac-mlx-vllm` or `onexplayer-lemonade`, so it cannot close the provider별 S05 Evidence Map.

### 해결 방법

- Reconfirm the remote runner and provider pool are still on the intended source ref and healthy.
- Collect deterministic routing evidence for each provider before claiming a case result.
- Preferred route control: use a temporary provider-isolated Edge config and `config refresh --mode apply --config-path <temp-config>` so exactly one provider is mapped to `qwen3.6:35b` at a time. Restore the original config after each provider or at the end.
- If live config refresh rejects the temporary provider-isolated mapping, do not claim PASS from a single-provider run. Instead, run a traced capacity batch large enough to hit all providers for each case and record run ids/provider ids proving all three providers handled that case.
- Enable existing node/provider raw stream trace only as long as needed. After evidence capture, restart or refresh back to trace-off state and confirm all three nodes reconnect.
- For each provider and each case, record:
  - provider id and node id
  - request case name
  - routing proof, run id, or equivalent trace correlation
  - Edge SSE `reasoning_content` and content observation
  - node/provider raw trace observation, with masked snippets or exact counts
  - pass/fail judgment

### 기대 기준

- `omitted_default`: record the provider default as observed. Do not require exact text or guaranteed reasoning; verify no unexpected error and SSE completes with valid content/DONE behavior.
- `think=false`: provider raw trace should show no generated reasoning for that request, and Edge SSE should expose no `reasoning_content`.
- `include_reasoning=false`: Edge SSE should expose no `reasoning_content`. If a provider default does not generate reasoning for a reasoning-friendly prompt, record that explicitly; when supported, add a diagnostic `think=true` or `thinking_token_budget` plus `include_reasoning=false` run to prove exposure filtering without replacing the required original case.
- Secrets stay masked. Do not print bearer tokens or private paths.

## 구현 체크리스트

- [ ] Remote runner source ref, clean state, config check, `/v1/models`, and 3-provider health/recovery를 재확인한다.
- [ ] Provider별 deterministic routing 또는 traced batch strategy를 확정하고, `mac-mlx-vllm`, `gx10-vllm`, `onexplayer-lemonade` 각각의 routing proof를 남긴다.
- [ ] `mac-mlx-vllm`에서 `omitted_default`, `think=false`, `include_reasoning=false` stream 요청의 Edge SSE와 provider raw trace를 비교하고 masked evidence를 기록한다.
- [ ] `gx10-vllm`에서 `omitted_default`, `think=false`, `include_reasoning=false` stream 요청의 Edge SSE와 provider raw trace를 비교하고 masked evidence를 기록한다.
- [ ] `onexplayer-lemonade`에서 `omitted_default`, `think=false`, `include_reasoning=false` stream 요청의 Edge SSE와 provider raw trace를 비교하고 masked evidence를 기록한다.
- [ ] 임시 config/trace 변경을 원복하고, 최종 `go test ./...`, `/v1/models`, 3-node connected/provider healthy/recovered 상태를 기록한다.
- [ ] CODE_REVIEW-*-G??.md의 구현 에이전트 소유 섹션을 실제 실행 내용과 검증 출력으로 채운다. 이 항목이 완료되기 전에는 구현이 완료된 것이 아니다.

## 의존 관계 및 구현 순서

This follow-up stays in `05+01,02,03,04_dev_smoke` and reuses the already archived predecessor completions. Do not re-open `01`, `02`, `03`, or `04`.

### [REVIEW_TEST-1] Remote State And Route Strategy

#### 문제

The previous TEST-3 matrix had no provider별 coverage. A follow-up run can still be misleading if the runner is stale, the pool is unhealthy, or routing proof is missing.

#### 해결 방법

- Confirm remote source ref and clean state.
- Confirm Edge config check, model exposure, connected nodes, provider health, and recovered `in_flight=0`, `queued=0`.
- Decide and record the routing strategy before smoke:
  - provider-isolated temp config via Edge admin refresh; or
  - traced capacity batch that proves every provider handled each case.

#### 수정 파일 및 체크리스트

- [ ] No source files.
- [ ] `CODE_REVIEW-*-G??.md`: record remote state and routing strategy output.

#### 테스트 작성

No committed test file. Use remote shell verification.

#### 중간 검증

```bash
ssh toki@toki-labs.com 'cd /Users/toki/agent-work/iop-dev && git status --short --branch && git log --oneline -1'
ssh toki@toki-labs.com 'cd /Users/toki/agent-work/iop-dev && build/dev-runtime/bin/edge --config build/dev-runtime/edge.yaml config check'
ssh toki@toki-labs.com 'curl -fsS http://127.0.0.1:18001/edges/edge-toki-labs-dev/status | jq "{edge_id, nodes: [.nodes[] | {node_id, connected}], providers: [.nodes[].provider_snapshots[] | {id, capacity, in_flight, queued, health, served_models}]}"'
```

Expected: `eea8dd0`, clean branch, config OK, all three nodes connected, all three providers healthy and recovered.

### [REVIEW_TEST-2] Provider별 Think-Control Stream/Trace Matrix

#### 문제

S05 cannot PASS until the live dev-runtime evidence includes `mac-mlx-vllm`, `gx10-vllm`, and `onexplayer-lemonade`.

#### 해결 방법

- Use masked `curl -N` requests against `http://127.0.0.1:18083/v1/chat/completions`.
- For every provider, run the required three cases:
  - omitted default
  - `think=false`
  - `include_reasoning=false`
- Capture Edge SSE outputs under `/tmp/iop-think-smoke/<run>/...` on the runner or host.
- Capture node/provider raw trace snippets for matching run ids.
- Include actual masked snippets or exact parser output in `CODE_REVIEW-*-G??.md`.

#### 수정 파일 및 체크리스트

- [ ] No source files.
- [ ] `CODE_REVIEW-*-G??.md`: record a 3 providers x 3 cases matrix with routing proof, Edge SSE observation, provider raw trace observation, and judgment.

#### 테스트 작성

No committed test file. Temporary runner scripts are allowed under `/tmp` only.

#### 중간 검증

```bash
ssh toki@toki-labs.com 'cd /Users/toki/agent-work/iop-dev && BASE=http://127.0.0.1:18083/v1 MODEL=qwen3.6:35b bash -lc '\''printf "provider matrix smoke start\n"'\'''
```

Replace the placeholder with the actual masked provider-routing and curl script. Do not print bearer token values.

Expected:

- Matrix contains all three providers and all three required cases.
- `think=false` has no provider reasoning and no Edge `reasoning_content`.
- `include_reasoning=false` has no Edge `reasoning_content`; provider raw generation is recorded as observed.
- All streams complete normally with `[DONE]` or equivalent valid finish evidence.

### [REVIEW_TEST-3] Restore And Final Verification

#### 문제

Trace env and temporary route isolation are acceptable for evidence capture only if the dev-runtime pool is restored afterward.

#### 해결 방법

- Restore original Edge config/provider mapping.
- Disable temporary trace env and restart affected nodes if needed.
- Confirm all three nodes reconnect and providers recover.
- Run full Go tests on the remote runner after restoration.

#### 수정 파일 및 체크리스트

- [ ] No source files.
- [ ] `CODE_REVIEW-*-G??.md`: record restore commands and final verification output.

#### 테스트 작성

No committed test file.

#### 중간 검증

```bash
ssh toki@toki-labs.com 'export PATH=/opt/homebrew/bin:$PATH && cd /Users/toki/agent-work/iop-dev && go test ./...'
ssh toki@toki-labs.com 'curl -fsS http://127.0.0.1:18001/edges/edge-toki-labs-dev/status | jq "{edge_id, nodes: [.nodes[] | {node_id, connected}], providers: [.nodes[].provider_snapshots[] | {id, capacity, in_flight, queued, health}]}"'
```

Expected: full tests pass, all three nodes connected, all providers healthy with `in_flight=0`, `queued=0`.

## 수정 파일 요약

| 파일 | 항목 |
|------|------|
| none | external dev-runtime smoke evidence only |

## 최종 검증

```bash
ssh toki@toki-labs.com 'cd /Users/toki/agent-work/iop-dev && git status --short --branch && git log --oneline -1'
ssh toki@toki-labs.com 'export PATH=/opt/homebrew/bin:$PATH && cd /Users/toki/agent-work/iop-dev && go test ./...'
ssh toki@toki-labs.com 'curl -fsS http://127.0.0.1:18001/edges/edge-toki-labs-dev/status | jq "{edge_id, nodes: [.nodes[] | {node_id, connected}], providers: [.nodes[].provider_snapshots[] | {id, capacity, in_flight, queued, health, served_models}]}"'
```

Expected: intended source ref, full tests pass, original provider pool restored, all three provider-specific think-control smoke rows recorded with masked Edge SSE and provider raw trace evidence.
