Codex/pr69584 split#70474
Conversation
Greptile SummaryThis PR splits out several related fixes from PR #69584: it makes
Confidence Score: 4/5Safe to merge after resolving the terminal-state restoration regression in setup.finalize.ts. One P1 finding: the removal of the finally-block terminal restore in the TUI hatch path leaves users with a potentially broken terminal when TUI exits abnormally. All other changes are well-tested with clear intent. The rest of the findings are P2 style/efficiency suggestions. src/wizard/setup.finalize.ts — TUI launch block is missing the post-launch restoreTerminalState call in a finally block.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48d9e9d132
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b63316198
ℹ️ 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".
| pending && | ||
| privateState.requestSeq === seq && | ||
| !privateState.inFlight && | ||
| state.connected && | ||
| state.client |
There was a problem hiding this comment.
Clear queued channel refreshes after disconnect
When a stronger request is queued during an in-flight load, this branch only executes it if state.connected is still true; otherwise the stale privateState.pending value is left behind. After reconnect, a later unrelated loadChannels call can unexpectedly replay that old stronger request (for example probe:true with full accounts), adding unnecessary heavy work and potentially replacing UI state/error messages that the caller did not request. Clearing pending when it cannot be dispatched avoids this deferred stale replay.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dcd1dc8b71
ℹ️ 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".
| url: links.wsUrl, | ||
| ...probeAuth, | ||
| }); | ||
| if (!gatewayProbe.ok && installDaemon) { |
There was a problem hiding this comment.
Guard missing-gateway guidance on failed probes
The else branch here is paired with if (!gatewayProbe.ok && installDaemon), so it also executes when gatewayProbe.ok is true. In successful setup runs this emits the "Gateway not detected yet" guidance even though the gateway is reachable, which is misleading in both daemon and no-daemon flows; this guidance should only run when the probe actually fails.
Useful? React with 👍 / 👎.
| const defaultAccount = await buildChannelAccountSnapshot({ | ||
| plugin, | ||
| cfg, | ||
| accountId: defaultAccountId, | ||
| runtime: runtimeSnapshot, |
There was a problem hiding this comment.
Avoid re-running account configuration checks in summary mode
In the summary-only channels.status path, resolveAccountConfigured(...) is already called before probe/audit, but this subsequent buildChannelAccountSnapshot(...) call can invoke plugin.config.isConfigured again for accounts without an inline configured property (see src/channels/plugins/status.ts). For probe: true + includeAccounts: false, this introduces duplicate isConfigured work and extra latency/side effects on the new lightweight path.
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changes: The PR changes setup/TUI launch behavior, provider OAuth browser-open handling, Gateway Required change before merge: The remaining blockers are narrow, file-local repairs on an open, maintainer-modifiable PR branch plus a mechanical changelog addition; they are suitable for a ClawSweeper repair pass rather than broad product review. Security review: Security review cleared: The diff touches OAuth and gateway-token handoff paths, but I found no concrete security or supply-chain regression in the public PR diff. Review findings:
Review detailsBest possible solution: Keep the useful split, but fix the three remaining behavior regressions, add the required changelog entry, rebase on current main, and then rerun the targeted setup, channel-status, UI controller, typecheck, and lint lanes before merge. Do we have a high-confidence way to reproduce the issue? Yes. The remaining review issues are reproducible by deterministic code paths: run setup with a successful gateway probe, queue a stronger channel load and disconnect before Is this the best way to solve the issue? No. The overall direction is maintainable, but the proposed branch is not the best final solution until it preserves the single-configuration-check guarantee, avoids stale UI pending state, guards the gateway note correctly, and records the user-facing changes in the changelog. Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 068b33de8717. |
Summary
#69584.isConfiguredwork unnecessarily.#69585; that review surface is tracked separately in#70477.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
#69584mixed multiple unrelated fixes, and one setup refactor dropped thetry/finallyterminal restore while also forcing the hatch TUI down the Gateway path even when the Gateway probe was not healthy.Regression Test Plan (if applicable)
src/wizard/setup.finalize.test.tssrc/gateway/server-methods/channels.status.test.tsui/src/ui/controllers/channels.node.test.tschannels.statussummary-only requests reuse the same configuration check instead of callingisConfiguredtwice.User-visible / Behavior Changes
--install-daemon=falseor a failed startup), terminal hatch stays in embedded local mode instead of launching a disconnected Gateway-mode TUI.channels.statuscan still return lightweight overview payloads without accounts, and stale configured default account ids fall back to the first live account.Diagram (if applicable)
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
codex/pr69584-split.try/finallyterminal cleanup and gate terminal hatch mode on actual Gateway reachability.Expected
Actual
Evidence
Commands run locally:
pnpm tsgo:prodpnpm check:test-typespnpm test src/wizard/setup.finalize.test.ts src/gateway/server-methods/channels.status.test.ts ui/src/ui/controllers/channels.node.test.tspnpm lintHuman Verification (required)
isConfiguredonceReview Conversations
Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations
#69584, not a greenfield branch.