feat(deploy): phase 5 — hub management ingress, deployment recipes, oracle dogfood fixes - #2786
feat(deploy): phase 5 — hub management ingress, deployment recipes, oracle dogfood fixes#2786lidge-jun wants to merge 8 commits into
Conversation
…ed (first oracle dogfood boot)
…t (oracle dogfood)
…ing the commit (dogfood)
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
리뷰 · 우선순위 64 / 80이 PR은 remote-hub phase 5입니다. 베이스는
Dogfood 수정 세 가지가 실사용 가치가 큽니다. (1) 지금 라인 src/server/index.ts managementIngress - 127.0.0.1 전용, allowlist 404, 바인드 실패 롤백, stop에 세 리스너. 라인 src/types/config.ts / src/config.ts - hub.managementIngress 스키마. enabled:false | {enabled:true,port}. 라인 src/cli/claude-agent-startup-sync.ts / desired-state - hub 역할은 호스트 클라이언트 설정을 다시 쓰지 않습니다. 라인 src/client/state.ts - hub에 client state가 없으면 mismatch가 아니라 disconnected. 라인 tests/loopback-listener-*.ts / server-management-auth.test.ts - ingress 경계·실소켓 종료를 잠급니다. 경로 base - #2781(draft) 위. p4 ready 전이면 이 PR도 대기입니다. 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a62c8eba20
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // A hub is a server role, not a broken client: without client state it simply is not | ||
| // connected, and refusing here blocked `ocx start` on every hub (found on the first | ||
| // clisu-oracle dogfood boot). Hub role WITH client state remains mismatched below. | ||
| if (!hasClient && role === "hub") return { kind: "disconnected" }; |
There was a problem hiding this comment.
Keep hub role out of disconnected client state
When a hub has no client block, classifying it as disconnected lets connectClient() pass its state.kind === "disconnected" preflight and later makes commitClientConnection() replace runtimeRole: "hub" with "client". Thus, on a hub without a service-token file, running ocx connect silently converts the installation into a client and disables hub behavior on restart. Preserve the hub/client mismatch for connection operations and special-case hub startup in handleStart() instead, or add an explicit hub-role rejection to the connect preflight.
Useful? React with 👍 / 👎.
| const seeded = getDefaultConfig(); | ||
| seeded.runtimeRole = "client"; | ||
| seeded.client = structuredClone(state); | ||
| saveConfig(seeded); |
There was a problem hiding this comment.
Make missing-config bootstrap conditional
When mutatePersistedConfig() reports missing, it returns before acquiring the mutation lock; another first-run command can therefore create a valid config.json before this unconditional whole-config saveConfig(seeded) runs. The seeded defaults then overwrite the newly created providers, credentials, and settings. Bootstrap creation needs to acquire the coordinator lock and confirm the file is still absent before writing, otherwise it should retry the field-scoped mutation or report a conflict.
Useful? React with 👍 / 👎.
Ingwannu
left a comment
There was a problem hiding this comment.
Requesting changes on exact head a62c8eba20ec1ecc7531f2ce8eb2310004052dde. It is 203 commits behind current dev@ae356a3cf, and exact-head CI is failing on product contracts, not only infrastructure noise: tests/cli-headless-parity.test.ts:287 exposes seven undeclared /api/machine/* routes; tests/update-stop-first.test.ts:225, tests/loopback-listener-admission.test.ts:196, and tests/release-version-line.test.ts:108 also fail on macOS, while the privacy gate fails. Please rebuild the deployment phase on current dev, explicitly declare or remove every machine management route from the CLI/headless surface, restore the stop-first and role-admission contracts, and keep the privacy/release gates intact. Re-request review only on a clean exact head with green CI.
Summary
devlog/_plan/260827_remote_hub/070_phase5_deploy.md) plus the live clisu-oracle dogfood it prescribed.hub.managementIngress): a second 127.0.0.1-only listener serving GUI +/api+ the pairing exchange, default-404 allowlist, no/v1/*, startup rollback when the bind fails, three-listener shutdown covered by real-socket tests. Defaults byte-identical when unconfigured.OCX_API_TOKEN_FILEsecret, tailscale serve + ts.net cert walkthrough, headless OAuth viaoauthOpenBrowser:false+ manual code submit).runtimeRole=hubrefusedocx start; the hub role ran local Codex/Grok/Claude client syncs on startup (marking/readyzfailed and rewriting~/.grok/config.tomlon a server box);ocx connectrefused its final commit on a fresh machine with noconfig.json.devlog/_plan/260827_remote_hub/090_dogfood_record.md— pairing grant → per-client key auto-issue → injected client → real routedHUB_OKcompletion over the tailnet → per-apiKeyIdusage attribution on the hub → byte-identical disconnect restore.Verification
Run on lidge-ai (remote CI host) at f98081f, per the no-local-suite policy:
bun run typecheck— clean.bun test tests/server-live.test.ts tests/server-management-auth.test.ts tests/client-machine-listener.test.ts tests/client-connect.test.ts tests/codex-desired-state.test.ts tests/loopback-listener-integration.test.ts tests/core-lab-boundary.test.ts tests/service-install.test.ts— 156 pass, 0 fail./readyzwith protocol metadata over the tailnet, authenticated/v1/catalog, HTTPS-only admin refusal, pairing-code connect, routed completion, usage slice, offline-restore disconnect.Checklist