-
Notifications
You must be signed in to change notification settings - Fork 5
Feat(templates): add ehr typescript template #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ment, utilities, sampling loop, and session management.
… Use, specify a new EHR portal URL, and require `ANTHROPIC_API_KEY`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| onlyNMostRecentImages, | ||
| imageTruncationThreshold | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Image filtering feature is unreachable due to variable reassignment
Medium Severity
The onlyNMostRecentImages parameter is rendered non-functional because enablePromptCaching is hardcoded to true (line 92), which causes onlyNMostRecentImages to always be set to 0 (line 97) before the filtering check at line 101. Since 0 is falsy, the maybeFilterToNMostRecentImages function can never execute, making the onlyNMostRecentImages parameter ineffective. This breaks the intended image truncation feature for controlling context window size.
| role: 'user', | ||
| content: toolResultContent, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential infinite loop when tool validation fails
Medium Severity
When the LLM returns stop_reason: 'tool_use' but the tool_use block fails internal validation (e.g., missing action field or action is not a string), the loop will continue indefinitely. The exit condition at line 184 requires response.stop_reason !== 'tool_use' to be true, but when stop_reason is 'tool_use' and no valid tool results are generated, no new messages are pushed and the same API call repeats forever.


EHR System Automation Template
This template demonstrates how to run an agentic browser workflow on Kernel to automate an Electronic Health Records (EHR) portal. It uses an Anthropic Computer Use loop with Kernel's Computer Controls API.
Logic
The automation performs the following steps:
https://ehr-system-six.vercel.app/login).Quickstart
Deploy:
kernel deploy index.ts -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEYInvoke:
View logs:
Notes
pkg/templates/typescript/ehr-system/index.tsif you host the portal elsewhere.Requirements
Note
Low Risk
Primarily adds new app templates and updates docs; no changes to core CLI behavior beyond embedding additional template files (main risk is template correctness/size).
Overview
Adds two new
kernel createtemplates:ehr-system(TypeScript), an Anthropic Computer Use + Kernel Computer Controls demo that can optionally record browser replays, andlead-scraper(Python), a Google Maps lead scraper built onbrowser-usewith Pydantic I/O models.Updates the top-level
README.mdto list the new templates and include examplekernel createcommands, and adds the template source trees (including helper utilities like robust lead-output parsing and a minimal Computer Use tool implementation for Kernel’s computer controls API).Written by Cursor Bugbot for commit f620090. This will update automatically on new commits. Configure here.