Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): tell agents to link outside files by absolute path #18370

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

Agents that change directories can return a relative link such as [report](report.md) for a file outside the thread workspace. T3 resolves that target from the workspace root, so the preview tries to open the wrong file. The shared runtime instructions currently explain absolute paths for embedded images and videos, but omit the base directory for file links.

Tell agents that relative reply links resolve from the thread workspace and to use absolute targets for files outside it. Update the five Muse replay transcripts because their outbound prompt expectations compare the injected instructions exactly. This is a small, focused correction of an obvious mismatch between the agent's context and existing file-link behavior, submitted under the focused bug-fix exception in CONTRIBUTING.md.

Verification on Linux against upstream c0c495e4dc:

  • vp test run packages/provider-core/src/server/runtimeInstructions.test.ts packages/shared/src/markdownLinks.test.ts: 139 passed.
  • vp test run apps/server/src/orchestration-v2/testkit/OrchestratorReplayFixtures.integration.test.ts -t /muse: all 5 Muse scenarios passed; 132 unrelated cases excluded by the filter.
  • Targeted vp lint and vp fmt --check for runtimeInstructions.ts, provider-core tsc --noEmit, and git diff --check: passed.
  • A temporary direct probe reproduced relative targets resolving to the workspace and verified that absolute outside-workspace targets survive resolution with both POSIX and Windows path syntax. It also checked the new guidance in the shared runtime output. No browser session or native Windows runtime was exercised; agent compliance with the wording was not measured.

Ported from the existing fork fix by Alb11747 and Claude Opus 5.5. Port, review, and verification by GPT-6.1-Sol through the Codex harness in T3 Code.

    1. chatgpt-codex-connector[bot](GitHub profile, opens in a new tab)commented

      Codex Review Summary

      This comment shows the latest Codex review activity on this pull request.

      ReviewStatusCommitReview trigger
      📝 Code Review✅ Completed 2026-10-11T22:17:35.340924Z94d951fPR opened
      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review" or "@codex security review".

      Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — The PR updates shared runtime instructions used across multiple providers, changing the default guidance agents receive about resolving file links. Although the code and fixture changes are small and localized, the cross-provider product-default change warrants human review.

      Notes:

      • Diff unchanged. Approvability was decided on eligibility alone.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. juliusmarminge added labelsmacroscope-review

    5. 💡 Codex Review

      Here are some automated review suggestions for this pull request.

      Reviewed commit: 94d951f856

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

      @@ -20,4 +20,4 @@
      2020 modelName && modelName !== model ? `${modelName} (model slug: ${model})` : model;
      2121 const modelInfo = model && model !== "auto" && model !== "default" ? `, as ${modelLabel}` : "";
      2222 const effortInfo = effort ? ` with ${effort} reasoning effort` : "";
      23- return `<runtime_info>In case you're asked: you are running in T3 Code through the ${harness} harness${modelInfo}${effortInfo}. No need to mention this otherwise. You can embed images and videos in your response using Markdown with absolute file paths.</runtime_info>\n\n${PULL_REQUEST_LINKING_INSTRUCTIONS}`;
      23+ return `<runtime_info>In case you're asked: you are running in T3 Code through the ${harness} harness${modelInfo}${effortInfo}. No need to mention this otherwise. You can embed images and videos in your response using Markdown with absolute file paths. In your replies, relative file links resolve from this thread's workspace root, regardless of your shell's current directory. Use absolute paths for files outside the workspace.</runtime_info>\n\n${PULL_REQUEST_LINKING_INSTRUCTIONS}`;

      P2 Badge Add the file-link guidance to Pi's system prompt

      When a thread uses the Pi driver, this clause never reaches the agent: the only Pi system-prompt injection (packages/provider-pi/src/server/mcpExtensionSource.ts:449-453) appends ORCHESTRATION_INSTRUCTIONS, and there is no buildRuntimeInstructions use under packages/provider-pi. A Pi agent that changes directories and then links an outside file can therefore keep emitting a CWD-relative target that T3 resolves against the workspace, so the bug this change addresses remains on that supported provider; include the shared runtime guidance in Pi's before_agent_start prompt as well.

      AGENTS.md reference: AGENTS.md:L71-L71

      Useful? React with 👍 / 👎.

    6. Review in Change Stack →

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Path: .coderabbit.config.ts
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 5e887e9f-cab5-440e-ba43-6f43068e8a9a

      📥 Commits

      Reviewing files that changed from the base of the PR and between c0c495e4dc12bbb0bb44387657a5682661cdd05c and 94d951f856bdfe5644ccec520767369c99812ddf.


      📒 Files selected for processing (6)
      • apps/server/src/orchestration-v2/testkit/fixtures/multi_turn/muse_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/muse_permission/muse_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/muse_workflow/muse_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/simple/muse_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt/muse_transcript.ndjson
      • packages/provider-core/src/server/runtimeInstructions.ts

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



      📝 Walkthrough

      Walkthrough

      The runtime instructions now define workspace-relative file links and absolute paths for files outside the workspace. Muse test transcripts also record updated runtime and pull-request workflow guidance.

      Changes

      Muse guidance updates

      Layer / File(s)Summary
      Workspace path guidance
      packages/provider-core/src/server/runtimeInstructions.ts
      The runtime message specifies that relative file links resolve from the workspace root and that files outside the workspace require absolute paths.
      Transcript guidance updates
      apps/server/src/orchestration-v2/testkit/fixtures/*/muse_transcript.ndjson
      The fixtures record expanded runtime and pull-request workflow instructions. The permission fixture adds a turn requesting a file creation and a REJECTED reply if permission is denied.

      Priority: ⬇️ Low

      Estimated code review effort: 1 (Trivial) | ~5 minutes

      Change: Bug fix

      Suggested reviewers: t3dotgg


      Merge Risk: ⚪ Minimal · up to 94d95

      The update clarifies how reply links target files inside and outside the thread workspace. The production path bases align, and no actionable merge risk remains.

      Architecture Summary

      Architecture risk: 🔵 Low · up to 94d95

      The change affects 2 systems.

      Changed systems: packages/provider-core, apps/server

      Architecture concerns No architecture-level concerns identified.

      Review details

      Systems and components

      • observed — packages/provider-core (library) was modified; 1 changed file maps to changed impact.
      • observed — apps/server (service) was modified; 5 changed files map to changed impact.

      Before / after behavior

      • observed — Modified behavior in apps/server/src/orchestration-v2/testkit/fixtures/multi_turn/muse_transcript.ndjson: The first turn’s outbound input and recorded completed user message add guidance that relative file links resolve from the workspace root and paths outside the workspace should be absolute. The outbound input also retains the existing response instruction.
      • observed — Modified behavior in apps/server/src/orchestration-v2/testkit/fixtures/multi_turn/muse_transcript.ndjson: The second turn’s outbound input and recorded completed user message add the same file-link path guidance; its requested response remains unchanged.
      • observed — Modified behavior in apps/server/src/orchestration-v2/testkit/fixtures/muse_permission/muse_transcript.ndjson: The first turn’s input now adds runtime guidance and pull-request-linking instructions. Its recorded user-message entries include that expanded text and display text, replacing the shorter runtime guidance in the prior input and omitting the prior recorded-message revision.
      • observed — Modified behavior in apps/server/src/orchestration-v2/testkit/fixtures/muse_permission/muse_transcript.ndjson: A second turn is added with instructions to run touch muse-declined.txt once and reply REJECTED if rejected. The recorded user message includes the new instructions and display text, replacing the previous turn-start input that lacked the added runtime guidance and pull-request-linking text.

      Pre-merge checks | Passed 4
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title checkPassedThe title is concise, specific, and accurately describes the main runtime-instruction change.
      Description checkPassedThe description explains the problem, change, focused bug-fix scope, detailed verification results, limitations, and agent attribution. It is complete despite not using the template headings explicitl…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.

      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Comment `@coderabbitai help` to get the list of available commands.
    7. Moving this back to the existing bug report for maintainer direction: https://github.com/pingdotgg/t3code/issues/10553#issuecomment-6114669743. It now includes the path-resolution evidence, the Pi coverage finding, and validation limits. Closing this PR at the author’s request; the implementation remains available for reference.

Sign in to join this conversation.