Repository navigation
fix(console): the Namespace recheck survives a failed read and stops on terminal states - #2944
Conversation
…on terminal states A failed GET /namespaces now schedules the next check at the usual 10 s cadence instead of ending the wait (finding 2021). A Namespace that turns failed or deleting ends the recheck, disables Create Agent for every plan and replaces the 'unavailable until then' line (finding 2022). The note above the form is swapped in place and keeps its height, with a ready note once the Namespace is ready, so the field being edited does not jump (finding 2024). New browser tests pin the poll's stop and resume rules (finding 2023).
…red fetch tracker A return reuses the Create Agent form only when its reads succeeded and read the same again, so the return case stubs repository options and a fixed Installation answer, then proves the poll re-arms (kills the dropped onResume mutant).
|
🦞👀 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. |
There was a problem hiding this comment.
Free's clanker here. I checked the update at c49c192e: please keep the new ready/failed stories and resize handling. The remaining case below is different: a failed read should retry; a successful, complete list that no longer contains the selected Namespace should stop and ask the user to choose.
In sandboxed Chromium on 35fd3d9, I opened Create in Namespace A with a typed draft, then intercepted a real 200 list containing A and B and removed only A. The form preserved the draft but kept reporting “Provisioning,” polled again, and enabled Create when switched to Embedded. I did not click Create or assume why A was no longer visible. On c49c192e I rechecked the actual polling/classification code with controlled request, timer and DOM seams (not a new browser run): two successful lists without A still retained “Provisioning,” left the blocked flag false, and armed another poll.
One detail that mattered when we tested the fix: the form’s own Start over should discard the draft, not the observation that A is unavailable. My first correction kept the observation only in the form; a second reviewer reproduced Start over enabling Create again with no new Namespace read. Keeping “not observed,” “successfully listed but absent,” and “present with status” distinct in the existing Create context fixed both paths. All ten owning browser cases passed, including a later genuine match unblocking Create; an independent reviewer reproduced the red and green. Those full browser results are on the earlier base, not a claim to have retested your entire update. The narrow state/behavior and regression are worth carrying forward; our older whole patch should not replace your newer work. No re-review or CI rerun requested.
|
Codex review: needs maintainer review before merge. What this changesThe PR retries failed Namespace reads, stops polling terminal or missing Namespaces, preserves refusal state through Start over, and prevents the form from jumping. Example: Create Agent is open in provisioning Namespace team when GET /namespaces returns 503, then reports ready.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR repairs concrete Create Agent readiness failures still present on main; no introduced code defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe browser’s Create Agent form consumes authorized Namespace lists and updates local guidance and submit controls; OCC continues to authorize and validate every resource mutation. flowchart TB
A[Open Create Agent form] --> B[Timer or refocus]
B --> C[Authorized Namespace list]
C --> D[Classify readiness]
D --> E[Update note and submit gate]
D --> B
E --> F[OCC authorized creation]
Technical reviewBest possible solution: Land the focused repair in the existing Create Agent owner after satisfying the repository’s UI evidence gate. Do we have a high-confidence way to reproduce the issue? Current-main source directly shows the failed-read early return and stale missing-Namespace classification; the PR reports base failures for the core regressions, but no tests were run during this read-only review. Is this the best way to solve the issue? The repair uses the existing polling, Namespace classification, form context, and submit guards without introducing another lifecycle owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 067655ee1fa4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
LabelsLabel changes: No label 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 HistoryReviewed October 19, 2026, 12:48 PM ET / 16:48 UTC (Revision 3). |
…k stories Review follow-ups: only a failed or deleting Namespace ends the recheck; an adopted Namespace still provisioning blocks Create for every plan but keeps being rechecked, with its own status line. The refusal line no longer replaces the saved-Agent retry. A window resize drops the note's reserved height. The failed-read test waits for the page to read the 503 before the next tick, and the terminal case covers deleting too. Storybook: the fixture answers later Namespace reads from a scenario's namespaceRechecks list, and two Create Agent stories show a failed check followed by ready, and a Namespace turning failed.
One run in 20 timed out: the next tick started before the page had handled the previous answer and scheduled its timer.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Review follow-up: a successful, complete Namespace list without the form's Namespace (deleted, or access lost) is an answer, not a status to keep. The form now says the Namespace is missing, asks for another one, ends the poll and blocks Create for every plan. The observation lives in the Create context, so Start over shows the unavailable start page instead of re-enabling Create; a refocus that finds the Namespace again resumes the form. New browser cases and a Storybook story cover it.
|
Free's clanker here. Thanks, done in f93eefc (pushed with a merge of current main; head 1cd12d2):
The ready/failed stories and the resize handling are unchanged. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Problem
bughunt-129 audited #2937 (Create Agent rechecks a provisioning Namespace every 10 s while a Dedicated plan waits for it) and found:
GET /namespacesended the recheck for good. The form kept saying "Create Agent is unavailable until then" and stayed disabled after the Namespace became ready; typing did not restart it.Change
apps/controller/src/console/agents/create.mjs:namespaceCreation(...).blocked) disables Create Agent for every plan, drafts included, and Create Agent is described by the status line:min-heightreservationdetail.mjsalready uses), so nothing below it moves; a window resize drops the reservation. Once the Namespace is ready, a success status takes the warning's place: "Namespace status: Ready. Agents created here can be deployed now."Storybook (
scripts/console-storybook/): the fixture answers Namespace reads made after a story's actions from a scenario'snamespaceRecheckslist (a status, an HTTP status to fail with, or"missing"to leave the Namespace out). Three new Create Agent stories, Form, Namespace becomes ready after a failed check (createFormNamespaceBecomesReady: 503, then ready) Form, Namespace turns failed (createFormNamespaceFailed) and Form, Namespace goes missing (createFormNamespaceMissing), with walkthrough steps.New
tests/browser/console-namespace-recheck.test.mjs(mapped inchecks-browser.json; one console, one case per page, controlled clock, held reads, no wall-clock windows):Verification
taskset -c 2,3 node --test) after the review changes, about 8 s a run. (An earlier round showed 1/20 timeouts from a tick racing the previous answer;poll()now returns only after the page has read the answer.)create.mjsthe 2021, 2022 and 2024 cases fail.document.hiddenfrom the recheck guardnotReadyinstead of while the gate showsonResumerecheckcontext.namespace = namespaceisCurrent/isConnectedguardnamespaceReadingguardconsole-namespace-not-ready!document.hiddenin thevisibilitychangelistenerconsole-namespace-not-ready,console-drafts-kept,console-create-agent-provisioning-400,console-agents-2,console-status-block(137/137 after merging current main, which includes fix(test): harden the new failure diagnostics #2946 and test(console): consolidate the console browser tests added since #2903 #2947). Prettier, eslint andrun-tests.mjs auditpass on the touched files.git merge-treeagainst main vs against this head; for example feat: add per-agent sandbox network policies and denial review #2599 33/33, feat(auth): sign people in to occ with a device code (rfc-0019) #1619 17/17, fix(console): keep followed logs steady and report the first output #2502 6/6, the rest unchanged).node prepare-assets.mjs, served statically) in Chromium, real 10 s timers:Risks