Skip to content

Commit b07c820

Browse files
Merge branch 'main' into bugfix/WT-engineer_495551283_full
2 parents 115f7ba + be7ba2c commit b07c820

5 files changed

Lines changed: 29 additions & 12 deletions

File tree

.github/actions/publish-release/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ runs:
167167
shell: 'bash'
168168
run: |
169169
npm publish \
170+
--ignore-scripts \
170171
--dry-run="${INPUTS_DRY_RUN}" \
171172
--workspace="${INPUTS_CORE_PACKAGE_NAME}" \
172173
--tag staging-tmp
@@ -215,6 +216,7 @@ runs:
215216
shell: 'bash'
216217
run: |
217218
npm publish \
219+
--ignore-scripts \
218220
--dry-run="${INPUTS_DRY_RUN}" \
219221
--workspace="${INPUTS_CLI_PACKAGE_NAME}" \
220222
--tag staging-tmp
@@ -242,6 +244,7 @@ runs:
242244
# Tag staging for initial release
243245
run: |
244246
npm publish \
247+
--ignore-scripts \
245248
--dry-run="${INPUTS_DRY_RUN}" \
246249
--workspace="${INPUTS_A2A_PACKAGE_NAME}" \
247250
--tag staging-tmp
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
{"method":"generateContent","response":{"candidates":[{"content":{"parts":[{"text":"{\n \"reasoning\": \"Simple task.\",\n \"model_choice\": \"flash\"\n}"}]},"finishReason":"STOP","index":0}]}}
12
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"read_file","args":{"file_path":"file1.txt"}}},{"functionCall":{"name":"read_file","args":{"file_path":"file2.txt"}}},{"functionCall":{"name":"write_file","args":{"file_path":"output.txt","content":"wave2"}}},{"functionCall":{"name":"read_file","args":{"file_path":"file3.txt"}}},{"functionCall":{"name":"read_file","args":{"file_path":"file4.txt"}}}, {"text":"All waves completed successfully."}]},"finishReason":"STOP","index":0}]}]}
3+
{"method":"generateContent","response":{"candidates":[{"content":{"parts":[{"text":"All waves completed successfully."}]},"finishReason":"STOP","index":0}]}}

integration-tests/parallel-tools.test.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ describe('Parallel Tool Execution Integration', () => {
2323
it('should execute [read, read, write, read, read] in correct waves with user approval', async () => {
2424
rig.setup('parallel-wave-execution', {
2525
fakeResponsesPath: join(import.meta.dirname, 'parallel-tools.responses'),
26+
fakeResponsesNonStrict: true,
2627
settings: {
2728
tools: {
2829
core: ['read_file', 'write_file'],
@@ -40,19 +41,24 @@ describe('Parallel Tool Execution Integration', () => {
4041

4142
const run = await rig.runInteractive({ approvalMode: 'default' });
4243

43-
// 1. Trigger the wave
44-
await run.type('ok');
45-
await run.type('\r');
44+
try {
45+
// 1. Trigger the wave
46+
await run.type('ok');
47+
await run.type('\r');
4648

47-
// 3. Wait for the write_file prompt.
48-
await run.expectText('Allow', 5000);
49+
// 3. Wait for the write_file prompt.
50+
await run.expectText('Allow', 10000);
4951

50-
// 4. Press Enter to approve the write_file.
51-
await run.type('y');
52-
await run.type('\r');
52+
// 4. Press Enter to approve the write_file.
53+
await run.type('y');
54+
await run.type('\r');
5355

54-
// 5. Wait for the final model response
55-
await run.expectText('All waves completed successfully.', 5000);
56+
// 5. Wait for the final model response
57+
await run.expectText('All waves completed successfully.', 10000);
58+
} catch (err) {
59+
fs.writeFileSync('pty_output_failure.txt', run.output);
60+
throw err;
61+
}
5662

5763
// Verify all tool calls were made and succeeded in the logs
5864
await rig.expectToolCallSuccess(['write_file']);
@@ -73,5 +79,5 @@ describe('Parallel Tool Execution Integration', () => {
7379
expect(fs.readFileSync(join(rig.testDir!, 'output.txt'), 'utf8')).toBe(
7480
'wave2',
7581
);
76-
});
82+
}, 30000);
7783
});

packages/core/src/scheduler/scheduler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ export class Scheduler {
540540

541541
if (isWaitingForExternal && this.state.isActive) {
542542
// Yield to the event loop to allow external events (tool completion, user input) to progress.
543-
await new Promise((resolve) => queueMicrotask(() => resolve(true)));
543+
await new Promise((resolve) => setTimeout(resolve, 10));
544544
return true;
545545
}
546546

packages/test-utils/src/test-rig.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ export class TestRig {
365365
_lastRunStderr?: string;
366366
// Path to the copied fake responses file for this test.
367367
fakeResponsesPath?: string;
368+
// Whether to run fake responses in non-strict mode.
369+
fakeResponsesNonStrict?: boolean;
368370
// Original fake responses file path for rewriting goldens in record mode.
369371
originalFakeResponsesPath?: string;
370372
private _interactiveRuns: InteractiveRun[] = [];
@@ -377,6 +379,7 @@ export class TestRig {
377379
settings?: Record<string, unknown>;
378380
state?: Record<string, unknown>;
379381
fakeResponsesPath?: string;
382+
fakeResponsesNonStrict?: boolean;
380383
} = {},
381384
) {
382385
this.testName = testName;
@@ -398,6 +401,7 @@ export class TestRig {
398401
if (options.fakeResponsesPath) {
399402
this.fakeResponsesPath = join(this.testDir, 'fake-responses.json');
400403
this.originalFakeResponsesPath = options.fakeResponsesPath;
404+
this.fakeResponsesNonStrict = options.fakeResponsesNonStrict;
401405
if (process.env['REGENERATE_MODEL_GOLDENS'] !== 'true') {
402406
fs.copyFileSync(options.fakeResponsesPath, this.fakeResponsesPath);
403407
}
@@ -558,6 +562,8 @@ export class TestRig {
558562
if (this.fakeResponsesPath) {
559563
if (process.env['REGENERATE_MODEL_GOLDENS'] === 'true') {
560564
initialArgs.push('--record-responses', this.fakeResponsesPath);
565+
} else if (this.fakeResponsesNonStrict) {
566+
initialArgs.push('--fake-responses-non-strict', this.fakeResponsesPath);
561567
} else {
562568
initialArgs.push('--fake-responses', this.fakeResponsesPath);
563569
}

0 commit comments

Comments
 (0)