Skip to content

fix(server): send Codex browser guidance as application context - #12739

Closed
riccardopll wants to merge 1 commit into
pingdotgg:mainfrom
riccardopll:riccardo/prefer-integrated-browser
Closed

riccardopll wants to merge 1 commit into
pingdotgg:mainfrom
riccardopll:riccardo/prefer-integrated-browser

Conversation

@riccardopll

@riccardopll riccardopll commented Sep 20, 2026 •

Copy link
Copy Markdown

What Changed

Move the existing Codex browser guidance from collaboration-mode instructions into keyed application context. Keep the wording and preview-tool availability gate unchanged.

Why

Codex can choose bundled Computer Use despite T3’s browser guidance. Presenting that guidance separately improved tool selection without appending it to each user message. This is a workaround, ideally Codex should not assume that no integrated browser is available when the bundled Computer Use plugin is inactive.

Refs #11579.

Validation

30 fresh-session live-model trials, using five browser tasks, a mock T3 MCP endpoint, and bundled Computer Use:

  • T3 tool selection, before → after: Default 0/5 → 5/5; Plan 5/5 → 5/5.
  • Actual preview_status dispatch: 5/5.
  • Explicit Safari/Helium/Chrome requests respected: 3/3.
  • Preview disabled: alternative browser selected 2/2.

These verify tool selection and dispatch, not rendering. A separate request-capture check found one browser-rule copy across four turns, including a mode change; restarting Codex adds another copy.

All 50 focused runtime tests, targeted lint/format checks, and server typecheck passed.

Checklist

  • Small, focused change
  • Explained what changed and why
  • No UI changes

Implemented with GPT-6 in Codex; live tests used gpt-6-astra (medium reasoning) through Codex app-server 0.155.1.

Summary by CodeRabbit

  • Improvements
    • Browser and device tool guidance is now handled separately, providing more accurate instructions for each environment.
    • Turn-start requests now include browser guidance only when browser tools are available.
    • Browser tool access defaults to unavailable unless explicitly enabled, preventing unsupported browser actions.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 20, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This changes Codex’s automatic browser-tool guidance and default tool-selection behavior by moving existing instructions into application context and applying them on browser-enabled turns. The implementation is focused and tested, but the behavior change affects the default runtime path and warrants human review.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f032dff3-8e0c-4809-8900-18cb375fd92e

📥 Commits

Reviewing files that changed from the base of the PR and between 7445aa7 and d210509.

📒 Files selected for processing (3)
  • apps/server/src/provider/CodexDeveloperInstructions.ts
  • apps/server/src/provider/Layers/CodexSessionRuntime.test.ts
  • apps/server/src/provider/Layers/CodexSessionRuntime.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The change separates browser instructions from device instructions. Turn-start parameters now provide browser guidance through additionalContext.t3_browser when browser tools are available. Tests cover availability, interaction modes, and instruction content.

Changes

Browser context delivery

Layer / File(s) Summary
Separate browser and device instructions
apps/server/src/provider/CodexDeveloperInstructions.ts
The instruction helpers now generate browser and device guidance separately. Plan and Default modes append device instructions only.
Attach browser guidance to turn-start context
apps/server/src/provider/Layers/CodexSessionRuntime.ts
buildTurnStartParams adds browser instructions as an application entry under additionalContext.t3_browser when browser tools are available. The default availability value is now false.
Validate browser context behavior
apps/server/src/provider/Layers/CodexSessionRuntime.test.ts
Tests cover browser context delivery, unavailable browser tools, interaction modes, image-only turns, and standalone browser instruction content.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant buildTurnStartParams
  participant buildCodexBrowserInstructions
  Caller->>buildTurnStartParams: provide browserToolsAvailable
  buildTurnStartParams->>buildCodexBrowserInstructions: generate browser instructions
  buildCodexBrowserInstructions-->>buildTurnStartParams: return instructions
  buildTurnStartParams-->>Caller: return additionalContext.t3_browser
Loading

Suggested reviewers: juliusmarminge, t3dotgg

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: sending Codex browser guidance as application context.
Description check ✅ Passed The description includes the required What Changed, Why, and Checklist sections. It also documents validation results and states that no UI changes were made.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

@juliusmarminge

Copy link
Copy Markdown
Member

Superseded by merged #13547, which moves Codex browser/device tool guidance (along with runtime info and PR linking) out of collaboration-mode developer_instructions into turn/start.additionalContext as application entries — the same delivery path this PR targeted, plus compaction restore for newer model catalogs that override Default-mode text.

Closing this PR as superseded. Please reopen if anything unique here is still needed beyond #13547.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants