Skip to content

[codex] fix gateway runtime flow follow-ups#69584

Closed
mmy4shadow wants to merge 19 commits intoopenclaw:mainfrom
mmy4shadow:codex/gateway-runtime-flow
Closed

[codex] fix gateway runtime flow follow-ups#69584
mmy4shadow wants to merge 19 commits intoopenclaw:mainfrom
mmy4shadow:codex/gateway-runtime-flow

Conversation

@mmy4shadow
Copy link
Copy Markdown

Summary

  • fix runtime and setup follow-ups around the same Control UI / gateway flow
  • add safer OAuth browser-open fallback behavior and align provider openUrl contracts
  • restore fast-but-correct overview loading with summary-only channel fetches, quickstart plugin prompts, and Windows scheduled-task command parsing

Validation

  • pnpm test src/daemon/schtasks.test.ts src/gateway/server-methods/channels.status.test.ts src/plugins/provider-openai-codex-oauth.test.ts src/wizard/setup.plugin-config.test.ts src/wizard/setup.test.ts ui/src/ui/app-settings.overview.node.test.ts ui/src/ui/app-settings.test.ts
  • pnpm test ui/src/ui/app-chat.test.ts
  • pnpm tsgo:core:test

@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams app: web-ui App: web-ui gateway Gateway runtime extensions: minimax size: XL labels Apr 21, 2026
@mmy4shadow mmy4shadow marked this pull request as ready for review April 21, 2026 06:06
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR fixes several follow-up issues in the gateway runtime and setup wizard flow: it adds a summary-only fast path for channels.status (skipping per-account fetches on the overview), introduces quickstart plugin-config prompts, restores Windows scheduled-task command parsing, and aligns the openUrl fallback contract across OAuth providers.

  • P1 — dead code in setup.finalize.ts: shouldOpenControlUi is structurally always false because hatchChoice === null is contradicted by the preceding block that always assigns hatchChoice when !opts.skipUi && gatewayProbe.ok. The browser auto-open / dashboard-link note block (lines 475–506) can never execute.
  • P2 — misleading health-check note: the else branch at line 261 fires when gatewayProbe.ok === true && installDaemon === true, showing "Gateway not detected yet" to users whose gateway is actually reachable.

Confidence Score: 4/5

Mergeable after resolving the dead shouldOpenControlUi condition — the auto-open / dashboard note block silently never runs.

One P1 structural bug (always-false shouldOpenControlUi) means the post-setup browser-open flow never triggers as intended. The rest of the changes (channels summary-only path, Windows schtasks parsing, OAuth fallback, plugin-config quickstart) look correct and well-tested.

src/wizard/setup.finalize.ts — shouldOpenControlUi condition and the else-branch health-check note both need fixes.

Comments Outside Diff (3)

  1. src/wizard/setup.finalize.ts, line 469-474 (link)

    P1 shouldOpenControlUi is always false — auto-open block is dead code

    hatchChoice is initialized to null but is always assigned ("tui", "web", or "later") inside the if (!opts.skipUi && gatewayProbe.ok) block (line 393). The two conditions that make hatchChoice === null true are exactly when opts.skipUi || !gatewayProbe.ok, which directly contradicts the first two conditions of shouldOpenControlUi (!opts.skipUi && gatewayProbe.ok). The entire block at line 475–506 (dashboard link note + browser open) can therefore never execute.

    // hatchChoice is null only when skipUi || !ok
    const shouldOpenControlUi =
      !opts.skipUi &&      // requires !skipUi
      gatewayProbe.ok &&   // requires ok
      ...
      hatchChoice === null; // always false when the above two are true

    The fix depends on intent — most likely the last condition should be hatchChoice !== "tui" && hatchChoice !== "web" (i.e., user chose "later" or skipped the prompt entirely), or the shouldOpenControlUi logic should be moved to after the if-block has run.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/wizard/setup.finalize.ts
    Line: 469-474
    
    Comment:
    **`shouldOpenControlUi` is always `false` — auto-open block is dead code**
    
    `hatchChoice` is initialized to `null` but is always assigned (`"tui"`, `"web"`, or `"later"`) inside the `if (!opts.skipUi && gatewayProbe.ok)` block (line 393). The two conditions that make `hatchChoice === null` true are exactly when `opts.skipUi || !gatewayProbe.ok`, which directly contradicts the first two conditions of `shouldOpenControlUi` (`!opts.skipUi && gatewayProbe.ok`). The entire block at line 475–506 (dashboard link note + browser open) can therefore never execute.
    
    ```ts
    // hatchChoice is null only when skipUi || !ok
    const shouldOpenControlUi =
      !opts.skipUi &&      // requires !skipUi
      gatewayProbe.ok &&   // requires ok
      ...
      hatchChoice === null; // always false when the above two are true
    ```
    
    The fix depends on intent — most likely the last condition should be `hatchChoice !== "tui" && hatchChoice !== "web"` (i.e., user chose "later" or skipped the prompt entirely), or the `shouldOpenControlUi` logic should be moved to after the if-block has run.
    
    How can I resolve this? If you propose a fix, please make it concise.
  2. src/wizard/setup.finalize.ts, line 261-272 (link)

    P2 "Gateway not detected yet" shown even when gateway is reachable

    The else branch fires when gatewayProbe.ok === true && installDaemon === true (because the if condition is !ok && installDaemon). When the daemon was installed and the gateway became reachable, users will see "Gateway not detected yet. Setup was run without Gateway service install…" which is factually wrong and misleading.

    The condition should distinguish three cases:

    if (gatewayProbe.ok) {
      // gateway is up — no note needed here (the later "Control UI" note covers it)
    } else if (installDaemon) {
      // daemon installed but gateway not reachable → show troubleshooting
    } else {
      // no daemon installed → "not detected, that's expected"
    }
    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/wizard/setup.finalize.ts
    Line: 261-272
    
    Comment:
    **"Gateway not detected yet" shown even when gateway is reachable**
    
    The `else` branch fires when `gatewayProbe.ok === true && installDaemon === true` (because the `if` condition is `!ok && installDaemon`). When the daemon was installed and the gateway became reachable, users will see "Gateway not detected yet. Setup was run without Gateway service install…" which is factually wrong and misleading.
    
    The condition should distinguish three cases:
    
    ```ts
    if (gatewayProbe.ok) {
      // gateway is up — no note needed here (the later "Control UI" note covers it)
    } else if (installDaemon) {
      // daemon installed but gateway not reachable → show troubleshooting
    } else {
      // no daemon installed → "not detected, that's expected"
    }
    ```
    
    How can I resolve this? If you propose a fix, please make it concise.
  3. src/wizard/setup.finalize.ts, line 363 (link)

    P2 seededInBackground is always false — dead code

    seededInBackground is declared at line 363 but is never set to true anywhere in the function. The ternary at line 628 referencing it therefore always evaluates to the final "Onboarding complete. Use the dashboard link above…" branch. If this variable was removed as part of a feature cleanup, the declaration and the conditional outro message should also be removed.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/wizard/setup.finalize.ts
    Line: 363
    
    Comment:
    **`seededInBackground` is always `false` — dead code**
    
    `seededInBackground` is declared at line 363 but is never set to `true` anywhere in the function. The ternary at line 628 referencing it therefore always evaluates to the final `"Onboarding complete. Use the dashboard link above…"` branch. If this variable was removed as part of a feature cleanup, the declaration and the conditional outro message should also be removed.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/wizard/setup.finalize.ts
Line: 469-474

Comment:
**`shouldOpenControlUi` is always `false` — auto-open block is dead code**

`hatchChoice` is initialized to `null` but is always assigned (`"tui"`, `"web"`, or `"later"`) inside the `if (!opts.skipUi && gatewayProbe.ok)` block (line 393). The two conditions that make `hatchChoice === null` true are exactly when `opts.skipUi || !gatewayProbe.ok`, which directly contradicts the first two conditions of `shouldOpenControlUi` (`!opts.skipUi && gatewayProbe.ok`). The entire block at line 475–506 (dashboard link note + browser open) can therefore never execute.

```ts
// hatchChoice is null only when skipUi || !ok
const shouldOpenControlUi =
  !opts.skipUi &&      // requires !skipUi
  gatewayProbe.ok &&   // requires ok
  ...
  hatchChoice === null; // always false when the above two are true
```

The fix depends on intent — most likely the last condition should be `hatchChoice !== "tui" && hatchChoice !== "web"` (i.e., user chose "later" or skipped the prompt entirely), or the `shouldOpenControlUi` logic should be moved to after the if-block has run.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/wizard/setup.finalize.ts
Line: 261-272

Comment:
**"Gateway not detected yet" shown even when gateway is reachable**

The `else` branch fires when `gatewayProbe.ok === true && installDaemon === true` (because the `if` condition is `!ok && installDaemon`). When the daemon was installed and the gateway became reachable, users will see "Gateway not detected yet. Setup was run without Gateway service install…" which is factually wrong and misleading.

The condition should distinguish three cases:

```ts
if (gatewayProbe.ok) {
  // gateway is up — no note needed here (the later "Control UI" note covers it)
} else if (installDaemon) {
  // daemon installed but gateway not reachable → show troubleshooting
} else {
  // no daemon installed → "not detected, that's expected"
}
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/wizard/setup.finalize.ts
Line: 363

Comment:
**`seededInBackground` is always `false` — dead code**

`seededInBackground` is declared at line 363 but is never set to `true` anywhere in the function. The ternary at line 628 referencing it therefore always evaluates to the final `"Onboarding complete. Use the dashboard link above…"` branch. If this variable was removed as part of a feature cleanup, the declaration and the conditional outro message should also be removed.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/plugins/provider-oauth-flow.ts
Line: 41-50

Comment:
**`openUrl` throw not caught — fallback only handles `false` return**

`createVpsAwareOAuthHandlers` falls back to manual entry only when `openUrl` returns exactly `false`. If an `openUrl` implementation throws instead (which `extensions/minimax/oauth.ts` guards against with a try/catch around the same call), the exception propagates out of `onAuth` and aborts the OAuth flow with no graceful recovery. Given the PR intent is to "add safer OAuth browser-open fallback behavior and align provider `openUrl` contracts", consider adding a try/catch here too:

```ts
let opened: unknown;
try {
  opened = await params.openUrl(url);
} catch {
  opened = false;
}
if (opened === false) {
  // ... existing fallback
}
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Fix onboarding and channels review regre..." | Re-trigger Greptile

Comment thread src/plugins/provider-oauth-flow.ts Outdated
Comment on lines 41 to 50
const opened = await params.openUrl(url);
if (opened === false) {
params.spin.update(
"Could not open a browser automatically. Open the URL below, then paste the redirect URL here…",
);
params.runtime.log(`\nOpen this URL in your browser:\n\n${url}\n`);
manualCodePromise = ensureManualPrompt();
return;
}
params.runtime.log(`Open: ${url}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 openUrl throw not caught — fallback only handles false return

createVpsAwareOAuthHandlers falls back to manual entry only when openUrl returns exactly false. If an openUrl implementation throws instead (which extensions/minimax/oauth.ts guards against with a try/catch around the same call), the exception propagates out of onAuth and aborts the OAuth flow with no graceful recovery. Given the PR intent is to "add safer OAuth browser-open fallback behavior and align provider openUrl contracts", consider adding a try/catch here too:

let opened: unknown;
try {
  opened = await params.openUrl(url);
} catch {
  opened = false;
}
if (opened === false) {
  // ... existing fallback
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/plugins/provider-oauth-flow.ts
Line: 41-50

Comment:
**`openUrl` throw not caught — fallback only handles `false` return**

`createVpsAwareOAuthHandlers` falls back to manual entry only when `openUrl` returns exactly `false`. If an `openUrl` implementation throws instead (which `extensions/minimax/oauth.ts` guards against with a try/catch around the same call), the exception propagates out of `onAuth` and aborts the OAuth flow with no graceful recovery. Given the PR intent is to "add safer OAuth browser-open fallback behavior and align provider `openUrl` contracts", consider adding a try/catch here too:

```ts
let opened: unknown;
try {
  opened = await params.openUrl(url);
} catch {
  opened = false;
}
if (opened === false) {
  // ... existing fallback
}
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d9b8f6f9c

ℹ️ 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".

);
}
} else if (installDaemon) {
if (!gatewayProbe.ok && installDaemon) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat a successful gateway probe as a success path

When waitForGatewayReachable succeeds (gatewayProbe.ok === true), this condition falls through to the else branch and still shows the "Gateway not detected yet" note. That means normal successful onboarding with --skip-health off now reports a false negative to users, which is confusing and can trigger unnecessary troubleshooting even though the gateway is reachable.

Useful? React with 👍 / 👎.

@openclaw-barnacle openclaw-barnacle Bot added the app: macos App: macos label Apr 21, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ff15f62fb

ℹ️ 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".

Comment thread src/wizard/setup.finalize.ts Outdated
} finally {
restoreTerminalState("post-setup tui", { resumeStdinIfPaused: true });
}
await runTui({
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep setup TUI out of the onboarding process

Calling runTui(...) here makes the onboarding flow non-returning for the TUI path: runTui drives its own lifecycle and exits the process (process.exit(0)) when the user leaves TUI, so control never reliably returns to finish the remaining setup steps in this function (shell completion, final notes/outro, and clean finalize behavior). This is a regression from the previous child-process launch behavior and affects any user choosing “Hatch in TUI”.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ab5a80f64

ℹ️ 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".

Comment thread src/plugins/provider-oauth-flow.ts Outdated
} catch {
opened = false;
}
if (opened === false) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat undefined browser-open result as open failure

The new fallback only triggers when openUrl returns false, but several auth call paths pass wrappers that await openUrl(url) without returning its boolean (src/plugins/provider-auth-choice.ts:143 and src/commands/models/auth.ts:303), so opened becomes undefined and this branch is skipped even when browser launch fails. In local/headless environments this regresses the intended manual OAuth fallback and leaves users without the immediate paste-redirect prompt.

Useful? React with 👍 / 👎.

@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Apr 21, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04c38d8ae9

ℹ️ 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".

Comment on lines +405 to +406
token: settings.authMode === "token" ? settings.gatewayToken : undefined,
password: settings.authMode === "password" ? resolvedGatewayPassword : "",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid passing gateway secrets through TUI argv

This onboarding path now forwards the gateway token/password directly into launchTuiCli, which turns them into --token/--password command-line args (src/tui/tui-launch.ts). On multi-user systems (or any environment where process args are inspectable/logged), that exposes live gateway credentials in plaintext via process listings and telemetry. The previous config-auth launch path avoided argv secret exposure, so this is a security regression for users choosing “Hatch in TUI”.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af12ba777f

ℹ️ 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".

Comment thread src/daemon/schtasks.ts
Comment on lines +161 to +163
continue;
}
if (isCmdControlFlowLine(lower)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve env setup when skipping batch control-flow lines

Do not unconditionally skip if/for lines here, because readScheduledTaskCommand then drops environment assignments performed inside control-flow wrappers (for example loading OPENCLAW_GATEWAY_TOKEN from a .env loop). In the fallback path, launchFallbackTaskScript uses the parsed programArguments directly, so that skipped setup block is never executed by cmd.exe, and the relaunched gateway can start without required auth/env values.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0df037ff13

ℹ️ 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".

Comment on lines +328 to +332
const defaultAccount = await buildChannelAccountSnapshot({
plugin,
cfg,
accountId: defaultAccountId,
runtime: runtimeSnapshot,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve activity/probe fields in summary-only channel snapshots

The new includeAccounts: false path builds snapshot directly with buildChannelAccountSnapshot, which skips the extra enrichment done in buildAccountSnapshot (notably lastProbeAt and getChannelActivity fallbacks for lastInboundAt/lastOutboundAt). As a result, channels.status can now return different channel summaries depending on includeAccounts, and summary builders that read those fields (for example WhatsApp’s buildChannelSummary using snapshot.lastInboundAt) can regress to null/stale values in overview requests even when recent activity exists.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3948d98a3

ℹ️ 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".

Comment on lines 401 to +404
if (hatchChoice === "tui") {
restoreTerminalState("pre-setup tui", { resumeStdinIfPaused: true });
try {
await launchTuiCli(
{
// Safety: setup TUI should not auto-deliver to lastProvider/lastTo.
deliver: false,
message: hasBootstrap ? "Wake up, my friend!" : undefined,
},
{
authSource: "config",
gatewayUrl: links.wsUrl,
},
);
} finally {
restoreTerminalState("post-setup tui", { resumeStdinIfPaused: true });
}
await launchTuiCli({
url: links.wsUrl,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore terminal state after failed TUI hatch

This branch now calls launchTuiCli(...) without a post-launch cleanup, so if the TUI exits non-zero (or via signal) onboarding throws before restoring terminal modes. In that failure path, launchTuiCli only resumes stdin, which can leave raw mode/TTY state dirty and break the user’s shell session after onboarding aborts. Please add a guaranteed terminal restore on the error path (e.g., a finally around the launch call).

Useful? React with 👍 / 👎.

Comment thread src/tui/gateway-chat.ts Outdated
Comment on lines +327 to +328
const launchToken = env[TUI_LAUNCH_GATEWAY_TOKEN_ENV];
const launchPassword = env[TUI_LAUNCH_GATEWAY_PASSWORD_ENV];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear one-shot TUI auth env vars after reading

The new launch auth handoff reads OPENCLAW_TUI_LAUNCH_GATEWAY_TOKEN/PASSWORD from process.env, but never scrubs them. That leaves live gateway credentials in the TUI process environment for the entire session, so plugin/tool code and spawned child processes can inherit or inspect them; this is a credential exposure regression, especially when setup resolved a password SecretRef just for bootstrapping TUI auth. These env vars should be deleted immediately after extracting their values.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9fb303e0d

ℹ️ 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".

Comment thread ui/src/ui/controllers/channels.ts Outdated
const res = await state.client.request<ChannelsStatusSnapshot | null>("channels.status", {
probe,
probe: request.probe,
includeAccounts: request.includeAccounts,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Omit default includeAccounts from channels.status requests

Avoid always sending includeAccounts here: when this UI talks to an older gateway that still validates channels.status params without that field (with additionalProperties: false), the request is rejected as invalid and channel status fails entirely. This only needs to be sent for the non-default optimization path (includeAccounts: false), so omitting it when true preserves backward compatibility for mixed-version dashboard/gateway setups.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cacdce423c

ℹ️ 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".

Comment thread ui/src/ui/app-settings.ts
]);
buildAttentionItems(app);
void Promise.allSettled([
loadChannels(app, false, { includeAccounts: false }),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retry channels overview fetch without includeAccounts flag

The overview path now always calls loadChannels(..., { includeAccounts: false }), which sends a new request field that older gateways do not understand. In mixed-version setups (new UI bundle against an older gateway), this causes channels.status to fail on every overview refresh even though the legacy request shape would succeed; loadChannels currently surfaces the error instead of falling back. Add a compatibility retry that reissues the request without includeAccounts when the gateway rejects unknown params.

Useful? React with 👍 / 👎.

cfg,
accountIds,
});
const account = plugin.config.resolveAccount(cfg, defaultAccountId);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Build summary-only channel status from an effective account

The summary-only path resolves and probes only defaultAccountId directly, but that id can be stale/missing in config. The full-account path explicitly falls back to the first available account snapshot, while this new lightweight path does not, so includeAccounts: false responses can report a channel as unconfigured/offline even when another account is active. Mirror the full-path fallback before building/probing the summary snapshot.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae3c1f00b3

ℹ️ 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".

Comment on lines +279 to +282
const defaultAccountId = resolveEffectiveDefaultAccountId({
accountIds,
defaultAccountId: configuredDefaultAccountId,
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep start/logout default account resolution aligned

channels.status now rewrites stale defaults to the first live account via resolveEffectiveDefaultAccountId, so the payload can advertise channelDefaultAccountId as a different account than config. However, channels.start/channels.logout still resolve omitted accountId through resolveChannelGatewayAccountId (which prefers the stale configured default first), so clients that omit accountId can now act on a different account than the one status reports and hit avoidable start/logout failures when the configured default is stale.

Useful? React with 👍 / 👎.

@steipete
Copy link
Copy Markdown
Contributor

Maintainer review: please split/fix before merge.

There are useful changes here, but the PR is too broad and includes a risky plugin-loader regression mixed into unrelated gateway/UI/OAuth/onboarding work.

Main blocker:

  • The diff removes bundled runtime dependency repair from src/plugins/loader.ts and deletes several bundledRuntimeDepsInstaller tests from src/plugins/loader.test.ts. That path is still required: current src/plugins/loader.ts uses ensureBundledPluginRuntimeDeps, resolveBundledRuntimeDependencyInstallRoot, runtime root mirroring, and registerBundledRuntimeDependencyNodePath before loading enabled bundled plugins. Dropping that would break bundled plugins that rely on runtime dependency repair/mirroring.

Suggested path:

  • Split the OAuth browser-open fallback, TUI auth argv cleanup, channel summary loading, Windows scheduled-task parsing, and plugin-loader/memory snapshot changes into separate PRs.
  • Keep the plugin-loader runtime-deps repair intact unless a replacement is included with equivalent tests.
  • For the channel protocol additions, keep schema/docs/generated client surfaces together.

Not a close; there are good pieces here. It just needs decomposition and the loader regression removed.

@greptile-apps greptile-apps Bot mentioned this pull request Apr 23, 2026
25 tasks
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented Apr 26, 2026

Closing this as duplicate or superseded after Codex automated review.

#69584 should close as superseded. The original PR is an unsafe mixed branch that maintainer review asked to split before merge, and the canonical replacement is open PR #70474, which explicitly says it is the reviewable split extracted from #69584. Current main also still preserves the plugin-loader runtime-dependency repair that the maintainer called out as required, so the broad original should not be merged as-is.

Best possible solution:

Close #69584 as superseded by the narrower #70474 review path. Continue review and fixes on #70474, and use additional small PRs for any remaining slices rather than merging the original broad branch with the loader regression risk.

What I checked:

  • maintainer_split_request: Maintainer review on [codex] fix gateway runtime flow follow-ups #69584 says the PR is useful but too broad, identifies a risky plugin-loader regression, and asks to split OAuth fallback, TUI auth argv cleanup, channel summary loading, Windows scheduled-task parsing, and plugin-loader/memory work into separate PRs while keeping runtime-deps repair intact. Comment URL: [codex] fix gateway runtime flow follow-ups #69584 (comment).
  • canonical_split_pr: PR Codex/pr69584 split #70474 is open and unmerged at head dcd1dc8. Its body says it is the reviewable split extracted from original [codex] fix gateway runtime flow follow-ups #69584 and keeps the setup/provider-auth/channel-status slice independently reviewable. URL: Codex/pr69584 split #70474. (dcd1dc8b71a7)
  • split_omits_loader_regression_surface: The Codex/pr69584 split #70474 file list covers the setup/provider-auth/channel-status/scheduled-task/TUI/UI files from the original split path but does not include src/plugins/loader.ts or src/plugins/loader.test.ts, matching the maintainer request to keep the loader runtime-dependency repair out of the replacement slice. (dcd1dc8b71a7)
  • loader_repair_still_present: Current main imports ensureBundledPluginRuntimeDeps, resolveBundledRuntimeDependencyInstallRoot, and registerBundledRuntimeDependencyNodePath, then calls/uses them before loading enabled bundled plugins; this is the exact runtime-deps repair path the maintainer review said must remain. (src/plugins/loader.ts:34, 9a529ca78bfa)
  • loader_tests_still_cover_runtime_deps: Current main still has bundledRuntimeDepsInstaller tests covering installed specs and bundled runtime dependency behavior, supporting the maintainer concern that deleting this coverage in the original mixed PR would be unsafe. (src/plugins/loader.test.ts:965, 9a529ca78bfa)

So I’m closing this here and keeping the remaining discussion on the canonical linked item.

Codex Review notes: model gpt-5.5, reasoning high; reviewed against 9a529ca78bfa.

@clawsweeper clawsweeper Bot closed this Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos app: web-ui App: web-ui channel: msteams Channel integration: msteams commands Command implementations extensions: minimax gateway Gateway runtime size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants