Skip to content

fix(browser): reuse last network snapshot for browser network --detail#1051

Open
freemandealer wants to merge 1 commit intojackwener:mainfrom
freemandealer:fix/browser-network-detail-cache
Open

fix(browser): reuse last network snapshot for browser network --detail#1051
freemandealer wants to merge 1 commit intojackwener:mainfrom
freemandealer:fix/browser-network-detail-cache

Conversation

@freemandealer
Copy link
Copy Markdown
Contributor

@freemandealer freemandealer commented Apr 16, 2026

Summary

  • cache the last browser network snapshot and reuse it for browser network --detail <index>
  • add coverage for cached detail lookup and out-of-range indexes

Problem

browser network --detail <index> could consume a fresh capture batch instead of the list the user had just seen, so the selected index could immediately stop matching the request they meant to inspect.

Validation

  • npx vitest run --project unit src/cli.test.ts
  • npm run typecheck

The previous browser network flow made follow-up inspection unstable.

`opencli browser network --detail <index>` could read a fresh capture batch instead of the list the user had just seen. That broke index alignment immediately after the first read, so users could not reliably inspect the request they selected from `browser network`.

Keep this fix in the CLI only and leave daemon/extension window-idle behavior unchanged.

- persist the last listed `browser network` snapshot in the browser cache directory
- make `--detail` load that snapshot first so indexes stay stable across follow-up inspection
- surface a usage error when the requested index is outside the cached snapshot
- add unit coverage for cached detail lookup and out-of-range indexes

Before:
- `opencli browser network` listed requests
- `opencli browser network --detail 3` could consume a different batch and make `3` point at the wrong request

After:
- `opencli browser network` lists requests and saves that snapshot
- `opencli browser network --detail 3` inspects request jackwener#3 from the same snapshot
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.

1 participant