Repository navigation
<
8000
div style="--spacing:var(--spacing-none)" class="prc-PageLayout-PageLayoutRoot--KH-d" data-component="SplitPageLayout" data-has-sidebar="true">
feat: capture console and browser logs per tab - #7
Merged
Merged
Conversation
Each attached tab buffers Runtime.consoleAPICalled, Runtime.exceptionThrown
and Log.entryAdded events in a ring (--console-buffer, default 1000, 0
disables). Entries carry a per-tab sequence number so faces can read only
what is new.
- core.Core.Logs(session, after, minLevel) for every face (MCP next)
- GET /tether/v1/tabs/{id}/logs?after=&level= on the control API
- WebDriver get_log("browser") via /se/log and /log, ChromeDriver-style
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtFFUWfDTzh1KEm5aPavz3
adeelahmad
pushed a commit
that referenced
this pull request
Oct 11, 2026
Resolves conflicts with #7 (console logs): Tab gets both Guard and Logs, the API keeps the policy routes and adds /tabs/{id}/logs, and docs list both features. Also makes TestConsoleLogs tolerate a late favicon 404 between the two WebDriver log reads (it asserted the second read was empty; it should assert no entry repeats). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X9CEjRcHsJmgWdtz6ZTKsk
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.
Requested by Adeel · project thread
What
Every tab Tether drives now keeps its recent
console.*output, uncaught exceptions and browser log entries (failed requests, security warnings), readable three ways:GET /tether/v1/tabs/{id}/logs?after=N&level=warningreturns{"entries":[…],"next":N}. Poll withafter=nextto read only new entries.driver.get_log("browser")(POST /session/{id}/se/logand/log, plus/log/types). It works like ChromeDriver: each entry is returned once per session, with levelsDEBUG/INFO/WARNING/SEVERE, and nogoog:loggingPrefsis needed.core.Core.Logs(session, after, minLevel) (entries, next)gives the MCP face something to read from. It skips the tab lock, so logs can be read while a request is running.cdpenablesRuntimeandLogon attach and keeps a per-tab ring buffer ofRuntime.consoleAPICalled,Runtime.exceptionThrownandLog.entryAdded. The buffer is sized by--console-buffer/TETHER_CONSOLE_BUFFER(default 1000,0turns capture off and leaves those domains disabled). Each entry is capped at 8 KiB, and the event subscription is dropped when its target is destroyed or detached.Why
Console log capture was on the v1 roadmap. Agents and Selenium scripts need to see page errors.
How tested
make checkequivalents: gofmt,go vet(with and withoutintegrationtag), golangci-lint v2.5.0 (0 issues),go test -race ./...make test-integrationagainst headless Chromium. The newTestConsoleLogscovers console.log/warn/error, an uncaught exception, a 404 resource entry, level filtering, theaftercursor, and WebDriverse/log+logwith no repeats.Security
Runtime.enablecan be detected by anti-bot scripts.--console-buffer 0addresses both.🤖 Generated with Claude Code
https://claude.ai/code/session_01LtFFUWfDTzh1KEm5aPavz3
Generated by Claude Code