Repository navigation
feat: add browser-only Cloudflare price agent and saved sessions - #187
Open
kevinaimonster wants to merge 3 commits into
Open
kevinaimonster wants to merge 3 commits into
kevinaimonster wants to merge 3 commits into
Conversation
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 changed
Add a private Cloudflare browser agent demo with multi-turn DeepSeek Flash conversations, a remote Chrome view, exact-text price evidence, and per-conversation browser checkpoints. An operator can save and close a browser, reconnect to an existing session, or restore cookies and current-origin web storage into a new browser.
The model receives seven browser actions and one price-evidence tool. Unknown tools and invalid navigation URLs are rejected before browser creation. Intercepted requests reject local/internal protocols, agent interactions validate the current page, and clicks reject file inputs, explicit download links and non-web links. There are no filesystem, shell, desktop-control or arbitrary JavaScript tools. These checks complement the model instructions; they do not claim to sandbox every manual Live View operation or browser-initiated download.
The standalone HTML architecture diagram maps the deployed modules and provides step-by-step highlighting of the model/tool loop and the separate Live View stream. Agents SDK and our tool executor run in the Worker's SQLite Durable Object; Puppeteer controls Chrome in Browser Run. The optional local Node proxy only forwards authenticated HTTP. The document compares this with local-agent/CDP, Quick Actions/REST, MCP, and the separate Docker/OpenMuse computer setup.
Checkpoint credentials remain in private SQLite rows, separate from synchronized Agent state and model messages. Failed or oversized saves retain the previous checkpoint, failed restoration closes its incomplete browser, and a provider 429 stops the loop without discarding the checkpoint. The main OpenMuse runtime is unchanged; this example has its own dependencies and manual deployment.
Verification
npm run check, all 28 unit tests, a Worker deployment dry run, root Biome checking of 189 files, JavaScript syntax checking, diff whitespace checks and a known-environment-credential scan passed.c3dc1ab5-a684-4c85-b58a-800b889c7469. A real cloud DeepSeek turn refused listing server files/readingfile:///etc/passwd, and no browser was launched. The subsequent public catalogue browsing check was blocked by Cloudflare HTTP 429 at browser creation. Real-browser acceptance of this policy and the checkpoint lifecycle remains incomplete. No browser was left running by the check, and no billing-plan change was made.Original remote-browser observation, showing a fictional product page; this is not visual acceptance of the chat UI or architecture HTML:
Integration limits
Requires Workers, SQLite Durable Objects, Browser Run access, a DeepSeek key and a private owner token. This is a single-owner demo, not a deployed 2000-tenant authentication and scheduling service. No public
/agents/*route is exposed. Live View URLs are temporary bearer credentials issued only after application authentication.A checkpoint covers one current page and its origin's storage, up to 512 KiB. It excludes other tabs, IndexedDB, downloads, history, cache and JavaScript memory; website sessions may expire. An already closed browser without a checkpoint cannot be recovered retroactively. Hostname validation is not DNS pinning or a replacement for provider isolation. Browser placement is Cloudflare-managed and Tokyo residency is not guaranteed. CI does not deploy.