@@ -15,12 +15,14 @@ import { join, dirname, resolve } from "node:path";
1515import { fileURLToPath } from "node:url" ;
1616import { spawn } from "node:child_process" ;
1717import { loadConfig , type Config } from "../src/config/index.js" ;
18- import { runExec } from "../src/exec/runner.js" ;
18+ import { runExec , resolveExecDirectorOverlay } from "../src/exec/runner.js" ;
1919import { SETTINGS_DIR_NAME } from "../src/branding.js" ;
2020import { codexProfileFromProviderName } from "../src/config/codex-providers.js" ;
2121import { codexInstructionsHash } from "../src/auth/codex/instructions.js" ;
2222import { advertisedToolNamesForSessionMode } from "../src/agent/tool-search.js" ;
2323import { detectLanguageServerAvailable } from "../src/agent/lsp-availability.js" ;
24+ import { resolveSessionMode } from "../src/config/session-mode.js" ;
25+ import { loadLocalSettings , localSettingsPath } from "../src/config/settings.js" ;
2426import {
2527 loadEvalCases ,
2628 filterCases ,
@@ -539,14 +541,24 @@ async function resolveVariantLabels(
539541/**
540542 * Per-cell diagnostics for debugging eval failures: which Codex instructions
541543 * text was pinned, which built-in tools the model was offered, and the
542- * requested reasoning effort. Mirrors the exec runner's own session-mode/tool
543- * gating (see src/agent/tool-search.ts) rather than re-running toolset setup.
544+ * requested reasoning effort. Reuses the exec runner's own resolution
545+ * (resolveSessionMode, resolveExecDirectorOverlay) rather than forking the
546+ * logic, so a --director overlay or a non-default session mode here reports
547+ * the same advertised list exec actually runs with.
548+ *
549+ * reasoningEffort echoes the configured value, not the provider's internal
550+ * default when unset — accepted as-is per review.
544551 */
545- export function buildEvalDiagnostics ( config : Config ) : EvalDiagnostics {
552+ export async function buildEvalDiagnostics ( config : Config ) : Promise < EvalDiagnostics > {
546553 const codexProfile = codexProfileFromProviderName ( config . providerName ) ;
547- const advertisedTools = advertisedToolNamesForSessionMode ( "orchestrator" , {
548- languageServerAvailable : detectLanguageServerAvailable ( config . cwd ) ,
549- } ) ;
554+ const localSettings = await loadLocalSettings ( localSettingsPath ( config . cwd ) ) . catch ( ( ) => null ) ;
555+ const sessionMode = resolveSessionMode ( config . settings , localSettings ) ?? "orchestrator" ;
556+ const overlay = resolveExecDirectorOverlay ( config . director ) ;
557+ const advertisedTools =
558+ overlay . advertisedAllow ??
559+ advertisedToolNamesForSessionMode ( sessionMode , {
560+ languageServerAvailable : detectLanguageServerAvailable ( config . cwd ) ,
561+ } ) ;
550562 return {
551563 codexInstructionsHash : codexProfile !== undefined ? codexInstructionsHash ( ) : null ,
552564 advertisedTools,
@@ -657,7 +669,7 @@ async function runCase(
657669 ) ;
658670 }
659671
660- const diagnostics = buildEvalDiagnostics ( config ) ;
672+ const diagnostics = await buildEvalDiagnostics ( config ) ;
661673 const agentStarted = Date . now ( ) ;
662674 // runExec runs the agent in-process (no child, unlike verify.sh below), so
663675 // the fixture origin must reach it via process.env directly for the
0 commit comments