Skip to content

fix(web,mobile): a 9.96-second workflow step reads 10s, not 10.0s - #42492

Merged
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
only21mil:fix/client-runtime-workflow-step-time-10s
Nov 25, 2026
Merged

juliusmarminge merged 3 commits into
pingdotgg:mainfrom
only21mil:fix/client-runtime-workflow-step-time-10s

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

workflowStepTime (packages/client-runtime/src/workflows.ts), used by the web run feed and mobile workflow timeline, documents "0.3s, 9.7s, 12s, then minutes" but chose tenths with ms < 10_000 before rounding, so 9,951–9,999 ms displayed 10.0s while 10,000 ms displayed 10s.

Change

End the tenths branch at ms < 9_950, the first value that rounds to 10.0 (1 line). 9,950 ms now reads 10s (half rounds up, like Math.round); it read 9.9s before only because 9.95 is stored just below 9.95. The existing keeps one shape down the column test case now also pins 9_949 → "9.9s", 9_950 → "10s", and 9_999 → "10s".

Scope

No issue: this is a 1-line fix for an obvious rounding bug in packages/client-runtime plus test rows.

Verification

  • Setup: web in T3's Browser panel at 1280x800 (2x, light theme) and Android 17 emulator (Pixel 10, dark), each on a fresh isolated T3 home with --no-seed per commit and only the synthetic timing workflow below.
  • Steps: start timing (a 9.7 s step, then a 9.96 s step) with t3 workflow start timing → open the finished run on each client. Server-recorded step times were 9.702 s / 9.961 s on 9ca304d and 9.701 s / 9.961 s on 1b2b8d7.
9ca304d 1b2b8d7
Web on 9ca304d: the 9.7 s step reads 9.7s, the 9.96 s step reads 10.0s
Web on 9ca304d: the 9.7 s step reads 9.7s, the 9.96 s step reads 10.0s
Web on 1b2b8d7: the 9.7 s step reads 9.7s, the 9.96 s step reads 10s
Web on 1b2b8d7: the 9.7 s step reads 9.7s, the 9.96 s step reads 10s
Android on 9ca304d: the 9.7 s step reads 9.7s, the 9.96 s step reads 10.0s
Android on 9ca304d: the 9.7 s step reads 9.7s, the 9.96 s step reads 10.0s
Android on 1b2b8d7: the 9.7 s step reads 9.7s, the 9.96 s step reads 10s
Android on 1b2b8d7: the 9.7 s step reads 9.7s, the 9.96 s step reads 10s
  • Links: regression test, 9ca304d, 1b2b8d7.
  • Not shown: iOS (same shared function and mobile component as Android; no iOS capture taken) and desktop (same web bundle).

An AI agent ran each check and capture. On 9ca304d, the head test fails at the 9_950 row (expected "10s", received "9.9s") and 9_999 formats as "10.0s"; the test also fails with ms < 9_951, and passes 3 of 3 runs on 1b2b8d7. vp run check:changed passes.

Failing base test output and synthetic timing workflow

Failing test on 9ca304d:

     × keeps one shape down the column 4ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯
AssertionError: expected '9.9s' to be '10s' // Object.is equality
Expected: "10s"
Received: "9.9s"
 ❯ src/workflows.test.ts:614:37
      Tests  1 failed | 21 skipped (22)

Synthetic workflow (workflows/timing.ts):

export default T3.workflow("timing", { version: 1, payload: Schema.Struct({}) },
  Effect.fn(function* () {
    yield* T3.step("under ten seconds", { returns: Schema.String }, Effect.as(Effect.sleep("9700 millis"), "done"));
    yield* T3.step("almost ten seconds", { returns: Schema.String }, Effect.as(Effect.sleep("9960 millis"), "done"));
  }));

Generated with Gemini 4 Neon in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

workflowStepTime now switches from one-decimal-second formatting at 9,950 ms. Tests verify the displayed values immediately below and at this boundary.

Changes: Workflow step time formatting

Layer / File(s) Summary
Adjust the rounding boundary
packages/client-runtime/src/workflows.ts, packages/client-runtime/src/workflows.test.ts
The one-decimal-second threshold changes from 10,000 ms to 9,950 ms. Tests check that 9,949 ms displays as 9.9s and 9,950 ms displays as 10s.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#42248: Changes rounding and unit selection in the same workflowStepTime formatting path and adds boundary tests.

Suggested reviewers: juliusmarminge, marve10s

Merge Risk: Minimal · up to 4b002

This fixes the display of workflow step times just under ten seconds so they read 10s instead of 10.0s. The change is small and tested, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the actual change: the workflow step time display boundary, where a 9.96-second step now reads 10s instead of 10.0s. It matches the code change (tenths branch ends at ms < 9_950) and t…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem and Change sections clearly explain the rounding bug and the 1-line fix. Scope links no issu…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the actual change: the workflow step time display boundary, where a 9.96-second step now reads 10s instead of 10.0s. It matches the code change (tenths branch ends at ms < 9_950) and the regression test. It is a conventional commit with a scope and states the bug in plain language.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem and Change sections clearly explain the rounding bug and the 1-line fix. Scope links no issue but explains why none is needed for an obvious bug. Verification gives focused tests, before/after screenshots for web and Android, commit links, and states what was not checked (iOS and desktop). It also includes the model and harness line that the template asks for.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1b2b8d7 and 4b00254.

Files selected for processing: 1

  • packages/client-runtime/src/workflows.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
juliusmarminge and others added 2 commits November 24, 2026 23:47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tepTime

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Ran the same synthetic workflow on fresh databases: ordinary steps sleeping 9,700 ms and 9,960 ms, then opened the completed run. Web browser: 1280×800, light theme. Both headers read took 20s; the second step changes from 10.0s to 10s. scenarios:prove exited 0: fails on base, passes on head.

Before After
Before: second step displays 10.0s After: second step displays 10s
a22a4f9bba 4b00254606
Before recording After recording

Scenario source

Not shown:

  • Mobile rendering was not run on a device; the real-app comparison covers web.
  • Exact 9,949 ms, 9,950 ms, and 9,999 ms boundary values were not demonstrated in the real app; this proof uses the reported 9,960 ms sleep.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 25, 2026
@juliusmarminge
juliusmarminge merged commit 89d9e74 into pingdotgg:main Nov 25, 2026
56 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants