Skip to content

fix(server): attachments are no longer silently dropped from prompts - #21356

Merged
maria-rcks merged 4 commits into
mainfrom
t3/attachments-never-dropped
Oct 25, 2026
Merged

maria-rcks merged 4 commits into
mainfrom
t3/attachments-never-dropped

Conversation

@maria-rcks

Copy link
Copy Markdown
Collaborator

before: four pasted attachments are visible, but codex receives no saved paths

after: codex lists all four saved attachment paths

before: pi silently loses an attachment with an unresolved path

after: pi identifies the unresolved attachment as unavailable

attachment paths disappeared when generated context exceeded 120,000 characters, and pi silently skipped unresolved attachments. every attachment now has a path or an explicit unavailable entry. optional captured-window context keeps its budget and reports truncation; pi uses the shared formatter.

git history traces the guard to the orchestrator introduction (de34391), alongside the captured-window budget test, with no provider-specific hard limit documented. codex, claude, cursor, acp/grok, muse, and both opencode adapters already use the shared formatter and inherit the fix.

blacksmith passed 104 focused tests, both package typechecks, and scoped lint with zero errors and one existing warning. real web/codex turns with matching 119,984-character messages and four pasted files returned 0/4 paths before and 4/4 after. real pi turns with forward-compatible attachment metadata that resolves to null changed from "no attachments received" to naming the unavailable file. other providers were source-audited, not exercised live.

Built by gpt-6.1-sol in Codex, orchestrated from T3 Code.

@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Oct 18, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 18, 2026
@github-actions github-actions Bot added the size:M 30-99 changed lines (additions + deletions). label Oct 18, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 18, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 859796e

Macroscope's review found this PR approvable — This is a localized server bug fix that preserves attachment paths or explicitly reports unavailable attachments, while keeping optional captured-window context within its budget. Pi now uses the shared formatter, with focused tests covering the boundary and unresolved-attachment cases.

No code changes detected at ee75562. Prior analysis still applies.

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

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: 1eb4071 · PR result: ee75562 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

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: 55d10d07-afce-4990-ac13-fb66adc71bb0
📥 Commits

Reviewing files that changed from the base of the PR and between 037fddf and 859796e.

📒 Files selected for processing: 2
  • packages/provider-core/src/server/attachmentPrompt.test.ts
  • packages/provider-pi/src/server/adapter.test.ts

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

📝 Walkthrough

The prompt builder now includes attachment paths or unavailable notices and omits optional captured-window context when it cannot fit within the input limit. The provider adapter uses this builder and continues to include image payloads.

Changes: Attachment prompt construction

Layer / File(s) Summary
Attachment entries and context budget
packages/provider-core/src/server/attachmentPrompt.ts, packages/provider-core/src/server/attachmentPrompt.test.ts
The prompt builder adds a path entry or unavailable notice for each attachment. It reserves space for a truncation notice before adding optional captured-window context. Tests cover input-limit boundaries, unavailable attachments, and omitted context.
Provider adapter prompt integration
packages/provider-pi/src/server/adapter.ts, packages/provider-pi/src/server/adapter.test.ts
The adapter uses the shared prompt builder for message text and attachment paths. It continues to encode image attachments as native payloads. Tests cover resolvable paths, image data, and unavailable attachments.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 85979

The attachment prompt changes are mergeable after normal checks; no actionable issue remains.

Security architecture risk: 🔵 Low · up to 85979

Attachment availability becomes explicit without adding file-reading privileges. The main considerations are handling captured-window content as untrusted data and ensuring providers accept messages that exceed the text-input budget after attachment entries are added.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The directly established exposure is attachment-derived content entering the selected provider’s prompt. In Pi, more attachment metadata becomes visible, but the inspected change does not add file writes, credential access, or new file-reading authority.

Trust Boundaries and Controls

  • observed — Both Pi text formatting and native image loading use the host-provided attachment resolver. Null paths produce unavailable text and skip native reads. The host contract requires paths to resolve inside the attachment directory, but its concrete enforcement was not inspected.
Pre-merge checks: Passed 4
Check name Status Explanation
Description check Passed The description clearly states the problem, explains the implementation, documents scope, and provides detailed verification results. It also identifies the agent and harness used. The required templa…
Title check Passed The title clearly and concisely describes the primary change: preventing attachments from being silently dropped from prompts.
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.
Full details: Description check

Explanation

The description clearly states the problem, explains the implementation, documents scope, and provides detailed verification results. It also identifies the agent and harness used. The required template headings are omitted, but the required information is present and the focused bug rationale addresses the scope requirement.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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.

@macroscopeapp
macroscopeapp Bot dismissed their stale review October 21, 2026 02:01

Dismissing prior approval to re-evaluate 859796e

@maria-rcks
maria-rcks merged commit 550f119 into main Oct 25, 2026
29 of 30 checks passed
@maria-rcks
maria-rcks deleted the t3/attachments-never-dropped branch October 25, 2026 19:04
bitflippr added a commit to skulldorged/t3code that referenced this pull request Oct 25, 2026
Take upstream's attachment prompt handling (pingdotgg#21356) in place of the fork's AttachmentPromptError and prepareProviderMessageText.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pipyakas pushed a commit to Pipyakas/t3code that referenced this pull request Oct 25, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 26, 2026
## What's Changed
* fix(server): attachments are no longer silently dropped from prompts by @maria-rcks in pingdotgg/t3code#21356
* fix(mobile): images picked with choose files reach the agent as images by @maria-rcks in pingdotgg/t3code#21352
* feat(web): attach svg files to messages by @maria-rcks in pingdotgg/t3code#21355
* feat(server): send pdf attachments to claude and antigravity as documents by @maria-rcks in pingdotgg/t3code#21358
* feat(mobile): play audio inline and open shared files in the viewer by @maria-rcks in pingdotgg/t3code#21353
* feat(web): play audio inline and open any file the agent shares in the viewer by @maria-rcks in pingdotgg/t3code#21363
* perf(pull-requests): faster pull request timeline, code tab, summary and search by @maria-rcks in pingdotgg/t3code#22697
* perf(mobile): bound streaming markdown cache and pending work by @juliusmarminge in pingdotgg/t3code#24263
* fix(web): question options show a radio and an aligned shortcut key by @maria-rcks in pingdotgg/t3code#23255
* fix(server): notify parents after delegated background runs by @juliusmarminge in pingdotgg/t3code#23542
* fix(server): running delegates tell agents to end the turn by @t3dotgg in pingdotgg/t3code#24887
* perf(ci): cache server tests individually across shards by @juliusmarminge in pingdotgg/t3code#24966
* feat(mobile): one cached native-client install command for agents and machines by @juliusmarminge in pingdotgg/t3code#24965
* perf(source-control): pull request previews read only the pull request by @maria-rcks in pingdotgg/t3code#22583
* feat(infra): native client cache panels on the task cache dashboard by @juliusmarminge in pingdotgg/t3code#24994
* feat(web): UI design overhaul, with the new look behind a Beta toggle by @t3dotgg in pingdotgg/t3code#24865
* test(server): tests no longer depend on the host machine by @t3dotgg in pingdotgg/t3code#25001
* perf: opening a thread loads 85% less data by @t3dotgg in pingdotgg/t3code#24899
* fix(server): orchestrator records command count and duration again by @yordis in pingdotgg/t3code#23966
* fix(observability): every app reports its own environment and release channel by @yordis in pingdotgg/t3code#24340
* chore(lint): React effects can't grow past each file's budget by @juliusmarminge in pingdotgg/t3code#24964
* fix(observability): every exported resource names its service instance by @yordis in pingdotgg/t3code#23973
* fix(install): stable installs no longer fail behind a page of nightlies by @t3dotgg in pingdotgg/t3code#22907
* fix(server): Grok refresh no longer restores removed models from cache by @t3dotgg in pingdotgg/t3code#22849
* fix(server): resume fallback keeps the latest turn when an older handoff is pending by @t3dotgg in pingdotgg/t3code#22902
* fix(client-runtime): "Codex (hub)" badges read CH instead of C( by @t3dotgg in pingdotgg/t3code#22918
* fix(mobile): retain requested PR environment while connecting by @juliusmarminge in pingdotgg/t3code#24262
* fix(web): usage-limit banner reset time follows the Time format setting by @t3dotgg in pingdotgg/t3code#22915
* fix(web): terminal drag selection scrolls faster the farther past the edge by @t3dotgg in pingdotgg/t3code#22872
* fix(observability): resources add OTel semconv runtime and browser keys by @yordis in pingdotgg/t3code#23972
* chore(lint): main passes lint again with effects merged after the budget by @t3dotgg in pingdotgg/t3code#25055
* fix(server): ended roots no longer leave provider turns running by @t3dotgg in pingdotgg/t3code#22846
* feat(mobile): open threads and devices in a resizable iOS inspector by @juliusmarminge in pingdotgg/t3code#24985
* chore(web): measure renders before/after with render scenarios by @juliusmarminge in pingdotgg/t3code#24980
* fix(web): asset URLs re-mint per revision and before expiry without effects by @juliusmarminge in pingdotgg/t3code#24970
* fix(web): queued-message edits survive navigation and settle once by @juliusmarminge in pingdotgg/t3code#24972
* refactor(mobile): thread visits are tracked outside React by @juliusmarminge in pingdotgg/t3code#24973
* refactor(client): cloud account transitions run in one service by @juliusmarminge in pingdotgg/t3code#24974
* refactor(client): one VCS status refresh owner per checkout by @juliusmarminge in pingdotgg/t3code#24975
* refactor(web): document appearance and title are applied from app start by @juliusmarminge in pingdotgg/t3code#25004
* refactor(web): app shell shortcuts register once through one command dispatcher by @juliusmarminge in pingdotgg/t3code#25016
* refactor(web): shared intersection and document-activity stores by @juliusmarminge in pingdotgg/t3code#25020
* refactor(web): the theme store and diff worker pool stop syncing the theme through effects by @juliusmarminge in pingdotgg/t3code#25007
* fix(server): keep history discovery off the writer and pace compaction by @JustYannicc in pingdotgg/t3code#20877
* perf(mobile): compact persisted thread snapshots by @juliusmarminge in pingdotgg/t3code#24265


**Full Changelog**: pingdotgg/t3code@v0.1.3-nightly.20261025.3682...v0.1.3-nightly.20261025.3692

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.3-nightly.20261025.3692
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants