Repository navigation
fix(dev): record the canonical browser origin for port 443 - #2850
Conversation
Local Setup recorded https://console...:443 when OCC_DEVELOPMENT_BROWSER_PORT was 443. WHATWG URL drops the default port, so first-agent refused the state and the controller's development origin rule refused OCC_AUTH_BASE_URL. Record the origin without the default port everywhere it is built (Compose state, k3d auth.baseUrl, Keycloak redirect URI and sign-in origin), and let first-agent also admit the explicit :443 form older state recorded.
The guide described a Keycloak 26.x compatibility policy as pending team acceptance. Keep only the facts: CI pins 26.7.5 by digest; other versions are not verified.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Review follow-up: newDevelopmentConsole required an explicit port and compared the dial target with the origin's host. Accept a port-less HTTPS origin and expect host:443 for it, and print the Keycloak sign-in URL with the same canonical origin. Keycloak sign-in still reserves port 443, so this is consistency rather than a reachable failure.
|
Codex review: blocked before merge. What this changesThis PR canonicalizes development HTTPS origins on port 443, adjusts first-Agent admission, and clarifies the tested Keycloak version. Example: Local Setup uses OCC_DEVELOPMENT_BROWSER_PORT=443 for cluster occ-dev-example.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: current main still has the port-443 origin mismatch, but the legacy-state exception conflicts with repository policy. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe development launcher converts selected browser settings into saved Local Setup state, Compose configuration and Helm values; the controller and first-Agent CLI consume those values for browser admission and native UI access. flowchart TD
A[Development browser settings] --> B[Development launcher]
B --> C[Saved Local Setup state]
B --> D[Compose and Helm configuration]
C --> E[First Agent CLI]
D --> F[Controller origin admission]
E --> G[Console and Agent URLs]
F --> G
Technical reviewBest possible solution: Generate canonical origins through the existing launcher, retain exact canonical admission in first-Agent, and verify fresh and existing development state. Do we have a high-confidence way to reproduce the issue? The current-main producer writes an explicit :443 while both first-Agent admission and the controller reject that spelling; this source path is clear, but no runtime reproduction was performed during this read-only review. Is this the best way to solve the issue? The shared origin formatter fixes the producer consistently without changing identity or transport boundaries; the additional legacy-format exception is unnecessary under the repository's canonical-state policy. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 23ad336f372f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 18, 2026, 9:40 AM ET / 13:40 UTC. |
Problem
OCC_DEVELOPMENT_BROWSER_PORT=443, Local Setup recorded the browser origin ashttps://console.<cluster>.oce.localhost:443. WHATWG URL drops the default port, soscripts/first-agent.mjsrefused the recorded state ("native admin endpoint is invalid"), and the controller's development origin rule (isDevelopmentBrowserOrigin) refuses the same value asOCC_AUTH_BASE_URL. The k3dauth.baseUrland the Keycloak redirect URI and sign-in origin were built the same way.docs/guides/deploy/oidc-keycloak.mddescribed a "proposed OCE compatibility policy" for Keycloak 26.x "pending team acceptance": an open decision in operator docs.Change
internal/occdev: newdevelopmentBrowserOrigin(consoleHost, port)returns the canonical origin (no:443). Used for the Compose state'sBrowserOrigin, the k3dauth.baseUrl, the startup console line, and the Keycloak redirect URI, sign-in origin and sign-in instructions. The sign-in console client accepts a port-less origin and dialshost:443for it (Keycloak sign-in still reserves port 443, so this is for consistency).scripts/first-agent.mjs: admits a port-less HTTPS origin, and also the explicit:443form that older Local Setup state recorded. Other non-canonical forms (trailing slash,:0443) are still refused.tests/fixtures/keycloak/image.json; other versions are not verified.Verification
go vet ./internal/occdev/andgo test ./internal/occdev/: pass. The newTestDevelopmentBrowserOriginOmitsTheDefaultHTTPSPortand the extendedTestDevelopmentConsoleTrustsOnlyTheBrowserCA(port-less origin) pass 20/20 on 2 CPUs.node --test tests/integration/first-agent-startup.test.mjs: 9/9, 20/20 on 2 CPUs. The new case fails against the oldfirst-agent.mjs.Prettier check on the touched JS and Markdown files: clean. The docs word count goes down.
No cluster run. Port 443 on host loopback needs a privileged or rootless-engine setup; that path was not exercised end to end.
Internal review: one medium and two lows, all fixed in the last commit.
Risks