Add scoped filler support to RunContext#1818
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: d610388 The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 379a17971c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const handle = this.createSpeech(); | ||
| if (handle) { | ||
| this.createdSpeeches.push(handle); |
There was a problem hiding this comment.
Skip filler creation after maxSteps is reached
When maxSteps is 0 (explicitly allowed by the constructor's non-negative validation), this loop still calls createSpeech() before checking the limit, so ctx.filler(..., { maxSteps: 0 }, ...) speaks once instead of disabling filler output. This also makes config-driven limits off by one at the zero boundary; check the cap before creating the next filler speech.
Useful? React with 👍 / 👎.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
| const abortPromise = new Promise<false>((resolve) => { | ||
| signal.addEventListener('abort', () => resolve(false), { once: true }); | ||
| }); | ||
| const result = await Promise.race([promise.then(() => true), abortPromise]); | ||
| return result; |
There was a problem hiding this comment.
the abort listener is not removed when waitForIdle() wins the race?
longcw
left a comment
There was a problem hiding this comment.
left a comment, otherwise looks good to me. maybe also add an use case in the example?
Remove the abort listener in waitUnlessAborted when waitForIdle wins the race, add edge-case filler tests, and demonstrate ctx.filler in the async tool example. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
ctx.filler(...)support for long-running tools using the Python filler behavior as reference.Test plan
pnpm test agents/src/voice/run_context.test.tspnpm build:agentsNotes
api:checkis blocked by the existing API Extractorexport * aslimitation.agents-clismoke was not run because there is no deterministic dispatchable filler probe in the repo yet.