Skip to content

Add: Timings informations for tool calls. - #32768

Merged
Fraggle merged 2 commits into
mainfrom
sflory/add-timings-informations-for
Sep 21, 2026
Merged

Fraggle merged 2 commits into
mainfrom
sflory/add-timings-informations-for

Conversation

@Fraggle

@Fraggle Fraggle commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Description

I instrumented sandbox function invocations with end-to-end phase timings, including front-side sandbox setup, authorization, token minting, process execution, archive materialization, runner phases, and nested Dust tool calls. tools.call now records POST, poll, and offload durations through the @dust/pod to functions-runner bridge, and Frame guidance replaces in-function dsbx tools shelling with the typed client.

Tests

Added Rust coverage for timing envelope serialization and runner-side timing merging. Updated Frame and sandbox instruction tests to enforce tools.call usage and the Computer-vs-Frame boundary.

Risk

Low-to-medium risk. The timing fields are optional and diagnostics-only, with compatibility fallbacks for older dsbx binaries and consumers. The main risk is timing-context propagation across async tool calls; rollback is safe by reverting the dust-sandbox and front changes together.

Deploy Plan

Deploy dust-sandbox first, then front so the new timing envelope is available to the logging and parsing path. No SQL migrations or infrastructure changes.

@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
playground Ignored Ignored Preview Sep 21, 2026 12:54pm UTC
storybook Ignored Ignored Preview Sep 21, 2026 12:54pm UTC

Request Review

return toolTimingsStorage().getStore() ?? syncStack().at(-1);
}

function isThenable(value: unknown): value is Promise<unknown> {

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.

What does isThenable mean? Logic unclear too. What does this do?

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.

Will clarify

Comment thread cli/dust-sandbox/pod/tool_timings.ts Outdated
/** Sync stack key; must match functions-runner/tool_timings.ts. */
export const TOOL_TIMINGS_STACK_KEY = "dust.pod.tool-timings.stack.v1";

function isToolTimingsAls(

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.

Spell out AsyncLocalStorage? Couldn't guess what "Als" meant at first.

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.

Yep

Comment thread cli/dust-sandbox/pod/tool_timings.ts Outdated
return toolTimingsStorage().getStore() ?? syncStack().at(-1);
}

function isThenable(value: unknown): value is Promise<unknown> {

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.

Seems like a lot of duplicated code between functions-runner/tool_timings.ts and this file.

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.

Looking.

@Fraggle
Fraggle force-pushed the sflory/add-timings-informations-for branch from 363e0ff to dad575e Compare September 21, 2026 08:40
Base automatically changed from sflory/lazy-load-invocation-blob to main September 21, 2026 12:53
Fraggle and others added 2 commits September 21, 2026 12:53
Spell out AsyncLocalStorage helpers, document why the runner/pod copies
cannot share a module import, and explain thenable handling for stack cleanup.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Fraggle
Fraggle force-pushed the sflory/add-timings-informations-for branch from dad575e to f1af963 Compare September 21, 2026 12:53
@Fraggle

Fraggle commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

@davidebbo PMMR (only timings, comments adressed)

@Fraggle
Fraggle merged commit 030c601 into main Sep 21, 2026
50 checks passed
@Fraggle
Fraggle deleted the sflory/add-timings-informations-for branch September 21, 2026 12:54
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