t3code icon indicating copy to clipboard operation
t3code copied to clipboard

fix(server): respect Codex default-mode user input

Open eimexdev opened this issue 3 months ago • 2 comments

Fixes #5282

T3 Code always injected instructions saying request_user_input was unavailable in Default mode, even when the effective Codex configuration enabled default_mode_request_user_input.

This change queries Codex's experimentalFeature/list API using the loaded provider thread ID, caches the effective state for the session, and removes the conflicting Default-mode restrictions when enabled. Missing, disabled, unsupported, or failed feature detection preserves the existing behavior.

The existing web, desktop, and mobile structured-question flow remains unchanged. No T3-specific setting or universal override is added.

Checks:

  • vp test run apps/server/src/provider/Layers/CodexSessionRuntime.test.ts
  • vp test run apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.ts
  • vp run -F t3 typecheck
  • targeted type-aware lint

Implemented with gpt-5.6-sol through the Codex harness in T3 Code.


[!NOTE] Medium Risk Changes agent-facing developer instructions for all Default-mode Codex turns when the feature is on; detection fails closed, but mis-detection could confuse tool-use behavior.

Overview Stops always telling Codex that request_user_input is unavailable in Default mode when Codex’s effective config enables the experimental default_mode_request_user_input feature.

After a provider thread opens, the session runtime calls experimentalFeature/list (with pagination), caches whether that feature is enabled, and passes that into buildCodexDeveloperInstructions. When enabled, Default-mode developer instructions allow structured questions via request_user_input when the tool is available for the turn; when disabled, missing, or if discovery fails, behavior stays fail-closed to the old “unavailable / will error” wording.

User-facing docs note there is no separate T3 setting—restart and a fresh thread after toggling the flag in Codex.

Reviewed by Cursor Bugbot for commit 81fedeab3aa1681219038cfe73f57d4f1928dc6a. Bugbot is set up for automated code reviews on this repo. Configure here.

[!NOTE]

Respect Codex default_mode_request_user_input experimental feature flag in session runtime

  • Adds detectCodexDefaultModeRequestUserInput in CodexSessionRuntime.ts, which pages through experimentalFeature/list RPC calls after opening a provider thread to detect whether Codex has enabled the feature.
  • When the feature is detected, buildTurnStartParams passes defaultModeRequestUserInputEnabled: true through to buildCodexDeveloperInstructions, switching to a new instruction variant that permits and guides use of the request_user_input tool.
  • Adds the new CODEX_DEFAULT_MODE_USER_INPUT_ENABLED_DEVELOPER_INSTRUCTIONS constant in CodexDeveloperInstructions.ts with guidance to ask concise plain-text questions only when necessary and avoid multiple-choice questions.
  • Documents the behavior in providers-codex.md: no separate setting is needed; users should restart and open a fresh thread after toggling the flag in Codex.
  • Behavioral Change: on session start the runtime now issues one or more experimentalFeature/list RPCs; errors are caught, logged at debug level, and fall back to false.
📊 Macroscope summarized 81fedea. 1 file reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

eimexdev avatar Aug 07 '26 03:08 eimexdev

[!IMPORTANT]

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b67d9a8c-c0a9-4f6e-8fbf-2da9155196de

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • [ ] 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot] avatar Aug 07 '26 03:08 coderabbitai[bot]

Approvability

Verdict: Needs human review

1 blocking correctness issue found. Two unresolved review comments identify a potential logic issue: when the request_user_input feature is enabled, the instructions still direct the model to ask plain-text questions instead of using the tool, which may defeat the purpose of the change.

You can customize Macroscope's approvability policy. Learn more.

macroscopeapp[bot] avatar Aug 07 '26 03:08 macroscopeapp[bot]

[!NOTE] 🤖 GPT-5.6 Sol responding on behalf of Theo

I am closing this because #6432 has landed in main and makes default-mode instructions respect the available user-input tools. I checked the current implementation and did not find any remaining change from this PR that we still need to merge.

Thank you for putting this together. The closure is only because the work is now covered elsewhere, not because there was a problem with your contribution.

t3dotgg avatar Aug 27 '26 07:08 t3dotgg