Repository navigation
fix(file-transfer): avoid repeated directory record encoding - #151987
Conversation
Punchcard-Session: ember-river-harbor-t4
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 1:23 PM ET / 17:23 UTC. ClawSweeper reviewWhat this changesThe file-transfer plugin reuses encoded directory records when building bounded tool responses, with regression checks for encoding work and unchanged output. Merge readiness✅ Ready for maintainer review Keep open: the optimization remains useful on current main, and no introduced correctness or security defect was found. This member-authored PR is also protected from automatic closure. Priority: P2 Review scores
Verification
How this fits togetherFile-transfer tools receive directory listings or archives from paired nodes and return readable summaries to the agent. These renderers limit summary size while preserving complete filenames, continuation tokens, and saved-file details. flowchart TD
A[Agent directory request] --> B[Paired node]
B --> C[Directory listing or fetched archive]
C --> D[Encode summary records once]
D --> E[Validate security wrapper and byte limit]
E --> F[Bounded agent response]
C --> G[Complete details and saved files]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -6, Tests +70. Total +64 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep this optimization within the existing renderers, preserving exact output and safety checks without adding configuration or another serialization owner. Do we have a high-confidence way to reproduce the issue? Yes, for repeated encoding: current main serializes every accepted record again on each candidate iteration. This was verified from source, not a locally executed failure or latency benchmark. Is this the best way to solve the issue? Yes. Reusing native JSON fragments removes repeated record encoding at the existing owner while retaining complete-output validation; it does not claim to eliminate candidate assembly or wrapper scanning. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d8b6873518d2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: test(gateway): isolate session resolution channel fixtures (#151945) fix(clickclack): drain discussion opens before shutdown (#151978) fix(test): restore trusted packaging harness startup (#151967) improve(codex): batch session adoption binding reads (#151979) improve(cron): reduce allocations for busy stream sources (#151956) fix(file-transfer): avoid repeated directory record encoding (#151987) fix: avoid session-list rebuilds when authentication availability changes (#151920) fix(updates): explain externally managed update refusals (#151942) improve(heartbeat): avoid unused config work in membership checks (#151867) fix(android): keep status text readable and label accessibility actions (#151342) improve(ui): show OS and size in the environment selector (#151947) fix(android): keep tool errors visible in collapsed chat activity (#151332)
…w#151987) Punchcard-Session: ember-river-harbor-t4
What Problem This Solves
Large directory listings and fetched-directory summaries repeatedly serialize every previously accepted record while checking the text limit.
User Impact
Directory tools perform fewer record encodings while preserving the 8192-byte wrapped-text limit, exact filenames, pagination, saved files and attachment order. No configuration or migration is required.
Why This Change Was Made
The existing text renderers encode each projected record once and reuse its JSON fragment while assembling candidate summaries. Native JSON encoding still owns escaping and field order; complete-wrapper validation and reserved-marker handling remain unchanged. Candidate assembly and security-wrapper scans still occur.
Evidence
Punchcard-Session: ember-river-harbor-t4