Sorry, something went wrong.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Sorry, something went wrong.
| * Stop recording, and delete the browser session. | ||
| */ | ||
| async stop(): Promise<SessionInfo> { | ||
| const info = this.info; |
There was a problem hiding this comment.
Medium Severity
The stop() method calls this.info at line 188, which accesses the sessionId getter that throws if _sessionId is null. This happens before the if (this._sessionId) check at line 190. As a result, stop() throws an error when called before start() or when called twice (since stop() sets _sessionId = null at the end). The null check is positioned too late to prevent the error. Cleanup methods are typically expected to be idempotent.
Additional Locations (1)
Sorry, something went wrong.
| role: 'user', | ||
| content: toolResultContent, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Medium Severity
When response.stop_reason is 'tool_use' but the tool_use blocks have invalid structure (missing action property or non-string action), the code silently skips processing them. The assistant message is pushed (line 144-147), but no tool_result message follows. The exit condition at line 185 evaluates to false because stop_reason !== 'tool_use' is false, so the loop continues. The next API call receives an invalid message sequence (tool_use without tool_result), causing a confusing API error.
Additional Locations (1)
Sorry, something went wrong.
| } | ||
|
|
||
| const scrollDirection = scrollDirectionParam || kwargs.scroll_direction; | ||
| const scrollAmountValue = scrollAmount || scroll_amount; |
There was a problem hiding this comment.
Low Severity
Using || instead of ?? for scrollAmount || scroll_amount treats scrollAmount: 0 as falsy, causing it to fall back to scroll_amount. If scroll_amount is undefined, scrollAmountValue becomes undefined and validation fails with a confusing error. If scroll_amount is a non-zero value, that value is used instead of the intended zero. The same issue exists on line 291 for scrollDirection.
Sorry, something went wrong.
Summary
This PR adds a new Kernel TypeScript template that monitors SEC EDGAR regulatory filings using Anthropic Computer Use with Kernel’s Computer Controls API.
Demo (Loom):
https://www.loom.com/share/c4923cc443504c128a561ff35b040f32
Data Source:
SEC EDGAR Search — https://www.sec.gov/edgar/search/
The template demonstrates end-to-end browser automation via Claude’s computer-use capability to search, filter, and extract structured SEC filing data. It also supports optional video replay recording for debugging and auditing browser sessions.
Features
SEC EDGAR Search Automation
Navigates to SEC EDGAR, applies company/state/date filters, configures visible columns, and extracts structured filing data.
Anthropic Computer Use Integration
Uses claude-sonnet-4-5-20250929 with a thinking budget for visual browser navigation.
Kernel Browser Session Management
KernelBrowserSession class manages browser lifecycle with stealth mode and optional replay recording.
Robust Output Parsing
Multiple fallback strategies (JSON array, line-by-line parsing, regex) to reliably extract filings from LLM output.
Computer Tool Implementations
Full implementation of Anthropic computer_20241022 and computer_20250124 tool specs, mapped to Kernel’s xdotool-based API.
Usage
Output
The sec-edgar-task action returns a JSON object with the following structure:
Note
Low Risk
Adds a new standalone template under pkg/templates/typescript/ with no changes to existing runtime paths; risk is limited to template correctness and dependency footprint.
Overview
Adds a new TypeScript template, regulatory-filling-monitor, that uses Kernel browser sessions plus Anthropic Computer Use to navigate the SEC EDGAR search UI, apply company/state/date filters, and return structured filing results.
Includes a reusable browser session wrapper with optional replay recording, a samplingLoop that wires Anthropic beta tool calls to Kernel computer controls (with prompt caching/thinking support), and robust parsing of model output via explicit markers with fallbacks. Also adds template scaffolding (README.md, .env.example, _gitignore, tsconfig.json, package.json/lock) and the computer tool/action type + validation utilities.
Written by Cursor Bugbot for commit a8114dd. This will update automatically on new commits. Configure here.