|
|
@@ -5,7 +5,7 @@ import { describe, expect, it, vi } from 'vitest'
|
|
|
import { Context } from '@deepseek-ai/cordis'
|
|
|
import Loader from '@deepseek-ai/cordis-plugin-loader'
|
|
|
import * as workspaceContext from '@deepseek-ai/dsh-agent-instructions'
|
|
|
-import LlmRuntime, { createUserMessage, CallId, type Message, type StreamChunk } from '@deepseek-ai/dsh-llm'
|
|
|
+import LlmRuntime, { createUserMessage, ToolCallId, type Message, type StreamChunk } from '@deepseek-ai/dsh-llm'
|
|
|
import SessionStore, { Session, SessionId, SESSION_FORMAT_VERSION, type SessionEvent, type UserMessage } from '@deepseek-ai/dsh-session'
|
|
|
import AgentRegistry, { agentEvents, Inbox, type Agent } from '@deepseek-ai/dsh-agent'
|
|
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
|
|
@@ -1657,7 +1657,7 @@ describe('workspace context request injection', () => {
|
|
|
await write(join(root, 'AGENTS.md'), 'updated repo rule')
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-remount'),
|
|
|
+ callId: ToolCallId('read-after-remount'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: 'file.txt' },
|
|
|
agent,
|
|
|
@@ -1854,7 +1854,7 @@ describe('workspace context request injection', () => {
|
|
|
await write(join(root, 'AGENTS.md'), 'new root rule with more detail')
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-baseline-change'), name: 'read', arguments: { file_path: 'file.txt' }, agent,
|
|
|
+ callId: ToolCallId('read-after-baseline-change'), name: 'read', arguments: { file_path: 'file.txt' }, agent,
|
|
|
})
|
|
|
|
|
|
expect(((await syncedWorkspaceContext(ctx, agent))).source).toMatchObject({
|
|
|
@@ -1883,7 +1883,7 @@ describe('workspace context request injection', () => {
|
|
|
await rm(join(root, 'AGENTS.md'))
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-baseline-remove'), name: 'read', arguments: { file_path: 'file.txt' }, agent,
|
|
|
+ callId: ToolCallId('read-after-baseline-remove'), name: 'read', arguments: { file_path: 'file.txt' }, agent,
|
|
|
})
|
|
|
|
|
|
expect(((await syncedWorkspaceContext(ctx, agent))).source).toMatchObject({
|
|
|
@@ -2499,9 +2499,9 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
const adapter = new MockAdapter([
|
|
|
[
|
|
|
{ type: 'block-start', index: 0, blockType: 'tool-call' },
|
|
|
- { type: 'block-end', index: 0, block: { type: 'tool-call', id: CallId('read-before-abort'), name: 'read', arguments: '{"file_path":"pkg/deep/file.txt"}' } },
|
|
|
+ { type: 'block-end', index: 0, block: { type: 'tool-call', id: ToolCallId('read-before-abort'), name: 'read', arguments: '{"file_path":"pkg/deep/file.txt"}' } },
|
|
|
{ type: 'block-start', index: 1, blockType: 'tool-call' },
|
|
|
- { type: 'block-end', index: 1, block: { type: 'tool-call', id: CallId('abort-after-read'), name: 'abort_step', arguments: '{}' } },
|
|
|
+ { type: 'block-end', index: 1, block: { type: 'tool-call', id: ToolCallId('abort-after-read'), name: 'abort_step', arguments: '{}' } },
|
|
|
{ type: 'finish', reason: { kind: 'tool-calls' } },
|
|
|
] satisfies StreamChunk[],
|
|
|
toolCallResponse('read-after-abort', 'read', { file_path: join('pkg', 'deep', 'file.txt') }),
|
|
|
@@ -2595,7 +2595,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
const reason = new Error('cancel dynamic reconciliation')
|
|
|
controller.abort(reason)
|
|
|
const exec = stubToolExecution({
|
|
|
- callId: CallId('cancelled-dynamic-read'),
|
|
|
+ callId: ToolCallId('cancelled-dynamic-read'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'file.txt') },
|
|
|
agent: stubAgent(root),
|
|
|
@@ -2632,7 +2632,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const result = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-nested'),
|
|
|
+ callId: ToolCallId('read-nested'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -2678,7 +2678,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
signal: controller.signal,
|
|
|
- callId: CallId('read-before-signal-end'),
|
|
|
+ callId: ToolCallId('read-before-signal-end'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -2711,7 +2711,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-configured-nested-candidate'),
|
|
|
+ callId: ToolCallId('read-configured-nested-candidate'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -2744,7 +2744,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-nested-overlay'),
|
|
|
+ callId: ToolCallId('read-nested-overlay'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -2787,7 +2787,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-nested-overlay-disabled'),
|
|
|
+ callId: ToolCallId('read-nested-overlay-disabled'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -2815,7 +2815,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const first = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-nested-1'),
|
|
|
+ callId: ToolCallId('read-nested-1'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -2823,7 +2823,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
await appendAdditionalContexts(ctx, agent)
|
|
|
const second = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-nested-2'),
|
|
|
+ callId: ToolCallId('read-nested-2'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -2858,12 +2858,12 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const first = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-version-fast-path'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-before-version-fast-path'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await appendAdditionalContexts(ctx, agent)
|
|
|
const second = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-with-version-fast-path'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-with-version-fast-path'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
expect(first.additionalContexts).toBeUndefined()
|
|
|
@@ -2895,18 +2895,18 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-same-digest-version-change'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-before-same-digest-version-change'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await appendAdditionalContexts(ctx, agent)
|
|
|
fs.entries.set(instructionPath, { type: 'file', content: 'same package rule', version: FsVersion('revision-2') })
|
|
|
const afterVersionChange = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-same-digest-version-change'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-after-same-digest-version-change'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await syncWorkspaceContext(ctx, agent)
|
|
|
const afterRefresh = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-version-cache-refresh'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-after-version-cache-refresh'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
expect(afterVersionChange.additionalContexts).toBeUndefined()
|
|
|
@@ -2941,11 +2941,11 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
const secondAgent = stubAgent(root)
|
|
|
const first = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-from-first-session'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent: firstAgent,
|
|
|
+ callId: ToolCallId('read-from-first-session'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent: firstAgent,
|
|
|
})
|
|
|
const second = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-from-second-session'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent: secondAgent,
|
|
|
+ callId: ToolCallId('read-from-second-session'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent: secondAgent,
|
|
|
})
|
|
|
|
|
|
expect(first.additionalContexts).toBeUndefined()
|
|
|
@@ -2973,13 +2973,13 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-change'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-before-change'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await appendAdditionalContexts(ctx, agent)
|
|
|
await write(join(root, 'pkg/AGENTS.md'), 'new package rule with more detail')
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-change'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-after-change'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
expect(((await syncedWorkspaceContext(ctx, agent))).source).toMatchObject({
|
|
|
@@ -3016,7 +3016,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-both-siblings'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-both-siblings'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
const firstText = blocksText(((await syncedWorkspaceContext(ctx, agent))).content)
|
|
|
expect(firstText).toContain('native package rule')
|
|
|
@@ -3025,7 +3025,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
await rm(join(root, 'pkg/AGENTS.md'))
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-one-sibling-removed'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-after-one-sibling-removed'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
// Removing one candidate only removes its own scope; the sibling scope is untouched.
|
|
|
@@ -3054,7 +3054,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-nested-dup-siblings'), name: 'read', arguments: { file_path: join('pkg', 'deep', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-nested-dup-siblings'), name: 'read', arguments: { file_path: join('pkg', 'deep', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
expect(((await syncedWorkspaceContext(ctx, agent))).source).toMatchObject({
|
|
|
@@ -3276,7 +3276,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-dup-convergence'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-before-dup-convergence'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
const firstText = blocksText(((await syncedWorkspaceContext(ctx, agent))).content)
|
|
|
expect(firstText).toContain('canonical nested rule')
|
|
|
@@ -3285,7 +3285,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
await write(join(root, 'pkg/CLAUDE.md'), 'canonical nested rule')
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-dup-convergence'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-after-dup-convergence'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
const convergence = await syncedWorkspaceContext(ctx, agent)
|
|
|
@@ -3313,14 +3313,14 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-earlier-converges'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-before-earlier-converges'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await appendAdditionalContexts(ctx, agent)
|
|
|
// Only the earlier candidate changes; the sibling stays byte-identical but now duplicates it.
|
|
|
await write(join(root, 'pkg/AGENTS.md'), 'secondary nested rule')
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-earlier-converges'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-after-earlier-converges'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
expect(((await syncedWorkspaceContext(ctx, agent))).source).toMatchObject({
|
|
|
@@ -3351,13 +3351,13 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-remove'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-before-remove'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await appendAdditionalContexts(ctx, agent)
|
|
|
await rm(join(root, 'pkg/AGENTS.md'))
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-remove'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-after-remove'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
expect(((await syncedWorkspaceContext(ctx, agent))).source).toMatchObject({
|
|
|
@@ -3391,7 +3391,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-symlink-dir'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-before-symlink-dir'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
const firstText = blocksText(((await syncedWorkspaceContext(ctx, agent))).content)
|
|
|
await appendAdditionalContexts(ctx, agent)
|
|
|
@@ -3405,7 +3405,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
await symlink(join(root, 'pkg/elsewhere'), join(root, 'pkg/AGENTS.md'))
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-symlink-dir'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-after-symlink-dir'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
expect(((await syncedWorkspaceContext(ctx, agent))).source).toMatchObject({
|
|
|
@@ -3431,20 +3431,20 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-tombstone'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-before-tombstone'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await appendAdditionalContexts(ctx, agent)
|
|
|
await rm(join(root, 'pkg/AGENTS.md'))
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-to-create-tombstone'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-to-create-tombstone'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await appendAdditionalContexts(ctx, agent)
|
|
|
await write(join(root, 'pkg/AGENTS.md'), 'restored package rule')
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-tombstone'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-after-tombstone'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
expect(((await syncedWorkspaceContext(ctx, agent))).source).toMatchObject({
|
|
|
@@ -3476,13 +3476,13 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const first = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-provider-failure'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-before-provider-failure'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await appendAdditionalContexts(ctx, agent)
|
|
|
fs.throwOnStat.add(join(root, 'pkg/AGENTS.md'))
|
|
|
const duringFailure = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-during-provider-failure'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-during-provider-failure'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
expect(first.additionalContexts).toBeUndefined()
|
|
|
@@ -3506,7 +3506,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
const agent = stubAgent(root)
|
|
|
const first = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-resume'),
|
|
|
+ callId: ToolCallId('read-before-resume'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -3516,7 +3516,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const afterResume = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-resume'),
|
|
|
+ callId: ToolCallId('read-after-resume'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent: resumed,
|
|
|
@@ -3542,7 +3542,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
const original = stubAgent(root)
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-offline-change'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent: original,
|
|
|
+ callId: ToolCallId('read-before-offline-change'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent: original,
|
|
|
})
|
|
|
await appendAdditionalContexts(ctx, original)
|
|
|
await write(join(root, 'pkg/AGENTS.md'), 'new nested rule after resume')
|
|
|
@@ -3573,7 +3573,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
const agent = stubAgent(root)
|
|
|
const first = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-before-compact'),
|
|
|
+ callId: ToolCallId('read-before-compact'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -3581,7 +3581,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
const contextSeq = (await appendAdditionalContexts(ctx, agent))!
|
|
|
const visibleBeforeCompact = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-while-visible'),
|
|
|
+ callId: ToolCallId('read-while-visible'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -3597,7 +3597,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const afterCompact = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-compact'),
|
|
|
+ callId: ToolCallId('read-after-compact'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -3629,7 +3629,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const whileVisible = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-visible-baseline'),
|
|
|
+ callId: ToolCallId('read-visible-baseline'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: 'file.txt' },
|
|
|
agent,
|
|
|
@@ -3644,7 +3644,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-compacted-baseline'),
|
|
|
+ callId: ToolCallId('read-compacted-baseline'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: 'file.txt' },
|
|
|
agent,
|
|
|
@@ -3653,7 +3653,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
await appendAdditionalContexts(ctx, agent)
|
|
|
const afterRearm = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-rearmed-baseline'),
|
|
|
+ callId: ToolCallId('read-rearmed-baseline'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: 'file.txt' },
|
|
|
agent,
|
|
|
@@ -3685,7 +3685,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
const agent = stubAgent(root)
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-package'),
|
|
|
+ callId: ToolCallId('read-package'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -3695,7 +3695,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-subtree'),
|
|
|
+ callId: ToolCallId('read-subtree'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'sub', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -3723,7 +3723,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
const agent = stubAgent(root)
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-subtree-omitting-parent'),
|
|
|
+ callId: ToolCallId('read-subtree-omitting-parent'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'sub', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -3733,7 +3733,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-parent-after-omit'),
|
|
|
+ callId: ToolCallId('read-parent-after-omit'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'other.txt') },
|
|
|
agent,
|
|
|
@@ -3785,7 +3785,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-spoofed-state'),
|
|
|
+ callId: ToolCallId('read-after-spoofed-state'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -3812,14 +3812,14 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const rootResult = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-root-file'),
|
|
|
+ callId: ToolCallId('read-root-file'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: 'root.txt' },
|
|
|
agent,
|
|
|
})
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-absolute-nested-file'),
|
|
|
+ callId: ToolCallId('read-absolute-nested-file'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join(root, 'pkg/deep/file.txt') },
|
|
|
agent,
|
|
|
@@ -3855,7 +3855,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const result = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-with-unreadable-nested-instruction'),
|
|
|
+ callId: ToolCallId('read-with-unreadable-nested-instruction'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -3900,7 +3900,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const result = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-with-downstream'),
|
|
|
+ callId: ToolCallId('read-with-downstream'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -3953,7 +3953,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const result = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-blocked-downstream'),
|
|
|
+ callId: ToolCallId('read-blocked-downstream'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -3996,7 +3996,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const blocked = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('outer-block-first'),
|
|
|
+ callId: ToolCallId('outer-block-first'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -4007,7 +4007,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
shouldBlock = false
|
|
|
const accepted = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('outer-block-retry'),
|
|
|
+ callId: ToolCallId('outer-block-retry'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -4043,7 +4043,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
async execute(_args, exec) {
|
|
|
const nested = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId(`${exec.callId}:nested`),
|
|
|
+ callId: ToolCallId(`${exec.callId}:nested`),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
...exec.agent === undefined ? {} : { agent: exec.agent },
|
|
|
@@ -4065,7 +4065,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const blocked = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('composite-first'), name: 'composite-read', arguments: {}, agent,
|
|
|
+ callId: ToolCallId('composite-first'), name: 'composite-read', arguments: {}, agent,
|
|
|
})
|
|
|
|
|
|
expect(blocked.isError).toBe(true)
|
|
|
@@ -4099,7 +4099,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
token: Symbol('nested-read') as ToolExecutionToken,
|
|
|
parent: outerToken,
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('nested-read'),
|
|
|
+ callId: ToolCallId('nested-read'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -4108,7 +4108,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
token: Symbol('nested-non-file') as ToolExecutionToken,
|
|
|
parent: outerToken,
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('nested-non-file'),
|
|
|
+ callId: ToolCallId('nested-non-file'),
|
|
|
name: 'search',
|
|
|
arguments: {},
|
|
|
agent,
|
|
|
@@ -4117,7 +4117,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
token: Symbol('second-nested-read') as ToolExecutionToken,
|
|
|
parent: outerToken,
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('second-nested-read'),
|
|
|
+ callId: ToolCallId('second-nested-read'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'second.txt') },
|
|
|
agent,
|
|
|
@@ -4125,7 +4125,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
token: outerToken,
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('outer-code-run'),
|
|
|
+ callId: ToolCallId('outer-code-run'),
|
|
|
name: 'run_code',
|
|
|
arguments: {},
|
|
|
agent,
|
|
|
@@ -4163,7 +4163,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-closed-step'),
|
|
|
+ callId: ToolCallId('read-after-closed-step'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -4185,38 +4185,38 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
await ctx.plugin(workspaceContext, { maxBytes: 65536 })
|
|
|
const fs = ctx.fs as RecordingFileSystem
|
|
|
const agent = stubAgent('/')
|
|
|
- const plainResult = { callId: CallId('plain'), content: [], isError: false as const, value: null }
|
|
|
+ const plainResult = { callId: ToolCallId('plain'), content: [], isError: false as const, value: null }
|
|
|
const aborted = new AbortController()
|
|
|
aborted.abort(new Error('cancelled'))
|
|
|
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
- signal: testToolSignal, callId: CallId('agentless'), name: 'read', arguments: { file_path: 'file.txt' },
|
|
|
+ signal: testToolSignal, callId: ToolCallId('agentless'), name: 'read', arguments: { file_path: 'file.txt' },
|
|
|
}), plainResult)
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
- signal: testToolSignal, callId: CallId('failed'), name: 'read', arguments: { file_path: 'failed/file.txt' }, agent,
|
|
|
+ signal: testToolSignal, callId: ToolCallId('failed'), name: 'read', arguments: { file_path: 'failed/file.txt' }, agent,
|
|
|
}), { content: [], isError: true, error: { message: 'failed' } })
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
- signal: aborted.signal, callId: CallId('aborted'), name: 'read', arguments: { file_path: 'aborted/file.txt' }, agent,
|
|
|
+ signal: aborted.signal, callId: ToolCallId('aborted'), name: 'read', arguments: { file_path: 'aborted/file.txt' }, agent,
|
|
|
}), plainResult)
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('null-arguments'), name: 'read', arguments: null, agent,
|
|
|
+ callId: ToolCallId('null-arguments'), name: 'read', arguments: null, agent,
|
|
|
}), plainResult)
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('missing-path'), name: 'read', arguments: {}, agent,
|
|
|
+ callId: ToolCallId('missing-path'), name: 'read', arguments: {}, agent,
|
|
|
}), plainResult)
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('non-string-path'), name: 'read', arguments: { file_path: 1 }, agent,
|
|
|
+ callId: ToolCallId('non-string-path'), name: 'read', arguments: { file_path: 1 }, agent,
|
|
|
}), plainResult)
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('blank-path'), name: 'read', arguments: { file_path: ' ' }, agent,
|
|
|
+ callId: ToolCallId('blank-path'), name: 'read', arguments: { file_path: ' ' }, agent,
|
|
|
}), plainResult)
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('non-fs'), name: 'composite', arguments: {}, agent,
|
|
|
+ callId: ToolCallId('non-fs'), name: 'composite', arguments: {}, agent,
|
|
|
}), plainResult)
|
|
|
|
|
|
await Promise.resolve()
|
|
|
@@ -4243,7 +4243,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('projection-failure'),
|
|
|
+ callId: ToolCallId('projection-failure'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: 'file.txt' },
|
|
|
agent,
|
|
|
@@ -4269,7 +4269,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const result = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-with-disabled-budget'),
|
|
|
+ callId: ToolCallId('read-with-disabled-budget'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent: stubAgent(root),
|
|
|
@@ -4302,12 +4302,12 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const first = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-tiny-budget-1'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-tiny-budget-1'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await syncWorkspaceContext(ctx, agent)
|
|
|
const second = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-tiny-budget-2'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('read-tiny-budget-2'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await syncWorkspaceContext(ctx, agent)
|
|
|
|
|
|
@@ -4335,7 +4335,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const result = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-missing'),
|
|
|
+ callId: ToolCallId('read-missing'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'missing.txt') },
|
|
|
agent: stubAgent(root),
|
|
|
@@ -4363,7 +4363,7 @@ describe('dynamic nested workspace context injection', () => {
|
|
|
|
|
|
const result = await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('read-after-dispose'),
|
|
|
+ callId: ToolCallId('read-after-dispose'),
|
|
|
name: 'read',
|
|
|
arguments: { file_path: join('pkg', 'deep', 'file.txt') },
|
|
|
agent,
|
|
|
@@ -4423,7 +4423,7 @@ describe('workspace context inbox synchronization', () => {
|
|
|
const agent = stubAgent(root)
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('tiny-budget-touch'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('tiny-budget-touch'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
}), acceptedResult)
|
|
|
|
|
|
await syncWorkspaceContext(ctx, agent)
|
|
|
@@ -4451,7 +4451,7 @@ describe('workspace context inbox synchronization', () => {
|
|
|
const agent = stubAgent(root)
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('pending-v1'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('pending-v1'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await syncWorkspaceContext(ctx, agent)
|
|
|
expect(blocksText(agent.inbox.nextStep[0]?.content)).toContain('pending version one')
|
|
|
@@ -4464,7 +4464,7 @@ describe('workspace context inbox synchronization', () => {
|
|
|
await write(join(root, 'pkg/AGENTS.md'), 'pending version two with more detail')
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('pending-v2'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('pending-v2'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await syncWorkspaceContext(ctx, agent)
|
|
|
expect(agent.inbox.nextStep).toHaveLength(1)
|
|
|
@@ -4475,7 +4475,7 @@ describe('workspace context inbox synchronization', () => {
|
|
|
await rm(join(root, 'pkg/AGENTS.md'))
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('pending-delete'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('pending-delete'), name: 'read', arguments: { file_path: join('pkg', 'file.txt') }, agent,
|
|
|
})
|
|
|
await syncWorkspaceContext(ctx, agent)
|
|
|
expect(agent.inbox.nextStep).toEqual([])
|
|
|
@@ -4499,7 +4499,7 @@ describe('workspace context inbox synchronization', () => {
|
|
|
const agent = stubAgent(root)
|
|
|
const first = stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('projected-before-abort'), name: 'read', arguments: { file_path: join('a', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('projected-before-abort'), name: 'read', arguments: { file_path: join('a', 'file.txt') }, agent,
|
|
|
})
|
|
|
ctx.emit('tools/result', first, acceptedResult)
|
|
|
const controller = new AbortController()
|
|
|
@@ -4512,7 +4512,7 @@ describe('workspace context inbox synchronization', () => {
|
|
|
|
|
|
ctx.emit('tools/result', stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('projected-after-abort'), name: 'read', arguments: { file_path: join('b', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('projected-after-abort'), name: 'read', arguments: { file_path: join('b', 'file.txt') }, agent,
|
|
|
}), acceptedResult)
|
|
|
await syncWorkspaceContext(ctx, agent)
|
|
|
const text = blocksText(agent.inbox.nextStep[0]?.content)
|
|
|
@@ -4539,11 +4539,11 @@ describe('workspace context inbox synchronization', () => {
|
|
|
const agent = stubAgent(root)
|
|
|
const first = stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('concurrent-a'), name: 'read', arguments: { file_path: join('a', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('concurrent-a'), name: 'read', arguments: { file_path: join('a', 'file.txt') }, agent,
|
|
|
})
|
|
|
const second = stubToolExecution({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('concurrent-b'), name: 'read', arguments: { file_path: join('b', 'file.txt') }, agent,
|
|
|
+ callId: ToolCallId('concurrent-b'), name: 'read', arguments: { file_path: join('b', 'file.txt') }, agent,
|
|
|
})
|
|
|
|
|
|
ctx.emit('tools/result', first, acceptedResult)
|
|
|
@@ -4577,14 +4577,14 @@ describe('workspace context inbox synchronization', () => {
|
|
|
const original = stubAgent(root)
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('recover-pending-a'), name: 'read', arguments: { file_path: join('a', 'file.txt') }, agent: original,
|
|
|
+ callId: ToolCallId('recover-pending-a'), name: 'read', arguments: { file_path: join('a', 'file.txt') }, agent: original,
|
|
|
})
|
|
|
await syncWorkspaceContext(ctx, original)
|
|
|
const resumed = stubAgent(root, [...original.session.events])
|
|
|
|
|
|
await ctx.tools.execute({
|
|
|
signal: testToolSignal,
|
|
|
- callId: CallId('recover-pending-b'), name: 'read', arguments: { file_path: join('b', 'file.txt') }, agent: resumed,
|
|
|
+ callId: ToolCallId('recover-pending-b'), name: 'read', arguments: { file_path: join('b', 'file.txt') }, agent: resumed,
|
|
|
})
|
|
|
await syncWorkspaceContext(ctx, resumed)
|
|
|
|