refactor: v2 - ai assistant - split tools bridges#2333
Open
maxy-shpfy wants to merge 1 commit into
Open
Conversation
This was referenced May 28, 2026
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
8 tasks
🎩 PreviewA preview build has been created at: |
7cec3fc to
7dc9561
Compare
7555123 to
3cdccfe
Compare
3cdccfe to
e44dba3
Compare
7dc9561 to
7688762
Compare
This was referenced May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
The monolithic
toolBridge.tsfile has been split into focused, single-responsibility modules under a newtoolBridge/directory. The three handler slices are:csomBridge.ts— spec-mutation handlers (add/delete/rename tasks, inputs, outputs, connections, subgraphs, validation)runBridge.ts— run lifecycle handlers (submitPipelineRun,getRunDetails,debugPipelineRun)debugBridge.ts— fine-grained read-only execution/container fetch handlersutils.ts— sharedBridgeDepsinterface,requireSpec,requireBackendUrl,errorMessage, andcomputeNextPositionindex.ts— composes the three slices into the fullToolBridgeApivia spreadTruncation logic (log text, container state, execution details) that was duplicated between
debugTools.tsandtoolBridge.tshas been extracted into a single shared module atsrc/agent/util/truncate.ts. Both the worker-side per-tool path and the main-thread compositedebugPipelineRunpath now import from this one location, ensuring identical truncation caps regardless of which entry point the model uses.The
deepClonecall on the serialized spec before pipeline submission has been removed sinceserializeComponentSpecalready produces a plain object.Related Issue and Pull requests
Type of Change
Checklist
Screenshots (if applicable)
Test Instructions
debugPipelineRunon a run with failed children and confirm truncated logs and container state are returned correctly.getContainerLog,getExecutionDetails, andgetContainerStatedirectly through the debug assistant and verify raw payloads are returned without truncation at the bridge layer.debugTools.ts(worker side) andrunBridge.ts(main thread) produces identical output for the same input by comparing results from both paths.Additional Comments
The
BridgeDepstype is re-exported fromtoolBridge/index.tsso call sites that previously imported fromtoolBridge.tsrequire only a path update with no interface changes.