spike(#610): WebDriver PoC on the routines fire API#623
Draft
suleimansh wants to merge 2 commits into
Draft
Conversation
Drive Claude Code on the web behind the existing Driver seam via the
supported routines fire API (POST /v1/claude_code/routines/{id}/fire),
not the browser UI. prompt() fires the routine and returns the created
session handle (id + url); readCode is omitted (remote workspace),
dispose is a no-op. Transport is an injectable fetch, unit-tested.
Spike only, no changeset: the fire-and-forget contract (prompt resolves
on session-created, not final turn) is an open seam-design question.
1 task
Decision on the async contract (option A): prompt stays fire-and-forget and returns the session handle; the finished code is awaited separately. Add optional DriverSession.collect() + DriverOutcome to the seam (only async/off-machine drivers implement it), and wire WebSession.collect to an injectable resolveOutcome so branch discovery stays the caller's policy (the daemon polls GitHub), keeping the driver transport-only. 10 web-driver tests green; full driver suite (60) green.
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.
Spike for #610. Draft until a live-token
/firerun happens; the mechanism and seam fit are proven.What this is
A
WebDriverthat runs a task on Claude Code on the web behind the existingDriverseam, via the supported routines fire API (POST /v1/claude_code/routines/{id}/fire), not the browser UI.prompt(text)fires the routine and returns the created session handle (id + url) as the turn.collect()awaits the eventual result (the branch the cloud session pushes / its PR).readCodeis omitted (the workspace is a remote VM).disposeis a no-op (cloud session persists server-side).fetch, so it is unit-tested with no network and no real token.Why the API, not the browser or the CLI flag
claude --cloudis TTY-gated (CLI v2.1.211): run non-interactively (piped stdout) it exits 1 and would silently run locally. That is exactly the modeClaudeCodeDriveruses, so--cloudcannot slot behind the non-interactive driver.--cloudstays the human-at-a-terminal path; the API is the programmatic one.Async contract (decided: option A)
The web flow is fire-and-forget, so
promptresolves with the session handle, not a final turn. Rather than block the driver, the seam gains an optionalcollect()+DriverOutcome(only async/off-machine drivers implement it). Branch discovery is the caller's policy via an injectableresolveOutcome(the daemon, #605, polls GitHub), so the driver stays transport-only.Tests
10 web-driver unit tests, full driver suite (60) green;
pnpm typecheckclean. Covers fire + handle, framing fold, events, error-envelope on 429, unrecognized 200, aborted prompt, noreadCode, andcollect(no-resolver, injected-resolver, and pre-prompt guard).Remaining before ready: one live
/fireagainst a real routine token, then the changeset. No changeset yet, intentional.