Repository navigation
Let the browser ask this machine to fix a broken PATH - #672
Conversation
A request carries a capability token and its timestamp, never a path or a command, and the outcome two closed-set tokens with no free text - the shell error and the sudo line stay in the terminal already printing them. The report echoes the request's timestamp so a slow one cannot land on the retry that replaced it, and performing is recorded before reporting, so a failed POST retries the report rather than the admin prompt.
PR Summary by QodoEnable browser-requested PATH repair during setup
AI Description
Diagram
High-Level Assessment
Files changed (17)
|
Code Review by Qodo
1.
|
Both were reachable. A cancel during the action was swallowed, so the leg went on to the finished test and could report a stopped setup as complete. And the per-tick report retry has no next tick on the poll that finishes the flow, so a single blip lost the outcome of a fix that really happened; the flush is bounded, because a finished flow must not be held open for a report the user is no longer looking at.
AI-2224
What & why
The Agents screen can raise a PATH warning — the login shell cannot find
kcap, so hooks install, run and record nothing — andkcap daemon shim ensurecan fix it, but nothing joins them. This gives the poll a request lane: the browser records a request,kcap setupperforms it mid-wait and reports the outcome back, and the screen renders it.The alternative was deferring the fix to the terminal after the poll ends. Rejected because it cannot report: the user leaves the browser, an admin prompt appears later in a terminal they have stopped watching, and a
cancelledor aconflictrow never reaches them. That is the same silent failure the warning is spending an error colour on.The create body also gains
platform, so the screen offers the button only for an explicitmacos— the same shape as the warning, which appears only for an explicitlogin_shell_finds_cli: false.Where to look
FirstRunMachineActionOutcomes/Reasonsare now the canonical token list andShimEnsureJsonuses them, so the verb's output and the browser's copy cannot drift apart.Detailis raw shell stderr andSudoFallbacka composedsudoline; both stay in the terminal.ShimEnsureJson.ExitCodeis derived and[JsonIgnore]d — the record is the--jsondocument.Verification
Capacitor.Cli.Core.Tests.Unit2352/2352,Capacitor.Cli.Tests.Unit3574/3574, Release AOT publish with no IL warnings.Four guards are mutation-proven — dropping each one reddens tests: perform-once (2 fail), the echoed timestamp (2), performing before the finished test (1), the closed capability set (1).