Skip to content

Add scoped filler support to RunContext#1818

Merged
toubatbrian merged 5 commits into
1.5.0from
brian/jsification-ctx-filler
Jun 18, 2026
Merged

Add scoped filler support to RunContext#1818
toubatbrian merged 5 commits into
1.5.0from
brian/jsification-ctx-filler

Conversation

@toubatbrian

@toubatbrian toubatbrian commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds scoped ctx.filler(...) support for long-running tools using the Python filler behavior as reference.
  • Waits for session idle before playing filler speech and resets the dwell timer on updates or speech activity.
  • Adds focused RunContext tests covering scope lifecycle, idle gating, cancellation, and interruption behavior.

Test plan

  • pnpm test agents/src/voice/run_context.test.ts
  • Pinned ESLint check on edited files
  • pnpm build:agents

Notes

  • Full package lint is blocked in the nested worktree by ESLint plugin ambiguity.
  • api:check is blocked by the existing API Extractor export * as limitation.
  • agents-cli smoke was not run because there is no deterministic dispatchable filler probe in the repo yet.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d610388

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +366 to +368
const handle = this.createSpeech();
if (handle) {
this.createdSpeeches.push(handle);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

devin-ai-integration[bot]

This comment was marked as resolved.

toubatbrian and others added 3 commits June 17, 2026 15:35
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 0 new potential issues.

Open in Devin Review

Comment thread agents/src/voice/run_context.ts Outdated
Comment on lines +408 to +412
const abortPromise = new Promise<false>((resolve) => {
signal.addEventListener('abort', () => resolve(false), { once: true });
});
const result = await Promise.race([promise.then(() => true), abortPromise]);
return result;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the abort listener is not removed when waitForIdle() wins the race?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@longcw longcw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@toubatbrian toubatbrian merged commit 8a91a0b into 1.5.0 Jun 18, 2026
1 of 2 checks passed
@toubatbrian toubatbrian deleted the brian/jsification-ctx-filler branch June 18, 2026 21:18

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 0 new potential issues.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants