fix(setup): the wizard was asking the poller gate a question it does not answer - #22
Merged
Merged
Conversation
…not answer
CIRISClient#21. On a folded agent's first run the wizard drops the AI step, so
setup completes with no LLM and the user reaches chat to silence.
NOT A RACE — OR NOT ONLY ONE. The issue reads the 80-line gap between
`clientMode=NODE` and `clientMode=AGENT` as the wizard finalising on a
provisional value, and suggests waiting for the probe. Waiting alone would not
have fixed it: at the first gate line the mode was NODE **correctly**, and it
would still be NODE however long we waited, because the brain reports
`setup_required: true` and `clientModeFrom` demotes an unconfigured brain to
NODE (CIRISAgent#1075).
THE CIRCULARITY IS NAMED IN THE ARM'S OWN COMMENT. That demotion was added
because an unconfigured brain 503s every AGENT poller, and the list of victims
includes:
addLlmProvider 503 <- so the user could not configure an escape
So: the brain is unconfigured, therefore the gate says NODE, therefore the
wizard drops the AI step, therefore the brain stays unconfigured. The fix that
stopped the 503s became the reason configuration never happens.
`clientMode` answers "should the agent surfaces and AGENT-only pollers run",
and demoting there is right. The wizard asks "is there a brain here that needs
configuring", where being unconfigured is the REASON TO OFFER THE STEP. Using
one for the other is a category error, not a timing bug.
`ModeProbe.brainPresent` = `folded && reachable`, independent of readiness —
because readiness must not gate the step that produces readiness. The poller
gate is unchanged.
AND THE PROVISIONAL-VALUE HALF IS REAL TOO. `setupHasAgent` was
`clientMode?.isAgent ?: false`, so "not probed yet" became "no brain", and
`SetupViewModel` is keyed on it while `isFinalSetupStep` reads it — the step
list is FIXED at composition. `Screen.Setup` now holds on StartupScreen until
the probe answers rather than composing the shape on a default. Same
distinct-zeroes rule as CapabilityWire's null-versus-empty: could-not-determine
must not become a definite answer.
Tested against the exact gate line from the issue's log — SETUP / 0 services /
folded / reachable / unconfigured / fabric-node. The poller gate still returns
NODE there, and `brainPresent` is true at the same instant. Mutation: let
readiness back into `brainPresent` and the two decisive cases fail.
Closes #21.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EGE52kPzjGFiPzGcs63ZC1
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #21.
The diagnosis is slightly different from the issue's
The issue reads the 80-line gap between
clientMode=NODEandclientMode=AGENTas the wizard finalising on a provisional value, and suggests waiting for the probe.Waiting alone wouldn't have fixed it. At the first gate line the mode was
NODEcorrectly, and it would have stayedNODEhowever long we waited — the brain reportssetup_required: true, andclientModeFromdemotes an unconfigured brain toNODE(CIRISAgent#1075).The circularity is named in that arm's own comment
The demotion exists because an unconfigured brain 503s
addLlmProvider. And the wizard used that demotion to skip the step that callsaddLlmProvider.The fix that stopped the 503s became the reason configuration never happens.
Two different questions
clientModeModeProbe.brainPresent = folded && reachable, independent of readiness, because readiness must not gate the step that produces readiness. The poller gate is unchanged.The provisional-value half is real too
setupHasAgentwasclientMode?.isAgent ?: false— "not probed yet" became "no brain".SetupViewModelis keyed on it andisFinalSetupStepreads it, so the step list is fixed at composition.Screen.Setupnow holds onStartupScreenuntil the probe answers.Same distinct-zeroes rule as
CapabilityWire's null-versus-empty: could-not-determine must not become a definite answer.Tested against the log
The exact first gate line from the issue —
SETUP / 0 services / folded / reachable / unconfigured / fabric-node. The poller gate still returnsNODEthere;brainPresentistrueat the same instant.Mutation: let readiness back into
brainPresentand the two decisive cases fail.🤖 Generated with Claude Code
https://claude.ai/code/session_01EGE52kPzjGFiPzGcs63ZC1