fix(cli,hub): resolve typecheck errors in codex reasoning effort (#432)

* fix(cli,hub): resolve typecheck errors in codex reasoning effort and notification test

- Cast `getModelReasoningEffort()` return (string | null) to
  `ReasoningEffort | undefined` at three call sites in
  codexLocalLauncher.ts and runCodex.ts where the narrower type is
  expected.
- Add missing `modelReasoningEffort: null` default in
  notificationHub.test.ts to satisfy the Session type contract.

These errors were introduced in 79a13d2 and have been failing CI on
main since 2026-04-10.

* fix(cli): add missing getModelReasoningEffort to test mock session

The test stub in codexLocalLauncher.test.ts was missing the
getModelReasoningEffort method added in 79a13d2, causing runtime
TypeError in CI.
This commit is contained in:
Haoqing Wang
2026-04-11 16:44:06 +08:00
committed by GitHub
parent ef87e30727
commit c62a1eb151
4 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import { logger } from '@/ui/logger';
import { codexLocal } from './codexLocal';
import type { ReasoningEffort } from './appServerTypes';
import { CodexSession } from './session';
import { createCodexSessionScanner } from './utils/codexSessionScanner';
import { convertCodexEvent } from './utils/codexEventConverter';
@@ -42,7 +43,7 @@ export async function codexLocalLauncher(session: CodexSession): Promise<'switch
await codexLocal({
path: session.path,
sessionId: resumeSessionId,
modelReasoningEffort: session.getModelReasoningEffort() ?? undefined,
modelReasoningEffort: (session.getModelReasoningEffort() ?? undefined) as ReasoningEffort | undefined,
onSessionFound: handleSessionFound,
abort: abortSignal,
codexArgs,