Skip to content

fix(devin): accumulate consecutive tool results without prefix copies - #6657

Merged
lidge-jun merged 2 commits into
lidge-jun:devfrom
luvs01:codex/upstream-linear-devin-tool-results-20261006
Oct 6, 2026
Merged

lidge-jun merged 2 commits into
lidge-jun:devfrom
luvs01:codex/upstream-linear-devin-tool-results-20261006

Conversation

@luvs01

@luvs01 luvs01 commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Consecutive structured tool results with the same call ID repeatedly copy the accumulated content prefix. Append to mapper-owned arrays instead, and join text-only chunks once at the run boundary or first structured transition.

Preserve arrival order, empty-string separators, image parts, each chunk's error marker and the combined error flag. A different call ID or any original non-tool message, including one omitted by mapping, still ends the run. Later results keep their chronological slots and caller input remains unchanged.

Reuse the initially mapped signed history for the first send. Signature-withheld retries retain their separately mapped history. Add focused regressions to the existing wire suite and update both owning adapter contracts. This removes repeated prefix copying; it does not establish a global memory or elapsed-time bound.

Verification

Base: f92482065217bae891a88e27fd6c00012f212042.
Prepared candidate tree: 8f6d3f1e2ea4b0d06df70213556df311265572a4.
Published head: ebe82251f771637101ce396eb99f2de1f176caf5.

Current-head hosted result — checked 2026-10-06

Cross-platform CI 37412465563 and React Doctor 37412465343 completed successfully for this head. The Cross-platform run has 16 successful jobs and 9 skipped jobs. All four Linux test shards, the gates job (including Typecheck, GUI tests and Privacy scan), structure gate, storage/API checks, Docker smoke, npm-global Ubuntu/Windows and keyring Ubuntu/Windows succeeded. Full Windows/macOS test shards, docs-site build, remote-helper/setup-action matrices, standalone privacy gate, macOS control/widget and desktop shell were skipped; skips are not executed coverage. The successful Privacy scan step is distinct from the skipped standalone privacy-gate job.

Candidate-head hosted CI is no longer pending. A bounded CodeRabbit review was requested in the author follow-up. Review completion and required independent review remain outstanding; this update does not assert approval or a new local test run.

Offline and reused evidence

Fresh offline checks on this candidate:

  • Execute the production mapper and unchanged upstream mapper under Node 24.19.0 with TypeScript transformed: 13 boundary cases and 5,000 deterministic frozen-input comparisons pass.
  • Execute the two parser-independent regression callbacks from the submitted test file unchanged: both pass.
  • A fixture with 1,025 initial structured parts and 128 same-ID empty follow-ups counts values yielded by wire-array iterators whose first part is the sentinel mapped image. The control uses the production tool-output content converter. The original mapper yields 147,456 accumulated-part entries; the candidate yields 0 against an allowance of 3,843. The original fails that allowance. Zero means the candidate does not iterate those matched accumulated prefixes; it does not mean zero append, conversion or allocation work. This measurement does not establish a bound for the complete parser, mapper, encoder, memory use or runtime.
  • Exercise the production adapter with synthetic catalog, trajectory and cloud-stream dependencies. Plain turns map once instead of twice; signed turns and signature-refusal retries map twice instead of three times. Frozen first-send and retry histories remain unchanged, the retry drops the signature while retaining reasoning, and structured arrays are separately owned.
  • Run scripts/structure-ssot.ts, scripts/privacy-scan.ts and scripts/file-size-ratchet.ts with Node type stripping and an adapter for their read-only Bun.spawnSync calls: all pass.
  • git diff --check <base-tree> <candidate-tree>: passes.

Reused validation on the source tree, with the same patch on an older base, reported 228 passing focused Bun tests across 11 files, plus TypeScript, privacy and structure checks. Inspected hosted CI associated with that source head has successful Linux test shards, typecheck, privacy and structure jobs. These remain reused source results, separate from the current-head hosted results above.

Bun and project dependencies are unavailable locally. The full Responses parser/schema integration regression, real Connect transport, complete Bun/import-connected suite and root TypeScript check were not rerun locally. No downloads, live provider calls, installed configuration or services were used for those offline checks. Current-head hosted execution is recorded separately above; it is not a real-provider or installed-native validation claim. Keep this PR in draft pending review and an accurate review-readiness attestation.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Review readiness checklist

  • Required local validation passed with its scope documented.
  • Branch is on the latest dev commit.
  • All correct Codex and CodeRabbit findings are resolved.
  • Ready for review.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of consecutive Devin tool results, preserving structured content, empty chunks, error markers, and intervening message slots.
    • Reused mapped message history for signed requests while keeping retry behavior intact.
  • Documentation
    • Clarified how consecutive tool results are combined and what the accumulation guarantees cover.
  • Tests
    • Added coverage for structured chunks, text transitions, error markers, and frozen input data.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: edf294f0-ea12-410c-8a80-609ee65774ed
📥 Commits

Reviewing files that changed from the base of the PR and between ebe8225 and 7915827.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: cc5dfb23-b4af-4831-a165-25e8e5d9d470
📥 Commits

Reviewing files that changed from the base of the PR and between f924820 and ebe8225.

📒 Files selected for processing (4)
  • src/adapters/devin.ts
  • structure/adapters/registry.md
  • structure/providers-and-adapters.md
  • tests/providers/devin-chat-wire-fixes.test.ts

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


📝 Walkthrough

Walkthrough

The Devin adapter now buffers adjacent string tool results for the same call ID and combines them at message boundaries or before structured content. Signed requests reuse mapped messages. Tests and documentation cover accumulation, content preservation, and ownership.

Changes

Devin tool-result mapping and signed history

Layer / File(s) Summary
Tool-result mapping and signed history
src/adapters/devin.ts, tests/providers/devin-chat-wire-fixes.test.ts, structure/adapters/registry.md, structure/providers-and-adapters.md
The mapper buffers adjacent string results for the same call ID and flushes them when adjacency ends or structured content is added. Tests cover large structured outputs, text-to-image transitions, empty chunks, error markers, separate call IDs, and independently owned results from frozen inputs. runTurn reuses mapped messages for signed requests; the documentation also describes separate history construction for signature-withheld retries.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: lidge-jun

Merge Risk: ⚪ Minimal · up to ebe82

The change reduces repeated copying when consecutive tool results are combined, and nothing in the supplied context points to a behavior regression. Hosted CI passed. The full Bun suite was not run locally, which is normal residual uncertainty and not a concrete risk.

🚥 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 2 files. (2 skipped: 2 … 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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: avoiding repeated prefix copies when accumulating consecutive Devin tool results.
Full details: Docstring Coverage

Explanation

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 2 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 6, 2026

luvs01 commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Please perform one review of published head ebe82251f771637101ce396eb99f2de1f176caf5; automatic review was skipped while Draft.

Current-head CI update (2026-10-06): Cross-platform CI 37412465563 and React Doctor 37412465343 have completed successfully. The description's statement that candidate-head hosted CI is still pending is therefore superseded. This does not turn the documented local Node checks into Bun execution, establish native platform coverage, or replace independent review.

Please check run-boundary semantics, mapper-owned arrays/caller immutability, signed first-send versus signature-withheld retry ownership, and the regression tests' actual traversal claim. Draft is retained pending review and an accurate readiness attestation; no merge or additional feature scope is requested.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lidge-jun
lidge-jun marked this pull request as ready for review October 6, 2026 12:27
@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration into dev (MAINTAINERS.md dev-only maintainer integration; not a self-approval or an independent review).

  • Exact head: 7915827bd510071d2fb097d5bfb7ed7ffa858bec
  • Hosted CI on that head: all latest check runs completed and every applicable one succeeded. Skipped jobs are gated off by their own path/event conditions.
  • dev moved since this head's CI; none of the intervening commits touches a file this PR changes, and the merge tree is clean with scripts/test-layout/layout.json at 1999 lines.
  • Review: independent gpt-6.1-sol review in the compat sweep lane (PASS); no unresolved review threads, no maintainer change requests.
  • Scope: Devin adapter accumulates consecutive tool results without prefix copies; no gui/ paths.
  • Full local suite not run (parallel lanes share one machine); focused tests and typecheck ran in the lane, remaining coverage is the hosted matrix above.

@lidge-jun
lidge-jun merged commit 3eff7d9 into lidge-jun:dev Oct 6, 2026
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants