Repository navigation
Claude Code as a cloud worker program; fix self-hosted prefetch; release 0.6.0 - #19
Merged
Merged
Conversation
…ase 0.6.0 plan.workerProgram chooses codex (default) or claude. ClaudeSessionDriver offers Claude Code's stream-json interface through the same contract the runtime uses for a Codex app-server, so operator commands, stop receipts, traces, workflows and evidence are shared. The bootstrap installs one pinned release by checksum. factory-selfhost deploy could not run on a new model: staged sources lacked the profiles, and the helper run needed a secret only the deployment creates. Fixes #15
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.
Cloud lite workers can now run Claude Code instead of Codex, on a subscription or on a self-hosted model. Ships as 0.6.0. Plans that do not set
workerProgrambehave as before, and the Codex bootstrap script is byte-identical to 0.5.0.Worker program
plan.workerProgram: 'codex' | 'claude', defaultcodex, with no new default written into existing fleet bindings.anthropicfor Claude Code,responsesfor Codex), and a broker made for the other program.src/cloud-lite/claude-driver.mjsClaudeSessionDriveroffers the same methods and notifications the runtime already uses for a Codex app-server (thread/start|resume|read,turn/start|steer|interrupt). SoNativeOperatorStop,NativeWorkflowWake, traces and the board are shared code, not copies.--session-id, then--resume). An idle session holds no process.item/completed(agentMessage,reasoning,toolCall,toolResult),thread/tokenUsage/updatedandmodel/retry. Streaming deltas are skipped unlesstraceDeltasis on.Auth
claudeProviderEnvironment(). The key is a staged secret and reaches only the Claude Code process.ClaudeSubscriptionBrokerholds a long-lived token fromclaude setup-tokenin a private file on the trusted host. There is no refresh token to protect; replacing the file rotates the token for the next turn. A refused token asks the host for the current one through the existing/authpath.CLAUDE_CODE_SHELL_PREFIX, a small wrapper that removes the credentials.CLAUDE_CODE_SUBPROCESS_ENV_SCRUBwas tried and rejected: it forces default permission checks, and commands with shell variables were then refused.danger-full-access, an agent command runs as the same user and could read the key from its parent process.Bootstrap and sandbox
bubblewrapandsocat. Only the selected program is installed.danger-full-accessmaps to--dangerously-skip-permissions.workspace-writeandread-onlyuse Claude Code's operating system sandbox with no network, and refuse to run commands without it.boardTools: falseandsupervision: 'operator'keep working.Two bugs found in 0.5.0 by the live check (
factory-selfhost deploycould not create a new model; earlier tests used a fake runner)profiles/, so every new deployment was refused.--prefetchand flag checks started an app containing the serving functions, which need a secret that only the later deployment creates. Helper runs now leave those functions out.Tests and docs:
test/cloud-lite-claude.test.mjs(18 tests, with a fake stream-json process intest/fixtures/fake-claude.mjs, added to the focused list), offline tests for both bugs, PUBLIC_SDK.md, and theClaudeSubscriptionBrokerexport in the packed-package verifier.Fixes #15
Live check on a self-hosted endpoint
runCloudLiteMachinewith its coordinator, the real Claude Code 2.1.311 and a real vLLM endpoint (profileqwen, one H100), in a Linux container with/dataas the Machine volume, driven through the operator HTTP interface a fleet uses:READY)threadStatus: idle,turnStatus: interrupted, matching command, thread and turn)grep -cprinted 0)Cost: about $0.84 of GPU and CPU by Modal's billing report. The model was retired afterwards and its app, secret and volumes were checked gone. Retirement needed a second run while the GPU container was stopping; see the follow-up issue.
The same machine run also passed against a scripted local model, in all three sandbox modes, with the real binary. It showed that commands write only where allowed, have no network, and lose the key, and that the file tools stay inside the same folders.
Not run: a real Fly Machine (the deployment path is covered offline, and the generated bootstrap was run on a clean local container), and a real subscription token (offline tests only).
Local CI (AGENTS.md)
Same steps as
.github/workflows/public-sdk.yml(focused list read from the workflow file, 26 files), on a cleangit archiveexport of 5ea6f19 with freshnpm ci. Linux used an archive with the repository's own line endings.factory-selfhost profilesnode:22.17.0-bookworm, Python 3.11node:24.22.2-bookworm, Python 3.11