Skip to content

feat(claw-app): default audit replay to 2x#2015

Merged
Nikhil (shadowfax92) merged 1 commit into
mainfrom
feat/default-replay-speed-2x
Jul 23, 2026
Merged

feat(claw-app): default audit replay to 2x#2015
Nikhil (shadowfax92) merged 1 commit into
mainfrom
feat/default-replay-speed-2x

Conversation

@shadowfax92

Copy link
Copy Markdown
Contributor

Summary

  • Start Audit Replay playback at 2× by default.
  • Keep the existing 1×, 2×, and 4× speed controls selectable.
  • Cover the visible default selection and manual speed changes with a focused transport test.

Design

The replay transport now names 2× as its default alongside the supported speed list, and usePlayback initializes from that default. The existing controlled toggle group and rrweb speed synchronization remain unchanged.

Test plan

  • bun test apps/claw-app/screens/replay/PlaybackTransport.test.tsx
  • bun run test from apps/claw-app
  • bun run --filter @browseros/claw-app typecheck
  • Biome check on all touched files

Baseline notes

  • Repository-wide bun run check still reports the two existing noUnsafeOptionalChaining errors in apps/server/tests/lib/agents/acpx-runtime.test.ts; that file is identical to origin/main.
  • Repository-wide bun run test still reports the existing stale setup-uv@v8.2.0 assertion in scripts/release/release-claw-server-rust-workflow.test.ts; that file is identical to origin/main.

@shadowfax92

Copy link
Copy Markdown
Contributor Author

Greptile (@greptileai) review

@shadowfax92

Copy link
Copy Markdown
Contributor Author

Claude (@claude) review

@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude finished Nikhil (@shadowfax92)'s task in 1m 37s —— View job


Review

  • Gather context (diff, changed files, CLAUDE.md)
  • Review code changes
  • Post review feedback

Scope: PLAYBACK_SPEEDS[0]DEFAULT_PLAYBACK_SPEED (2) in use-playback.ts, a new exported constant in replay.helpers.ts, and a focused RTL-style test for PlaybackTransport. Small, well-targeted diff.

Findings:

  • use-playback.ts:26usePlayback now seeds speed from DEFAULT_PLAYBACK_SPEED; setPlaybackSpeed still gates on PLAYBACK_SPEEDS.includes(next) (use-playback.ts:36), and 2 is a member of PLAYBACK_SPEEDS, so this is internally consistent.
  • Checked the rrweb sync path in Replay.tsx for a stale-speed bug: onPlayerReady (Replay.tsx:157-164) explicitly calls handle.setSpeed(playbackSpeedRef.current) at the moment the player becomes ready, so the new 2x default is correctly applied to the underlying Replayer even though it's constructed with a hardcoded speed: 1 in ReplayViewport.tsx:134. No regression there.
  • PlaybackTransport.test.tsx reuses the exact DOM/linkedom/IS_REACT_ACT_ENVIRONMENT harness pattern already used in Replay.test.tsx and ReplayViewport.test.tsx, so it's consistent with existing conventions rather than a one-off. It verifies the 2× button starts aria-pressed="true" and that clicking 1×/4× correctly toggles pressed state.
  • Minor nit (non-blocking): DEFAULT_PLAYBACK_SPEED = 2 is a standalone literal rather than derived from PLAYBACK_SPEEDS (e.g. PLAYBACK_SPEEDS[1]). Fine as-is since it's colocated and exported right next to the array, just flagging that the two could silently drift if PLAYBACK_SPEEDS's order ever changes.

Not verified: I wasn't able to execute bun test / bun run check in this sandbox (Bash tool calls beyond git require interactive approval that isn't available here), so I reviewed statically only. The PR body's listed test/typecheck/lint results were not independently re-run.

No correctness, security, or style issues found. LGTM.

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR changes Audit Replay’s initial playback speed from 1× to 2× while retaining the existing 1×, 2×, and 4× controls, and adds a focused transport test covering the default selection and manual changes.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The new default is consistently exposed through usePlayback, the existing speed options remain selectable, and no changed path introduces a concrete playback, build, or test failure.

Important Files Changed

Filename Overview
packages/browseros-agent/apps/claw-app/screens/replay/replay.helpers.ts Adds a named 2× default alongside the unchanged supported playback-speed list.
packages/browseros-agent/apps/claw-app/screens/replay/use-playback.ts Initializes playback speed from the new default constant without changing playback controls or timing logic.
packages/browseros-agent/apps/claw-app/screens/replay/PlaybackTransport.test.tsx Adds focused coverage confirming the visible 2× default and selection of the remaining supported speeds.

Reviews (1): Last reviewed commit: "feat(claw-app): default replays to 2x" | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Updates Audit Replay to begin playback at 2× by default.

  • Adds a named DEFAULT_PLAYBACK_SPEED alongside the existing 1×, 2×, and 4× options.
  • Initializes usePlayback with the new default.
  • Adds a focused transport test covering the initial selection and manual speed changes.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The new default flows through the existing playback-speed synchronization path, all supported controls remain selectable, and the focused test follows the repository’s established isolated DOM-test pattern.

Important Files Changed

Filename Overview
packages/browseros-agent/apps/claw-app/screens/replay/replay.helpers.ts Adds the explicit 2× default without changing the supported playback-speed options.
packages/browseros-agent/apps/claw-app/screens/replay/use-playback.ts Initializes playback speed from the new default while preserving existing playback behavior.
packages/browseros-agent/apps/claw-app/screens/replay/PlaybackTransport.test.tsx Verifies the visible 2× default and continued selection of the 1× and 4× controls.

Reviews (2): Last reviewed commit: "feat(claw-app): default replays to 2x" | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown
Contributor

✅ Tests passed — 1695/1699

Suite Passed Failed Skipped
agent 350/350 0 0
build 34/34 0 0
claw-app 215/215 0 0
⚠️ claw-mcp 0/0 0 0
⚠️ claw-onboard 0/0 0 0
⚠️ claw-server-rust-quality 0/0 0 0
⚠️ claw-server-rust 0/0 0 0
server-agent 314/314 0 0
server-api 171/171 0 0
server-browser 10/10 0 0
server-integration 10/10 0 0
server-lib 299/300 0 1
server-root 38/41 0 3
server-tools 254/254 0 0

View workflow run

@shadowfax92
Nikhil (shadowfax92) merged commit 8075f87 into main Jul 23, 2026
25 checks passed
Dani Akash (DaniAkash) added a commit that referenced this pull request Jul 24, 2026
* chore(deps): bump golang.org/x/crypto to v0.52.0 in apps/cli (#1994)

Refresh go.sum and the x/sys transitive dependency.

* chore(deps): bump the uv group across 1 directory with 5 updates (#1995)

Bumps the uv group with 5 updates in the /packages/browseros directory:

| Package | From | To |
| --- | --- | --- |
| [requests](https://github.com/psf/requests) | `2.32.5` | `2.33.0` |
| [python-dotenv](https://github.com/theskumar/python-dotenv) | `1.2.1` | `1.2.2` |
| [cryptography](https://github.com/pyca/cryptography) | `46.0.3` | `48.0.1` |
| [idna](https://github.com/kjd/idna) | `3.11` | `3.15` |
| [urllib3](https://github.com/urllib3/urllib3) | `2.5.0` | `2.7.0` |



Updates `requests` from 2.32.5 to 2.33.0
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.32.5...v2.33.0)

Updates `python-dotenv` from 1.2.1 to 1.2.2
- [Release notes](https://github.com/theskumar/python-dotenv/releases)
- [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md)
- [Commits](theskumar/python-dotenv@v1.2.1...v1.2.2)

Updates `cryptography` from 46.0.3 to 48.0.1
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@46.0.3...48.0.1)

Updates `idna` from 3.11 to 3.15
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](kjd/idna@v3.11...v3.15)

Updates `urllib3` from 2.5.0 to 2.7.0
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.5.0...2.7.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.33.0
  dependency-type: direct:production
  dependency-group: uv
- dependency-name: python-dotenv
  dependency-version: 1.2.2
  dependency-type: direct:production
  dependency-group: uv
- dependency-name: cryptography
  dependency-version: 48.0.1
  dependency-type: direct:production
  dependency-group: uv
- dependency-name: idna
  dependency-version: '3.15'
  dependency-type: indirect
  dependency-group: uv
- dependency-name: urllib3
  dependency-version: 2.7.0
  dependency-type: indirect
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): pin transitive dependency resolutions in browseros-agent (#1997)

Refresh a batch of pinned transitive resolutions to their current patch
releases via overrides and update bun.lock.

* Revert "fix(claw-app): scale Audit tab navigation (#1987)" (#1998)

This reverts commit ee46ec4.

* feat(claw): rewrite BrowserClaw harness skill (#1999)

Frontmatter description now carries the standing instruction — default to
BrowserClaw for browser work unprompted, over in-app browser surfaces —
and the body becomes a compact operating manual: session etiquette,
task-owned tabs, the snapshot -> act -> verify loop, read/grep and tool
escalation, failure handling, and the untrusted-page-content rule.
Validation test probes and line budget updated to match.

* fix(agent): reconcile aliased skill targets by identity (#2001)

* fix(agent): reconcile aliased skill targets by identity

* fix(claw): use app resources in local launchers

* test(claw): assert physical skill manifest paths

* fix: address review findings for browserclaw-skill-target-identity

* feat(claw): show total tokens consumed on Audit surfaces (#2000)

* feat(claw): show total tokens consumed on Audit surfaces

Materialize per-session token estimates (input+output, summed across
dispatches) onto the tasks table via recompute_task, so the total is
available live and not only from the post-teardown efficiency projection.
Expose it through the canonical OpenAPI path as an optional SessionSummary
tokenUsage field, present only when the session has dispatches and every one
carries token-estimator v1 (legacy/unmeasured sessions omit it).

Both Audit surfaces render it from the one shared field: a compact Tokens
column on the session list (exact count on hover, em dash when unmeasured)
and a Tokens entry on the session-detail summary card.

* fix(claw): sort unmeasured token totals last in both directions

The Tokens-column accessor mapped unmeasured sessions to 0, which only
sank them on a descending sort — an ascending sort surfaced them ahead of
every measured session. Return undefined and use tanstack's
sortUndefined:'last' so unmeasured rows stay at the bottom either way.

* fix(claw): hide tokens in audit list (#2002)

* fix(claw): ground screenshot token baseline (#2003)

* fix(claw): ground screenshot token baseline

* test(claw): update cockpit efficiency expectation

* test(claw): preserve signed savings coverage

* feat(claw): move audit observation off the tool path (#2005)

* refactor(claw): separate tool observers from effects

* feat(claw): queue audit observations in bounded worker

* fix(claw): flush coalesced audit previews on session close

* test(claw): verify async audit shutdown lifecycle

* fix: address review findings for 260723-1154_async_audit_observer

* fix(claw): sum tool durations for human time saved (#2004)

* fix(claw): sum tool durations for time saved

* fix(claw): preserve retained efficiency history

* fix(claw): guard efficiency backfill from session reuse

* fix(claw): stop cockpit saved-stats labels from overlapping (#2006)

Both the "used" and "screenshot-first" token labels were absolutely
positioned inside the same overflow-hidden budget track. Around the
mid-range their text occupied the same pixels and painted through each
other (e.g. "used 63.2K" over "112.3K").

Lift both numbers into a legend row above the bar — a flex
justify-between row that wraps to two lines before the labels could ever
meet — and keep the track as a pure gauge: accent fill = what
BrowserClaw used, striped remainder = what a screenshot-first agent
would have spent. The bar carries no text now, so nothing can collide or
clip at any used/total ratio or label length.

Accessibility, reduced-motion (the pulsing dot keeps motion-reduce),
theme tokens, and the stats/API contract are unchanged. Tests assert the
structural invariant (no labels inside the bounded bar) across low, mid,
and full ratios, and the fill width replaces the old marker-position
assertions.

* refactor(patches): retire hidden window implementation (#2007)

* refactor(patches): retire hidden window implementation

* fix(patches): preserve single-close window teardown

* chore: sync internal-docs submodule (#2008)

Co-authored-by: browseros-bot <bot@browseros.ai>

* chore: sync internal-docs submodule (#2009)

Co-authored-by: browseros-bot <bot@browseros.ai>

* fix(claw): use session duration for human time saved (#2010)

* fix(claw): use session duration for saved time

* fix(claw): backfill saved time from task durations

* perf(core): acquire snapshots concurrently (#2011)

* perf(core): batch cursor backend-node resolution

* refactor(core): separate snapshot frame acquisition

* perf(core): acquire snapshot sibling frames concurrently

* perf(core): trace concurrent snapshot capture

* fix: address review findings for snapshot-concurrent-acquisition

* fix: address review findings for snapshot-concurrent-acquisition

* fix: address review findings for snapshot-concurrent-acquisition

* fix: suppress intentional cursor asset expression

* fix(core): clear frame sessions after reconnect

* fix(core): address snapshot PR review notes

* feat(claw-app): default replays to 2x (#2015)

* chore: refresh TypeScript CDP and retire hidden surfaces (#2014)

* chore(cdp): refresh TypeScript protocol definitions

* refactor(server): use background pages for scheduled tasks

* refactor(browser-core): retire hidden page and window behavior

* refactor(browser-mcp): remove hidden tab and window controls

* test: repair TypeScript verification baselines

* test(claw-app): prepare WXT aliases before tests

* fix(claw): exclude red from automatic tab-group colors (#2016)

* fix(claw): exclude red from automatic tab groups

* test(claw): update automatic tab color fixture

* test(claw): cover snapshot concurrency contracts (#2017)

* test(claw): add snapshot concurrency fixtures

* test(claw): cover live cursor snapshot acquisition

* test(claw): cover concurrent iframe snapshot contracts

* test(claw): stress overlapping snapshot contracts

* fix: address review findings for snapshot-concurrency-contract-tests

* fix: address review findings for snapshot-concurrency-contract-tests

* refactor: refresh Rust CDP and retire hidden windows (#2013)

* chore(cdp): sync Rust protocol from Chromium

* refactor(core): retire hidden window state

* refactor(mcp): remove hidden window controls

* refactor(server): drop hidden window runtime references

* test(core): align getProperties fixtures with protocol

* test(mcp): retire hidden conformance cases

* chore(release): build v0.48.3 [skip ci]

Automated nightly macOS version bump.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nikhil <nikhilsv92@gmail.com>
Co-authored-by: browseros-bot <bot@browseros.ai>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant