-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(mothership): tool call loop #3729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
b7e377e
v0.5.91: docs i18n, turborepo upgrade
waleedlatif1 da46a38
v0.5.92: shortlinks, copilot scrolling stickiness, pagination
waleedlatif1 fdca736
v0.5.93: NextJS config changes, MCP and Blocks whitelisting, copilot …
waleedlatif1 15ace5e
v0.5.94: vercel integration, folder insertion, migrated tracking redi…
waleedlatif1 67aa4bb
v0.5.95: gemini 3.1 pro, cloudflare, dataverse, revenuecat, redis, up…
waleedlatif1 34d92fa
v0.5.96: sim oauth provider, slack ephemeral message tool and blockki…
waleedlatif1 115f04e
v0.5.97: oidc discovery for copilot mcp
waleedlatif1 0d86ea0
v0.5.98: change detection improvements, rate limit and code execution…
waleedlatif1 af59234
v0.5.99: local dev improvements, live workflow logs in terminal
waleedlatif1 67f8a68
v0.5.100: multiple credentials, 40% speedup, gong, attio, audit log i…
waleedlatif1 4fd0989
v0.5.101: circular dependency mitigation, confluence enhancements, go…
waleedlatif1 0d2e6ff
v0.5.102: new integrations, new tools, ci speedups, memory leak instr…
waleedlatif1 e07e3c3
v0.5.103: memory util instrumentation, API docs, amplitude, google pa…
waleedlatif1 f1ec5fe
v0.5.104: memory improvements, nested subflows, careers page redirect…
waleedlatif1 70c36cb
v0.5.105: slack remove reaction, nested subflow locks fix, servicenow…
waleedlatif1 3ce9475
v0.5.106: condition block and legacy kbs fixes, GPT 5.4
icecrasher321 6586c5c
v0.5.107: new reddit, slack tools
waleedlatif1 8c0a2e0
v0.5.108: workflow input params in agent tools, bun upgrade, dropdown…
icecrasher321 ecd3536
v0.5.109: obsidian and evernote integrations, slack fixes, remove mem…
waleedlatif1 1c2c2c6
v0.5.110: webhook execution speedups, SSRF patches
waleedlatif1 36612ae
v0.5.111: non-polling webhook execs off trigger.dev, gmail subject he…
icecrasher321 e9bdc57
v0.5.112: trace spans improvements, fathom integration, jira fixes, c…
waleedlatif1 4c12914
v0.5.113: jira, ashby, google ads, grain updates
icecrasher321 84d6fdc
v0.6: mothership, tables, connectors
waleedlatif1 4f3bc37
v0.6.1: added better auth admin plugin
waleedlatif1 4bd0731
v0.6.2: mothership stability, chat iframe embedding, KB upserts, new …
waleedlatif1 30f2d1a
v0.6.3: hubspot integration, kb block improvements
waleedlatif1 ff7b5b5
v0.6.4: subflows, docusign, ashby new tools, box, workday, billing bu…
waleedlatif1 9fcd02f
v0.6.5: email validation, integrations page, mothership and custom to…
waleedlatif1 1731a4d
v0.6.6: landing improvements, styling consistency, mothership table r…
waleedlatif1 19442f1
v0.6.7: kb improvements, edge z index fix, captcha, new trust center,…
waleedlatif1 704d06f
v0
Sg312 8abb884
Fix ppt load
Sg312 b28556f
Fixes
Sg312 dde64aa
Fixes
Sg312 4a537ff
Fix lint
Sg312 aa9fc10
Fix wid
Sg312 5954abd
Download image
Sg312 77a4f2f
Update tools
Sg312 d071248
Fix lint
Sg312 844c9a2
Fix error msg
Sg312 46e8964
Tool fixes
Sg312 6549a50
Reenable subagent stream
Sg312 98f4dfd
Subagent stream
Sg312 1e7a987
Fix edit workflow hydration
Sg312 0b3000a
Throw func execute error on error
Sg312 e2d5d27
Rewrite
Sg312 8934206
Remove promptForToolApproval flag, fix workflow terminal logs
24fbf41
Fixes
Sg312 a573ec8
Rebase
Sg312 7d59763
Fix buffer
Sg312 035c614
Fix
Sg312 7dce59e
Fix claimed by
Sg312 f77c8b4
Cleanup v1
Sg312 1c0697a
Tool call loop
Sg312 df7e635
Fixes
Sg312 39ff907
Fixes
Sg312 7f83a0c
Fix subaget aborts
Sg312 772929c
Fix diff
Sg312 5b7a155
Add delegating state to subagents
a943010
Fix build
Sg312 63011d9
Fix sandbox
Sg312 405f57c
Fix lint
Sg312 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /** | ||
| * @vitest-environment node | ||
| */ | ||
|
|
||
| import { NextRequest } from 'next/server' | ||
| import { beforeEach, describe, expect, it, vi } from 'vitest' | ||
|
|
||
| const { getStreamMeta, readStreamEvents, authenticateCopilotRequestSessionOnly } = vi.hoisted( | ||
| () => ({ | ||
| getStreamMeta: vi.fn(), | ||
| readStreamEvents: vi.fn(), | ||
| authenticateCopilotRequestSessionOnly: vi.fn(), | ||
| }) | ||
| ) | ||
|
|
||
| vi.mock('@/lib/copilot/orchestrator/stream/buffer', () => ({ | ||
| getStreamMeta, | ||
| readStreamEvents, | ||
| })) | ||
|
|
||
| vi.mock('@/lib/copilot/request-helpers', () => ({ | ||
| authenticateCopilotRequestSessionOnly, | ||
| })) | ||
|
|
||
| import { GET } from '@/app/api/copilot/chat/stream/route' | ||
|
|
||
| describe('copilot chat stream replay route', () => { | ||
| beforeEach(() => { | ||
| vi.clearAllMocks() | ||
| authenticateCopilotRequestSessionOnly.mockResolvedValue({ | ||
| userId: 'user-1', | ||
| isAuthenticated: true, | ||
| }) | ||
| readStreamEvents.mockResolvedValue([]) | ||
| }) | ||
|
|
||
| it('stops replay polling when stream meta becomes cancelled', async () => { | ||
| getStreamMeta | ||
| .mockResolvedValueOnce({ | ||
| status: 'active', | ||
| userId: 'user-1', | ||
| }) | ||
| .mockResolvedValueOnce({ | ||
| status: 'cancelled', | ||
| userId: 'user-1', | ||
| }) | ||
|
|
||
| const response = await GET( | ||
| new NextRequest('http://localhost:3000/api/copilot/chat/stream?streamId=stream-1') | ||
| ) | ||
|
|
||
| const reader = response.body?.getReader() | ||
| expect(reader).toBeTruthy() | ||
|
|
||
| const first = await reader!.read() | ||
| expect(first.done).toBe(true) | ||
| expect(getStreamMeta).toHaveBeenCalledTimes(2) | ||
| }) | ||
| }) |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.