Conversation
dangzitou
force-pushed
the
feat/diagnostics-export
branch
from
September 27, 2026 18:07
88205b7 to
a10492d
Compare
Agents cannot inspect BrowserSkill's own debug console: the extension debug page is served under a chrome-extension:// URL that the Agent Window sandbox refuses to observe, so a failed tool call has no matching local diagnostics. Export what the CLI can see instead. The bundle contains the daemon log tail, daemon status, the `bsk doctor` checks and the active session list. Values of credential keys (token, cookie, authorization, password, …) become `[REDACTED]` by default; credential headers are redacted to end of line so `Bearer` tokens never survive. Every source degrades to a README note when the daemon or log file is absent, so a bundle is always writable. doctor::checks() exposes the check list without rendering so the export reuses the same daemon-state resolution `bsk doctor` does.
dangzitou
force-pushed
the
feat/diagnostics-export
branch
from
September 27, 2026 18:13
a10492d to
658fd4e
Compare
This branch has not been deployed
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.
What problem this solves
Fixes #335.
An agent that sees BrowserSkill fail has no supported way to inspect
BrowserSkill's own state: the extension debug page is served under a
chrome-extension://URL, which the Agent Window sandbox deliberatelyrefuses to observe, and borrowing the user's debug tab can fail when no
tab can show the confirmation. Recovery then depends on the user
manually reading debug output. This adds a CLI command that exports
what the CLI can see — daemon log tail, daemon status, the
bsk doctorchecks, and the active session list — as a single zip an agent can
attach to an issue report.
How this fixes it
bsk diagnostics export [--out <path>] [--log-lines <n>]writes a zip:metadata.json— CLI/daemon versions, platform, timestamp.doctor.json— the checksbsk doctorruns, with repair hints.status.json— daemon info, status and active sessions (nullwitha README note when no daemon is running).
daemon-log.txt— trailing log lines (default 500, capped at 4 MiB).README.md— contents, missing parts, redaction note, scope limits.Redaction is on by default: values of credential keys (token, cookie,
authorization, password, …) become
[REDACTED]in both JSON and shellspellings; credential headers are redacted to end of line so
Authorization: Bearer <token>never survives. Ordinary lines (URLs,session ids, tab ids) pass through unchanged, and keys embedded in
larger identifiers (
secretive,tokens_seen) are not touched. Theone residual gap — a raw credential with no key, e.g. a token inside a
URL — is called out in the README.
Every source is best-effort: a missing daemon or log file is recorded in
the README's "Missing parts" section instead of failing, so a bundle is
always writable.
doctor::checks()is extracted so the export reusesthe exact daemon-state resolution
bsk doctorruns.User impact
bsk diagnostics export --out diag.zipAgents and users get one file to attach when reporting problems, with
credential values removed. Scope is deliberately the CLI-visible
surface; the extension's own debug page remains out of reach by design
and is called out in the README.
Validation
cargo fmt --all -- --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --locked(green;no new tests included in this PR).
session (Chrome for Testing 154 + unpacked extension) —
status.jsoncontains the session anddaemon-log.txtis redacted;with no daemon — all optional parts recorded as README notes.