fix(mothership): fix tool call scheduling#3635
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThis PR fixes tool call scheduling in the mothership copilot orchestrator by routing Key changes:
Issue found:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[tool_call event received] --> B{internal?}
B -- yes --> Z[return early]
B -- no --> C{isToolAvailableOnSimSide?}
C -- no --> Z2[return early\n⚠️ clientExecutable tools also exit here]
C -- yes --> D[define fireToolExecution]
D --> E{options.interactive === false?}
E -- yes --> F{autoExecuteTools !== false?}
F -- yes --> G[fireToolExecution]
F -- no --> Z3[return]
E -- no --> H{requiresConfirmation AND promptForToolApproval?}
H -- yes --> I[waitForToolDecision]
I --> J{decision status?}
J -- accepted/success --> K{clientExecutable?}
K -- yes --> L[waitForToolCompletion\nclient-side path]
K -- no --> G
J -- rejected/error --> M[mark rejected, return]
J -- background --> N[mark skipped, return]
J -- timeout --> O[mark timeout, return]
H -- no --> P{clientExecutable?}
P -- yes --> Q{isToolAvailableOnSimSide?\nalways true here ⚠️}
Q -- yes --> G
Q -- no --> R[client-wait path\nDEAD CODE - unreachable]
P -- no --> S{autoExecuteTools !== false?}
S -- yes --> G
S -- no --> Z4[return]
style R fill:#ff6b6b,color:#fff
style Z2 fill:#ffd93d,color:#000
Last reviewed commit: 23e9668 |
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.
Summary
Fix mothership tool call scheduling
Type of Change
Testing
Manual
Checklist