Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Closedriccardopll(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/12739/headopened View on GitHub

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.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. 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](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      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 7445aa733ada33e45289e5aa5055f79142556513 and d210509d029e53767f14239394e1aefaae2e6dfd.

      📒 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

      Suggested reviewers: juliusmarminge, t3dotgg

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring 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 nameStatusExplanation
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly and concisely describes the main change: sending Codex browser guidance as application context.
      Description check✅ PassedThe 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.
    4. 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.

    5. juliusmarminge closed this

Sign in to join this conversation.