Repository navigation
fix(shot): restore the desktop capture harness and add session-usage scenarios - #727
Merged
Merged
Conversation
…scenarios The desktop harness stopped working when the Agent readiness gate landed: the mock had no `get_agent_status`, so `useAgentStatus` received null and threw while rendering. The app sat on its splash forever and every desktop capture failed with the opaque `cdp: app not ready after 45000 ms`. Answer the command from the demo build info and note the failure mode in the troubleshooting table — a null-returning unknown command turns into a stuck UI, not a visible error, so the console's `[mock] UNHANDLED COMMAND` line is the thing to look for. Capture the session token/amount surfaces that had no scenario yet: - desktop `thread-usage` (header amount + the breakdown dialog), `thread-usage-unpriced` (a model with no prices on file) and `custom-model-prices` (the provider form's price fields, scrolled into view); - mobile `usage-sheet` and `usage-sheet-unpriced` (top-bar amount → the bottom sheet, driven by an `eval` click and asserted, since taps are unreliable under the mobile emulation and a missing sheet would otherwise still "pass"). Demo data: give the demo sessions a session usage whose rows are exact at the four decimals the dialog shows and add up to the total (so a rounded row never looks like a bug), and give the demo custom provider rates. The chat-mode conversations stand in for the unpriced case. The header amount is the entry point to the dialog, so give it an accessible name — it was announced as a bare "¥1.0904" before, and without it the harness can only drive the control by its visible text.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The desktop capture harness stopped working when the Agent readiness gate landed (#725): the mock has no
get_agent_status,useAgentStatusreceivednulland threw while rendering, and the app stayed on its splash forever. Every desktop capture failed with the opaquecdp: app not ready after 45000 ms: !!document.querySelector('[aria-label]')— the mock's own[mock] UNHANDLED COMMANDline was the only clue, buried in the console. While fixing that, the session token/amount surfaces added in #726 turned out to have no scenario at all, so the feature could not be photographed.What changed
Harness fix
get_agent_statusfrom the demo build info, so the desktop app leaves its splash.New scenarios
thread-usage(header amount + the breakdown dialog),thread-usage-unpriced(a model with no prices on file) andcustom-model-prices(the provider form's price fields, scrolled into view viaeval+ asserted).usage-sheetandusage-sheet-unpriced(top-bar amount → bottom sheet). Driven by anevalclick with an assertion, because taps are unreliable under the mobile emulation and a sheet that never opened would otherwise still "pass".Demo data
Small app change
Checks
capture-desktop thread-usage thread-usage-unpriced custom-model-prices→3/3 captured, every step reached its target.tsc --noEmit,eslint src shot,vitest run src/features/agent src/integrations/agent(516 passed).eslint shot src/features/chat src/i18n,jest src/features/chat src/i18n(278 passed).