Compare commits

..
Author SHA1 Message Date
T3 Code Test c99767e518 fix(orchestration-v2): protect pending Claude resumes 2026-08-14 20:52:14 +05:30
T3 Code Test d45c3e7f9a fix(orchestration-v2): guard Claude activation generations 2026-08-14 20:44:26 +05:30
T3 Code Test e4a4c60121 fix(orchestration-v2): settle subagent lifecycle races 2026-08-14 20:34:57 +05:30
T3 Code Test a1e1ab5f04 refactor(orchestration-v2): drop unused targeted task stop 2026-08-14 19:58:01 +05:30
T3 Code Test 29ebc7c37e test(client-runtime): include subagent activations in snapshot fixture 2026-08-14 15:06:07 +05:30
T3 Code Test 200bcc9d8c test(orchestration-v2): make observability regressions explicit 2026-08-14 15:04:13 +05:30
T3 Code Test da996a85f9 fix(web): avoid double-counting workflow failures 2026-08-14 15:04:13 +05:30
T3 Code Test ee333b1929 fix(orchestration-v2): preserve settled subagent state 2026-08-14 15:04:13 +05:30
T3 Code Test b0839e45b9 feat(web): show v2 subagents through the Agents CTA 2026-08-14 15:04:13 +05:30
Shivam SharmaandClaude Fable 5 fc171656c7 style(orchestration-v2): keep service boundaries namespace-imported in the turn-start test
The rebase reconstruction of this file left each service module imported
twice — once as a namespace and once for its tag. At a service boundary
the namespace shape is the convention, so the duplicate named imports go
and their uses read through the module.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:13 +05:30
Shivam SharmaandClaude Fable 5 1aea7ba0d3 fix(threads): include archived threads in the unfiltered thread refs
Worktree cleanup treats listAllThreadRefs as the complete set, but it
mapped only the live shells. A worktree held solely by an archived
thread was therefore classified orphaned and offered for removal — the
same data-loss shape this RPC exists to prevent, through a different gap.

Also drops the two toSorted calls in the subagent derivations: this
module is mobile-reachable and Hermes ships no ES2023 change-by-copy
array methods, so an Android import could crash. The regression deletes
toSorted from the prototype while exercising both derivations.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:13 +05:30
Shivam SharmaandClaude Fable 5 1391f94470 fix: reconcile the observability series with the rebased v2 base
The base rebased onto main again, renumbering migrations (subagent
observability moves 045 to 046) and reworking three paths this series
extends: Claude's background-task lookup, ACP's terminal-status helper,
and turn-item routing for inherited background items. Each merge keeps
both intents — the base's newer mechanism with this branch's activation,
identity-proof, and completedAt semantics.

ProviderTurnStartService.test.ts was added on both sides as different
files; rebuilt as the base's suite plus this branch's rehydration tests.
Test mocks and fixtures gain the members the observability types now
require.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 4b3f8be173 fix(orchestration-v2): apply Codex collab states that arrive before an activation
registerSubagentThreads emits a running subagent whose currentActivationId
stays null until the child turn opens an activation. The settled-noise gate
skipped every state without one, so a terminal state carried on the spawning
frame itself was dropped and the agent stuck at running. The gate now only
drops states for identities that are already settled; an active identity
without an activation is a just-registered agent whose state still counts.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 b95171112d style(orchestration-v2): import service modules as namespaces in the turn-start test
Aliasing a module's layer erases the service namespace at the call site;
the boundary convention keeps the module name visible.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 ba5b043d1f fix(orchestration-v2): require reactivation proof before identity routing
Pre-seeded reactivatable identities were treated as current-run
ownership, so an interrupted prior run's trailing traffic — delayed
non-terminal rows, activation updates, subagent items — was admitted and
misattributed: stale child threads got adopted, ingestion could be held
open indefinitely, and finalization could terminalize a prior run's
activation with this run's outcome.

Identity routing now requires proof that this run drives the agent. The
seed carries each identity's activation count at turn start; a genuine
re-activation always advances past that baseline, while trailing
traffic re-emits at it. Rows carrying this run's id, rows advancing the
baseline, and activations with a higher ordinal all prove it; until one
arrives, identity-only events are refused, and the lifecycle tracker
keys on the proven set rather than the seeded one.

Also folds in two review fixes: Claude cache-read tokens now count into
inputTokens (they are input the model consumed, and excluding them broke
reconciliation with the four-component total), and a running workflow
coordinator stays counted in the Agents panel while all its members are
settled — between phases the coordinator is the only live row, and
dropping it read "0 active" for a visibly running workflow.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 aeecfd01a9 test(web): reunite lineage windowing and detach-control coverage
The rebase both-added this file: the base's lineage-window tests and the
detach-control tests landed as competing versions. Keep both suites, and
teach the panel mocks about the base's row-ordering export.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 4dc6d32100 fix(mobile): reset the unavailable decision synchronously on route change
The decision state survived navigation on the same mounted screen: after
the timer fired for one thread, the next route's first render still saw
decided=true before the effect could reset it, flashing the unavailable
screen the delay exists to prevent. The state is now keyed by route and
reset during render, so a stale decision can never apply to a new route.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 f6e005ba0f fix(mobile): wait out thread hydration before declaring a thread unavailable
Thread selection resolves after the connection reports available, and a
hidden subagent thread's redirect-to-parent depends on that selection
landing. Deciding unavailable the instant the connection is ready
flashed the error screen over what was actually a redirect. The
unavailable state now waits out a short per-route decision window; the
redirect or content wins the race whenever the data arrives.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 3a74176b65 fix(threads): keep subagent worktrees visible to cleanup
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
T3 Code TestandClaude Fable 5 b8c54e76a3 fix: keep hidden subagent threads out of orphan checks and mobile routes
Worktree bookkeeping now reads every thread in the environment, so
deleting a parent no longer flags a worktree as orphaned while hidden
subagent threads still hold it. Mobile thread routes redirect internal
subagent threads to their parent instead of rendering the hidden
transcript, matching the web route guard.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam Sharma 36609fd932 test(web): update thread workflow mock 2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude 0e22482251 fix(web): preserve detachable thread controls
Co-Authored-By: Claude <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Opus 5 67022de4a2 refactor(web,mobile): drop code left dead by hiding subagent threads
Removing the "Open subagent thread" affordance left the mobile work log
subscribing to item support it no longer reads, and the web sidebar
importing a predicate it no longer calls. Both tripped the lint rule the
CI Check job enforces.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam Sharma 7ac23a7523 feat(web): hide subagent threads from user-facing thread lists
A subagent's child thread is an implementation detail of the agent that
owns it, not a conversation the user started. Listing them alongside real
threads makes the sidebar grow with every delegation.

Filtered at the source — the shell snapshot the server serves — so every
client sees the same set rather than each re-deriving it. The web client
filters again for locally-held state, and the thread route redirects to
the parent if a subagent thread is reached directly.

Mobile is part of the sweep, not left behind. It still offered "Open
subagent thread" and had no redirect to fall back on, so it would have
navigated to a thread the client no longer receives. Its relationships
banner also needed the same subagent-edge filter web has: those edges are
derived from the projection rather than from thread shells, so they
survive the shell filtering and would have rendered as "Unavailable" —
and, sorting first, could have taken over the banner headline.

Trade-off worth stating plainly: a subagent's transcript becomes
unreachable. The Agents panel added in the previous PR shows what an
agent did and what it returned, but not its full conversation. That is
the intended shape here, and the "Open subagent thread" affordances are
removed on both clients rather than left as dead ends.
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 87cb5bc0ad fix(orchestration-v2): model task stop failures directly
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 6894fe9f6f fix(orchestration-v2): target live subagent sessions
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 9099ca6007 fix(orchestration-v2): stop stamping first-attempt workflow agents as retries
Live testing showed every workflow agent wearing a "retry 2" badge on
its first attempt: the SDK reports attempt 1-based once an agent starts,
and the adapter added 1 on top assuming 0-based. Clamp absent or 0 up
to 1 instead of incrementing.

Found by a computer-use pass against a real workflow run; the replay
fixture's hand-authored attempt: 0 normalizes to the same 1 as before.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam Sharma c62f0ccded feat(orchestration-v2): support stopping a workflow task 2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 75a41ed26e feat(orchestration-v2): capture workflow run handles from the launch ACK
The Workflow tool result is the run's only carrier of its disk handles
(script path, transcript dir, run id) and remote session URL. Attach them
to the coordinator's workflow struct so script view, transcripts, and
resume-command affordances have something to read.

The workflow input on updateClaudeSubagentNode becomes a merged partial:
phases arrive on progress snapshots, the name on task_started, and
handles on the tool result, so no writer may clobber the others.

Workflow tool_uses now skip toolCalls like Agent ones do — the
coordinator subagent row is the run's timeline representation, and
registering the tool call too would double-render it. The launch ACK
consequently routes through the subagent branch, which must not
terminalize the coordinator (only task_notification does).

sessionUrl is scheme-restricted to http(s) at the adapter; the replay
fixture carries a hostile javascript: URL to pin the filter.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam SharmaandClaude Fable 5 3a2622f7ff fix(orchestration-v2): ignore settled subagent noise
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
T3 Code TestandClaude Fable 5 fbb573b62e fix(orchestration-v2): leave zero-activation leftovers unseeded in turn ordinals
The rehydration seed stored Math.max(1, activationCount) in a map that
tracks the last issued ordinal, so a leftover with no recorded
activations started its first turn at ordinal 2 and skipped
childRootNodeId. Skip seeding those entries so the first turn takes
ordinal 1.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:12 +05:30
Shivam Sharma 289c000a57 test(orchestration-v2): register idle reuse replay expectations 2026-08-14 15:04:12 +05:30
Shivam Sharma 53d5009440 test(orchestration-v2): replay subagent reuse after idle 2026-08-14 15:04:12 +05:30
Shivam Sharma 22e15a8423 refactor(orchestration-v2): catch projection errors by tag 2026-08-14 15:04:11 +05:30
Shivam SharmaandClaude dedb92f627 fix(orchestration-v2): harden reused subagent recovery
Co-Authored-By: Claude <[email protected]>
2026-08-14 15:04:11 +05:30
Shivam SharmaandClaude Opus 5 6ece559186 test(orchestration-v2): cover subagent registry rehydration after a restart
A fresh adapter is the post-restart state: the process-local registry is
empty, so a returning native child thread can only be recognised through
the identities the projection hands back in existingSubagents.

Drives a transcript with no spawn frame, seeds one idle subagent, and
asserts the returning thread reuses that identity, continues the
activation count and ordinal rather than restarting them, and keeps the
usage recorded before the restart. Paired with a negative control that
replays the same transcript unseeded.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-08-14 15:04:11 +05:30
Shivam Sharma 61c76c41ba feat(orchestration-v2): attribute reused subagents to the run driving them
A subagent row keeps the run id it was spawned under. Routing admits a
row by run or by parent thread, and the parent thread is excluded by
construction, so a later run re-activating that subagent could only see
its updates while the spawning run's ingestion fiber happened to still be
alive. The Claude adapter already re-attributed on reopen for exactly
this reason; this brings the same treatment to routing and to Codex.

Reuse arrives on item/completed, not item/started: resumeAgent and
sendInput only ever complete, and registerSubagentThreads ignores them
because they are not spawnAgent. Hooking the rebind there is what makes
it fire — subagent_continue now asserts the subagent is attributed to the
run that drove it, where before it stayed pinned to the spawning run.

Routing gains a third test: subagent identity, seeded from the projection
at turn start. The child thread is adopted only while the agent is live,
because a settled row is also re-emitted by trailing traffic — a token
usage frame or a collab state sweep — and adopting on those would hand a
later run an interrupted agent's thread, readmitting the stale events
that post-interrupt recovery exists to exclude.

A subagent's row and its timeline item are emitted together, so both
route by identity; matching only the row advanced the agent while its
item stayed frozen on the spawning run.

The reactivation predicate is separate from canRouteRelatedSubagent
rather than a widening of it, for the same reason: an interrupted agent
must not have its child thread pre-owned, but its identity is still
resumable, because the user stopped it rather than losing it.

Rehydration seeds turn ordinals alongside the registry — restarting them
at 1 would re-derive childRootNodeId for a different native turn — and
parks non-terminal leftovers at idle, since a new session can never
terminalize an activation it did not drive and would otherwise keep the
session pinned open.

Not proven: rehydration itself. The fixture that would exercise it is
recorded but does not replay to completion, for reasons unrelated to
these changes, and is left unregistered with the open question written
up in fixtures/index.ts.
2026-08-14 15:04:11 +05:30
Shivam SharmaandClaude Fable 5 b819de73af fix(orchestration-v2): preserve subagent progress state
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:11 +05:30
T3 Code TestandClaude Fable 5 cdfbb9ac64 fix(orchestration-v2): address subagent observability review findings
- Treat pending/waiting workflow agents as active in the session-registry
  write guard and wake-buffer pre-open, so concurrent active transitions
  are not dropped and wake task_started cannot force a false resume.
- Preserve the first-recorded activation completion time on duplicate
  terminal frames (Claude in-place update and ACP rebuilt emits).
- Let a blocked/waiting first snapshot of a new attempt reopen a settled
  workflow agent entry instead of silently dropping its status and usage.
- Settle still-active workflow members when their coordinator
  terminalizes, and expect the Implementer completed in claude_workflow.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 15:04:11 +05:30
Shivam SharmaandClaude Opus 5 39bc22bb2e test(orchestration-v2): replay a Claude workflow end to end
The adapter's workflow projection was covered in isolation and the panel
derivation was covered against synthetic agents, but nothing drove real
workflow frames through the orchestrator to the projection the client
receives.

Adds a claude_workflow replay fixture: a local_workflow task with two
phases and two members, asserted on the resulting projection. Pins what
the panel groups by — that members claim declared phases, that their
membership points at the coordinator that actually reached the
projection, and that the coordinator's usage still covers its members
so subtracting theirs cannot go negative.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-08-14 15:04:11 +05:30
Shivam Sharma ae3a724dc9 feat(orchestration-v2): populate subagent observability from providers
Fills in the data model added by the previous PR. Every adapter now
reports what its subagents are actually doing: role provenance, token
usage, recent activity, and per-activation records.

Usage needs two merge strategies because providers report it
differently. Codex sends cumulative snapshots per thread, so those merge
by maximum — duplicate and late out-of-order frames then leave the total
unchanged instead of inflating it. Claude reports per activation, so
lifetime usage accumulates only the delta since the previous snapshot.

A subagent identity is reusable, so completing an activation leaves it
at "idle" rather than "completed"; the timeline row for that activation
is still recorded as completed via the status mapping.

A Codex subAgentActivity frame carries no model of its own, so agents
registered from one were recorded with none at all — the common case for
Codex-native subagents, which then showed a role and a token count but
no model. They are recorded against the turn's model selection, which is
what they actually run on.

Three activation-lifecycle fixes in the Claude adapter, found in review:

- A resume that raced past settle was pre-opened by the wake buffer,
  which erased the terminal status the reopen check reads. The resume
  then reused the finished activation instead of starting a new one, so
  its ordinal stopped matching reality and its usage was measured
  against the previous activation's totals — clamping the delta to zero
  and silently dropping the resumed run's tokens. The pre-open now
  records that it happened, and the reopen check honours it.
- A replayed "waiting" frame could resurrect a settled subagent; only
  pending/running were guarded before.
- A duplicate terminal frame re-stamped completedAt, drifting the
  recorded completion time. Codex already preserved it; Claude now
  matches.

Reuse across runs is deliberately not addressed here — a subagent row
still carries the run it was spawned under. That is the next PR.
2026-08-14 15:04:11 +05:30
Shivam Sharma 2feacbf1fc test(mobile): include subagent activations in cached projection 2026-08-14 15:04:11 +05:30
Shivam SharmaandClaude Opus 5 5d008944dd refactor(orchestration-v2): drop the redundant subagent observability backfill
Every observability field the migration backfilled carries a decoding
default equal to the value it wrote, so pre-upgrade rows already read
back correctly without it. The projection schema version bump also
fails startup verification, which deletes and replays those rows from
the event log before anything reads them.

Pin both halves: a contracts test decodes a stored payload missing all
eight fields through the schema the projection actually uses, and the
migration test asserts an existing row survives byte-identical.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-08-14 15:04:11 +05:30
Shivam Sharma cb09929e16 feat(orchestration-v2): add subagent observability data model
Introduces the schema, storage, and migration for richer subagent
tracking. Nothing produces the new data yet — adapters populate neutral
defaults so every subagent row remains valid — which keeps this change
reviewable as a pure data-model step.

Contracts gain a reusable subagent identity: per-activation records
(SubagentActivationId, OrchestrationV2SubagentActivation), cumulative
usage, a role, recent activity, and workflow grouping. A subagent may
now also rest at "idle" between activations.

Because a subagent status is not a turn item status, the two are bridged
by an explicit mapping rather than a copy. The Record type makes that
total: adding a subagent status without giving it a timeline meaning is
a compile error. Without it, a producer can emit a turn item whose own
schema cannot decode it, which is unrecoverable — the projection rebuild
then fails on every subsequent startup and the server cannot boot.

Migration 043 backfills existing rows so old events stay readable. Its
riskiest path is a partially-migrated row, where already-present JSON is
round-tripped through COALESCE; a test pins that structured values keep
their JSON subtype rather than being rewritten as quoted strings.

Also narrows event-envelope attribution in ProviderEventIngestor: a
payload carrying an explicit null run or node id now keeps that null
instead of inheriting the ambient run. Activations legitimately have no
run id, and the envelope is persistence metadata only — routing reads
payload fields — but this does change stored metadata for existing
event types that already pass explicit nulls.
2026-08-14 15:04:11 +05:30
Julius MarmingeandClaude Fable 5 77168d081a fix(web): size the titlebar layout-control icons like the sidebar trigger
The trigger's icon falls through to the Button default (size-4) while the
right cluster hard-coded size-3.5, so the two ends of the titlebar read a
pixel apart on every edge. All five layout-control icons now use size-4,
matching the trigger and the pull requests page's refresh icon.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:24:06 +02:00
Julius MarmingeandClaude Fable 5 f6601420ad fix(web): align titlebar clusters to one shared pixel inset
The right controls carry mr-px (main's border compensation for anchoring
inside the panel frame), which left the sidebar trigger one pixel closer
to its edge and the sheet-mode tab bar one pixel tighter than the closed
state. Mirror the pixel on the trigger and the sheet layout-controls slot
so all three read the same inset.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:24:06 +02:00
Julius MarmingeandClaude Fable 5 a29fd51629 fix(web): keep the titlebar layout controls fixed across right-panel toggles
Restores main's one-inset rule (#5226) that a rebase resolution had
overridden with a conditional right-2 offset, which made the controls jump
sideways whenever the right panel opened. Also restores the live-agent
count badge on the right-panel toggle (#5745) that the round-6 replay
dropped, and applies the same fixed-position rule to the pull requests
page: the toggle now stays mounted at one absolute inset in both states,
with a footprint spacer in the list header so the refresh button never
slides underneath it.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:24:06 +02:00
Julius MarmingeandClaude Fable 5 d6e8dd8161 fix: reconcile main's round-6 features after the rebase
- ChatView: #5880 auto-settle-on-merge setting flows into effectiveSettled,
  #5644 browser favicon project registration effect, activeProjectRef memo,
  desktopByTabId on both RightPanelTabs mounts
- server: provide ServerSecretStore to the McpSessionRegistry's
  ServerEnvironment layer (#6325 reads publish opt-in per descriptor)
- mobile: 3-way merged main's deltas into the v2 thread screens
  (NewTaskDraftScreen keeps the branch title seed + main's environmentId,
  threadListV2 keeps both new test suites, queries imports deduped)

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:51 +02:00
Julius Marminge 8dcbdcac52 feat(contracts): track thread title regeneration
- Add optional title regeneration request and start time to thread shells
- Cover cache serialization on mobile and client runtime
2026-08-14 11:23:51 +02:00
Julius Marminge 402fde73dd feat(orchestration): bound thread history and resume payloads
- Add paginated thread history with bounded snapshots and replay limits
- Trim oversized wire payloads and support progressive mobile history loading
2026-08-14 11:23:51 +02:00
Julius MarmingeandClaude Fable 5 c03c9926ad fix(web): restore main's collapse chrome and tab-status keying on the PR panel
The round-5 ChatView reconciliation kept the round-3-era PullRequestDetailPanel
call, so the panel mounted without chromeVariant="collapse" — the #6039
scroll-condensing chrome never engaged and the description scrolled under a
full-height chrome. Restore main's call exactly: collapse chrome,
composerDraftTarget for same-thread hand-offs, the isThreadOwnPullRequest
context check, and tab statuses keyed by the active surface id via
updatePullRequestTabStatus instead of a key rebuilt from the status payload.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:51 +02:00
Julius Marminge 97c97cec2b feat(web): prioritize pull request row actions
- Add conflict, draft, failing-check, and merge action ranking
- Show check progress and pull request details in row tooltips
2026-08-14 11:23:51 +02:00
Julius MarmingeandClaude Fable 5 1a1bb645bb fix(web): reconcile main's round-5 features after the rebase
- PullRequestDetailPanel takes main's #6039 rework wholesale (reactions,
  update-branch, auto-merge, in-place editing); the thread-details action
  hooks stay in usePullRequestActions with label maps extended for the
  new action variants
- CommandPalette #6330 provider subtitles adapted to the v2 shell
  (session -> runtime for provider instance and display name)

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:51 +02:00
Julius MarmingeandClaude Fable 5 d0b6cbdec8 fix(mobile): port main's composer stabilization into the v2 thread screens
Round-4 reconciliation of #5986/#5988 with the v2 cutover files:
- PendingUserInputCard adopts main's collapsible overlay redesign with the
  v2 RuntimeRequestId/responseCapability plumbing (dead provider processes
  still read-only the card)
- ThreadFeed adopts the thread-feed-live-follow transition model, the
  user-scroll settle window, momentum handoff, and env-scoped feed keys
  while keeping the v2 nearListEnd layout gating
- ThreadDetailScreen hides (not unmounts) the composer while a user-input
  request owns the slot; multi-select answers flow as arrays end to end
  (threadActivity toggle/build helpers + tests, ThreadUserInputQuestion)
- ThreadComposer keeps the v2 canStopThread stop gate under main's
  onEditorFocusChange rename; standalone stop reuses the shared renderer
- Restored the branch's steer stop/send tests alongside main's composer
  test suite

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:51 +02:00
Julius Marminge 5f3ccad35c feat(web): add pull request actions to thread details
- Add ready, merge, and conflict-resolution actions to the PR row
- Share pull request action and handoff logic with the detail panel
- Fix thread details scrolling and row alignment
2026-08-14 11:23:51 +02:00
Julius MarmingeandClaude Fable 5 c4b043dc86 fix(web): restore the branch's slim chat header
The round-3 reconciliation took main's ChatHeader wholesale and wired its
full prop set, resurrecting the scripts/open-in/git-actions cluster the
branch had deliberately relocated into the thread panel. Restore the
79-line slim header (project favicon + name + thread title) and its
minimal ChatView call. #5592's header actions stay a documented v2
follow-up, as decided in round 2.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:51 +02:00
Julius MarmingeandClaude Fable 5 c6e3aeb591 test(server): expect attachment saved-at lines in ClaudeAdapterV2 turn text
Follow-up to the #5757 port: start and steer turns now append the
'[Attached ... is saved at: path]' line, so the adapter fixtures assert it.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:51 +02:00
Julius MarmingeandClaude Fable 5 8b747dd4f9 test(web): restore main's right-panel migration expectations after the panel-visibility merge
The keep-both merge nested main's plan-surface migration test inside a
branch popover test and dropped the threadPanelVisibilityByThreadKey key
from the migration results. Restore main's test body and include the
branch's (empty) visibility map in the expected persisted shape.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:51 +02:00
Julius MarmingeandClaude Fable 5 2ce54b3885 fix(server): port round-3 main fixes into the v2 orchestrator
- a6c9b41f90 (agents open pasted images): ClaudeAdapterV2 now grants the
  attachments dir alongside cwd via additionalDirectories and appends
  '[Attached ... is saved at: path]' lines to the turn text so tools can
  dereference pasted images (pixels alone are not tool-readable).
- 5bb8c03664 (settle leaves monitors running): thread.settle now joins
  archive/delete in the provider-session detach set, so PR monitors, dev
  servers and subagent fleets stop when the user parks the thread. The
  settle guard already rejects active runs, and serialized dispatch closes
  the re-engage race the v1 fix handled with onlyIfSettled.
- e70cdb478d (Claude resume handshakes) and 2c7267ad43 (reaper vs live
  background subagents) are already covered structurally in v2: results
  are turn-scoped with explicit zero-turn handshake drops, and idle
  release is pinned while background work is pending.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:51 +02:00
Julius MarmingeandClaude Fable 5 434673d803 chore(server): renumber v2 migrations 038-046 to 041-049 after main's 038-040
Main released ProjectionThreadsPinOrderKey (038),
ProjectionProjectsDefaultThreadEnvMode (039) and
ProjectionProjectFaviconPath (040), so the branch-private v2 stack shifts
up by three. Registry ids were already 41-49; this renames the files and
identifiers to match and updates the ledger expectations and through-id
boundaries in the migration tests (released boundary 37 -> 40).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:51 +02:00
Julius MarmingeandClaude Fable 5 d256570669 fix: repair rerere-damaged files and reconcile main's round-3 features with v2
Post-rebase reconciliation sweep:
- Sidebar: main's folded Sidebar.tsx/Sidebar.logic.ts adapted to v2 shells
  (latestRun/runtime naming, waiting status instead of monitoring), with
  subagent-thread filtering and main's pinned-reorder helpers re-exported
- Pinned drag reorder (#5581) ported into v2: thread.pin orderKey +
  thread.pin.reorder command, thread.pin-reordered event, Orchestrator fold,
  ProjectionStore/Maintenance, client-runtime commands and shell mapping
- Project favicon (#4849-era) and defaultThreadEnvMode flowed through v2
  contracts (OrchestrationProjectShell, application event payloads)
- ChatView: main's #5592 header props, pull-request right-panel surfaces,
  liveAgentCount badge (#5745) wired into the v2 panel layout
- enableAssistantStreaming -> enableLegacyTokenStreaming rename applied to
  v2 RunExecutionService and replay testkit
- Removed v1 zombies resurrected by the rebase (provider service/reaper/
  ingestion + v1 layer tests, server.test.ts, integration harness)
- routeTree: main's tree + branch's /settings/scheduled-tasks route
- Misc marker-sweep syntax repairs (rpc.ts, entities.ts, localApi.test.ts,
  rightPanelStore.test.ts, GitManager.test.ts, mobile model menu helpers)

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:51 +02:00
Julius Marminge 931cc7c440 fix(web): show Git action success inline in panel
- Keep success feedback visible in the Git action control for 10 seconds
- Move the running elapsed timer into the panel menu slot
2026-08-14 11:23:33 +02:00
Julius MarmingeandClaude Fable 5 c178154106 fix(web): let LegendList own end-follow and disclosure anchoring (#5449)
Complete the #5449 architecture on the v2 timeline, following the
LegendList author's direction to lean on the list's native mechanisms
instead of app-side scroll layers:

- maintainScrollAtEnd is enabled and owned by LegendList, gated off only
  while the user reads history (liveFollowEnabled), while a sent turn
  anchors near the top (anchoredEndSpace), or during the two-frame settle
  of a fold toggle.
- maintainVisibleContentPosition compensates size changes natively
  ({data, size, shouldRestorePosition}); fold toggles anchor compensation
  to the toggled row via a disclosure anchor key, so the trigger stays
  under the pointer instead of the viewport chasing the end.
- ChatView's hand-rolled streaming follow (double-rAF scrollToEnd on
  every data change) is gone; the app now only owns streaming
  adjustments during anchored-end-space mode, mirroring main.
- timelineLiveFollowEnabled state mirrors the follow refs so the
  render-visible gate switches native follow off when a gesture breaks
  follow and back on when the viewport returns to the end band.

Timeline tests updated to assert the native-ownership invariants.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:33 +02:00
Julius MarmingeandClaude Fable 5 66d820ed32 fix(web): port the refined live-follow gesture gating to the v2 timeline
The rebase kept the LegendList 3.3.3 upgrade and patch from #5449 and the
mobile end-follow latch from #5566, but the v2 MessagesTimeline/ChatView
still carried the branch's blunt any-gesture-breaks-follow listeners.
Port main's #5566 web mechanics onto the v2 follow architecture:

- resolveTimelineIsAtEnd measures the 40px follow re-arm band from real
  geometry (contentLength/scroll/scrollLength minus the composer inset),
  keeping the isNearEnd fallback for older state shapes.
- Follow now breaks only on gestures that can actually leave the live
  edge: upward wheel with overflowing content, touch drags that exited
  the end band, scrollbar drags vs content clicks, and keyboard
  navigation (PageUp/Home/ArrowUp) — previously keyboard scrolling never
  broke follow and the next stream chunk yanked the view back down.
- Listener attach retries across frames so a thread switch cannot mount
  the list without its opt-out listeners.

Deliberately not ported: #5449's shouldRestorePosition disclosure
anchoring and follow-gated maintainScrollAtEnd — the v2 timeline keeps
maintainScrollAtEnd={false} with its own follow scrolls and anchor
system; flipping that core is a separate change.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:33 +02:00
Julius MarmingeandClaude Fable 5 0074bf0ad7 chore(web): prune plan-sidebar leftovers after the inline-plans rework
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:33 +02:00
Julius MarmingeandClaude Fable 5 afdde33c68 fix: port main fixes stranded by the v2 rewrite (round 2)
Native subagent observability (#5219), wired per its spec's v2 merge plan:
- getWorkflowScript RPC re-homed onto the v2 WS surface (contracts, rpc
  group, ws handler, auth scope, client atom).
- AgentsPanel fed by the spec's mapper swap: projectedSubagentsToRuntime
  maps orchestration-v2 subagent entities into the panel model;
  deriveAgentPanelModel's v2Projection leg is now live and the v1 fold
  never runs. Agents surface wired into ChatView + RightPanelTabs.
Other ports and reconciliations:
- Shell reconnect-loop fix (#5561) ported into the v2 shell sync
  (same-session resubscribes resume from the in-memory cursor), with the
  cursor-resume regression test adapted to v2 fixtures.
- Mobile end-follow latch (#5566) ported onto the v2 ThreadFeed.
- Claude ede_diagnostic interrupt classification (#5557) ported into
  ClaudeAdapterV2 (aborted_tools/aborted_streaming => interrupted; CLI
  telemetry never becomes the failure banner). #5559 needs no v2 port
  (unknown system subtypes are already ignored).
- Plan sidebar removed from the v2 ChatView/ChatComposer per main's
  plans-fold-into-chat rework (#5558); rightPanelStore stays at main's
  surface set.
- SettingsPanels rebuilt as main's refactored version plus the branch's
  composer-context setting; sidebar snooze respects the time format
  (#4438 follow-through).
- v1-only leftovers deleted: zombie v1 adapters/ingestion/tests the v2
  rewrite removes, the v1-bound transfer-budget CI harness (#5350, needs
  a v2 rebuild), and main's v1 client pagination machinery (#5493 client
  side; the 037 keyset migration is kept — server-side v2 windowing is a
  follow-up).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:33 +02:00
Julius MarmingeandClaude Fable 5 f917cddd58 fix(server): renumber v2 migrations after main's 037_ProjectionTurnsKeysetIndex
Main owns migration numbering: 037_ProjectionTurnsKeysetIndex landed on
main (#5493), so the v2 migrations shift from 037-045 to 038-046.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:33 +02:00
Julius MarmingeandClaude Fable 5 c8916f3189 fix: repair conflict-marker artifacts from rebase auto-resolutions
rerere replayed stale resolutions during the rebase and committed nested
conflict markers in several files. Restore the branch-intended v2 shapes
and re-graft main's compatible additions (pending-card opacity comments,
theme-editor keybinding test, mobile scroll re-arm effects from #5566).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:32 +02:00
Julius Marminge a394fe4f0b fix(web): align git action progress button layout
- Match progress button spacing and single-line height to static git actions
2026-08-14 11:23:32 +02:00
Mike Olson 4f633dacec feat(orchestrator): Surface waiting background work (#4378) 2026-08-14 11:23:32 +02:00
Julius MarmingeandClaude Fable 5 35e4a7f429 test(server): align migration expectations with renumbered ids
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:32 +02:00
Julius MarmingeandClaude Fable 5 01a1dec618 fix: port main fixes stranded by the v2 rewrite
- Port thread pinning (#5312) into the orchestration-v2 command pipeline:
  thread.pin/unpin commands, thread.pinned/unpinned events, pinnedAt on the
  v2 thread state and projected shells, promotion semantics (pin clears
  settle/snooze, settle clears pin) matching the v1 decider, and client
  pin/unpin operations in the v2 dispatch style.
- Port the regenerated-title context anchoring (#5365) into
  ThreadTitleRegenerationService: pin the first user message ahead of the
  retained tail when the digest is truncated.
- Re-apply the right-panel controls positioning from #5260 to the v2
  ChatView title bar controls.
- Repair merge artifacts: committed conflict markers in BranchToolbar,
  duplicate capability keys, duplicate CommandPalette import, v1 turn
  naming in DiffPanel's focus-refresh effect, onSend signature merge.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:32 +02:00
Julius MarmingeandClaude Fable 5 d7e5a004f5 fix(server): renumber v2 migrations after main's 036_ProjectionThreadsPinned
Main owns migration numbering: 036_ProjectionThreadsPinned landed on main,
so the v2 migrations shift from 036-044 to 037-045. Release path runs all
of main's migrations first, then the v2 stack.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:32 +02:00
Julius Marminge a8e09e493e fix(web): remove open PR actions from git controls
- Keep the git action control disabled when the branch is up to date
- Omit open PR menu entries and remove their link-opening behavior
- Update logic tests for the new states
2026-08-14 11:23:32 +02:00
Julius MarmingeandClaude Fable 5 8efd4d2253 fix(server): stop tying codex text-generation temp files to the caller's scope (#5406)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-14 11:23:32 +02:00
Mike Olson 1c31861521 fix(orchestrator): Prevent redundant delegated completion turns (#5311) 2026-08-14 11:23:32 +02:00
Julius MarmingeandClaude Fable 5 14a0d9a84c fix(test): keep codex replay recovery off the repo checkout
The codex resume test was the only replay scenario without a
runtimePolicyOverride, so its checkpoint scope cwd fell back to
process.cwd() and baseline capture ran real git over the entire
checkout. Locally the capture short-circuits on checkpoint refs left
behind by earlier runs; on a fresh CI checkout it is a cold multi-second
capture that outlives the scenario wait budget, failing await_thread_idle
while the run is still mid-checkpoint. Point the fixture's turn/start
frames at the <workspace> placeholder and checkpoint a throwaway git
workspace like every other replay test.

Scenario waits are also wall-clock-bounded now: the iteration budget
counts event-loop turns, which burn at full speed while git/fixture IO
is in flight, so exhaustion additionally requires a 60s real-time
deadline to pass.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:32 +02:00
Julius MarmingeandClaude Fable 5 bb23ddfa90 chore: resolve lint warnings across v2 code
Hoist inline Schema compiles to module scope, drop unused
imports/vars, stabilize react-markdown component identities via a
module-scope factory, remove useless spreads, and use data-derived
keys for release-note bullets. No behavior changes.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:32 +02:00
Julius MarmingeandClaude Fable 5 94b7d5f7e1 test(server): cover v2 thread title regeneration
Ports the deleted v1 ProviderCommandReactor title coverage onto the v2
service: marker arming/clearing via thread.metadata.update, superseded
requestId no-ops, digest-driven regeneration, the "New thread" and
unchanged-title fallbacks, generation failure, and missing initial
messages, plus unit tests for formatThreadTitleContext.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:32 +02:00
Julius MarmingeandClaude Fable 5 4ff868a3bb fix(web): restore compact header sizing for project script controls
The thread-panel mapping change replaced the compact className on the
Run and Add controls with the isPanel conditional and dropped the
non-panel icon-compact classes that the responsive test asserts.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:32 +02:00
Julius MarmingeandClaude Fable 5 467ff768d2 fix: send mcp-protocol-version header in worktree registration test
Required for follow-up requests by the 2025-06-18 MCP HTTP transport
that effect beta.103 enforces.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:32 +02:00
Julius MarmingeandClaude Fable 5 f4e9b3d5e4 fix: adopt effect beta.103 APIs in rebased v2 code
- Schema.UnknownFromJsonString -> Schema.fromJsonString(Schema.Unknown)
- SchemaIssue.InvalidValue single-argument form in checkpointDiff
- McpServerClient requires protocolVersion

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:32 +02:00
maria 4171e77b74 feat(chat): refine V2 conversation UI (#5307) 2026-08-14 11:23:32 +02:00
Julius MarmingeandClaude Fable 5 429a22ac6e fix(server): restore worktree branch naming in the v2 orchestrator (#5309)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-14 11:23:31 +02:00
Mike Olson d8257507a8 fix(orchestrator): Order thread lineage by creation time (#5310) 2026-08-14 11:23:31 +02:00
Yusuf Rawat f682f0a6e6 fix(orchestration-v2): restore generated thread titles (#5176) 2026-08-14 11:23:31 +02:00
maria-rcks 1ad2d3b2a4 fix: reconcile rebase with latest main 2026-08-14 11:23:31 +02:00
Julius Marminge 1e3732d1c6 fix(web): keep Git progress title anchored
- Prevent the title row from shifting when output is revealed
- Preserve panel and compact button sizing
2026-08-14 11:23:31 +02:00
Julius Marminge 9f23e4888c fix(web): remove elevated thread details panel styling 2026-08-14 11:23:31 +02:00
Julius MarmingeandClaude Fable 5 39929faaee refactor(orchestration): split thread-not-sendable into typed errors
Effect service conventions: ThreadManagementThreadNotSendableError
carried an Archived/NoSteerableRun reason union and switched on
reason._tag inside the message getter. Modelled as two error classes
(ThreadManagementThreadArchivedError, ThreadManagementNoSteerableRunError);
both still map to the MCP thread_not_sendable failure code.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:31 +02:00
Julius MarmingeandClaude Fable 5 e6b3d3d3ed fix(orchestration): promoted queued messages keep the queued_turn intent
The turn item materialized when a queued run is promoted was emitted
with inputIntent "turn_start", but the deterministic replay driver (and
the recorded queued_turn fixtures) expect "queued_turn" — the mismatch
stalled replay before the queued run could start, leaving run 1 waiting
and run 2 queued forever in all five queued_turn fixtures.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:31 +02:00
Yusuf Rawat 82616a1b7a fix(orchestration): thread visits no longer create activity loops (#5038) 2026-08-14 11:23:31 +02:00
Julius MarmingeandClaude Fable 5 096bbcfc22 feat(orchestration): port thread title regeneration to the v2 runtime
Follow-ups from the main merge:

- Migration numbering: main's 035_ProjectionThreadTitleRegeneration is
  released and keeps its id; this branch's unreleased v2 migrations shift
  to 036-044 instead (a released migration can never be renumbered).
- thread.metadata.update accepts regenerateTitle: true arms an in-flight
  titleRegeneration marker on the thread payload (requestId + startedAt),
  a landing title or explicit false clears it. The marker projects onto
  thread shells and through the client-runtime shell model, so the
  sidebar's Regenerating state works unchanged.
- New ThreadTitleRegenerationService worker reacts to armed markers on
  the live domain-event stream (so ws, MCP, and mobile dispatches all
  behave the same): builds a newest-first conversation digest from the
  v2 projection (8k-char budget, retained attachments — ported from the
  v1 reactor), generates via TextGeneration, and lands the title with a
  follow-up metadata update. Failures clear the marker and log.
- The server advertises threadTitleRegeneration again, and the client
  updateThreadMetadata dispatches regenerateTitle-only updates.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:31 +02:00
Julius MarmingeandClaude Fable 5 d68948d67c perf(web): keep timeline minimap animations off the main thread
A renderer performance trace showed the minimap strips as a standing
source of main-thread frame work: each strip transitioned
background-color (paint) and width (layout), and both fire constantly —
scrolling or streaming flips a band of in-view states at once, and the
hover fisheye animates several widths at a time — so any interaction
kept a 60fps style/layout/paint pipeline running.

The strip now animates only compositor-friendly properties: width tiers
are scale-x on a fixed-width box, and the in-view highlight is a bright
overlay faded with opacity. The scroll handler also skips no-op
data-in-view attribute writes, which previously re-dirtied style state
for every strip on every scroll tick.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:31 +02:00
Julius MarmingeandClaude Fable 5 54ceb2a111 fix(relay): stop replaying the whole event store into the awareness relay
Live profiling of the built app (debugger pause inside the hot sqlite
call) showed AgentAwarenessRelay.publishThread grinding at ~8 full shell
snapshots per second after boot. Two causes:

- streamDomainEvents was eventSink.stream() with no cursor, which
  replays every stored event from genesis before going live — so each
  boot fed the relay the entire event history as fresh activity, and it
  queued a publish per activity-relevant event for hours. It now tails
  from the current high-water mark; the relay's startup snapshot publish
  already covers initial state, and the sink subscribes before reading
  the cursor so no live event is lost.
- publishThreadUnsafe materialized the full shell snapshot to find one
  thread; it now uses getThreadShell (archived/deleted map to the
  tombstone path exactly as the active-list lookup did).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 11:23:31 +02:00
Julius Marminge 86e57c3a7c fix(chat): prevent stale timeline scroll and rerenders
- Disable LegendList end-maintenance that could snap after user scrolling
- Cancel stale imperative scrolls and release settled turn anchors
- Stabilize handoff run data to avoid per-event timeline rerenders
2026-08-14 11:23:30 +02:00
Julius MarmingeandClaude Fable 5 38f272829c perf(orchestration): per-thread shell deltas, visit throttling, event compaction (#4971)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex ec4c3f0171 [codex] feat(web): show git progress in the commit button (#4963)
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marminge 4124948442 feat(orchestration): track provider retries and thread visits
- Project retry progress and recovery for Codex and Claude turns
- Sync thread completion markers through server-side visit timestamps
2026-08-14 11:23:30 +02:00
Julius Marminge 918e4155dd feat(server): surface legacy thread migration progress
- Publish migration lifecycle events during startup
- Show a web toast while legacy threads are restored
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex b63287a18b fix: close failed provider adapter scopes
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex a7db564861 fix: preserve thread management failure semantics
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex 28142a7862 fix: address latest orchestration review findings
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex 761042383f fix: preserve orchestration task identity
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex 0bba720192 fix: address orchestration review findings
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex b1ce962b44 fix(mobile): label queued message intent
Distinguish queued and steering user messages in the mobile thread feed, matching the web timeline.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex c25c1be21f fix: address orchestration review findings
Use shared cache schemas, close the OpenCode abort race, and assert fixture collection sizes correctly.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex 4414baf371 fix(orchestrator): preserve migrated and nested history
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex 48346a72ab fix(server): preserve project mutation client errors
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex 477d4c46f0 fix(orchestrator): validate rollback and search links
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex 371b40e014 fix(orchestrator): close cancellation edge cases
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex 5ad2e8af28 fix(orchestrator): decode direct Claude result blocks
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex c6079f6b5d fix(orchestrator): validate replay edge cases
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:30 +02:00
Julius Marmingeandcodex b2d23ccabb fix(orchestrator): preserve terminal effect outcomes
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex 8db6d9d7b3 fix(orchestrator): preserve retryable effect failures
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex ccb3e269ec fix(orchestrator): avoid replaying settled effects
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex 5e711d3b10 fix(worktrees): make handoff rollback atomic
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex 4c999d746c fix(orchestrator): release stranded effect claims
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex bbfed6c19e fix(orchestrator): execute resolved runtime responses
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex ee6ff5574d fix(orchestrator): harden provider edge cases
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex 2cd862d392 fix(orchestrator): handle fresh review edge cases
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex ba8b661995 fix(orchestrator): address late review findings
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex 0027aa1081 fix(mobile): gate thread controls on live runs
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex 4626a059d9 fix(checkpoints): retain thread-start baseline after failed runs
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex c4f3a78407 fix(client): preserve live thread relationships
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex c90070acc9 fix(web): enforce secure provider field defaults
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex 5134929999 fix(claude): preserve explicit model options
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex 5552ab5fc4 fix(server): isolate deterministic attachment ids
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex b5a13f386a fix(testkit): harden provider replay recording
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex ea9d12b5d8 fix(acp): enforce task and permission invariants
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:29 +02:00
Julius Marmingeandcodex 799146af31 fix(orchestration): preserve imported conversation state
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 3752cb5f4b fix(checkpoints): preserve valid run history
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 8d7afca437 fix(acp): discover final teardown descendants
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 5f7840b92f fix(cursor): log close attempts before execution
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 29f716986b fix(mobile): distinguish queued and waiting archive states
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 1d3d6f4635 fix(mobile): allow archiving post-provider work
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 91c833c548 fix(orchestration): cancel queued work on archive
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 29075a81c0 fix(orchestration): handle checkpoint-wait runs
Allow merge-back from provider-finished runs awaiting checkpoint capture while keeping waiting runs visible but non-interruptible in mobile.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex ff31b55cc9 fix(acp): make xai cancellation reliable
Cancel pending prompt completions without restarting ACP, and keep text-only monitor acknowledgements tracked as background work.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 7219dbfea7 fix(contracts): reject invalid legacy intervals
Keep positive sub-minute schedules readable without accepting corrupt zero or negative persisted intervals.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex c30c681c1f fix(orchestration): preserve legacy schedule compatibility
Enforce the one-minute floor only on writes, clamp legacy execution intervals, and keep queued work protected from archive while reusing shared active-run derivation.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex ffe2daac90 fix(mobile): preserve active thread state
Keep executing runs visible when newer work is queued, expose provider errors in compact shells, and preserve mobile creation metadata for fork and merge operations.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 4b5e817866 fix(orchestration): harden scheduled task startup
Reject scheduled task intervals below one minute and tear down the effect worker when awareness relay startup fails.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 955fe1c630 fix(orchestrator): schedule effects from durable deadlines (#4656)
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 685fe6c6de feat: migrate v1 state into orchestrator v2 (#4400)
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 377b8f2287 chore(orchestrator): refresh checks after main sync
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Julius Marmingeandcodex 3218e5f30b fix(web): restore checked-in project scripts
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Yusuf007Randcodex a722960f8f fix: ignore subagents when sorting sidebar projects
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Yusuf007Randcodex 94eb4ce02f fix: hide subagent threads from v2 lists
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:28 +02:00
Mike Olsonandcodex 03366d5830 fix(claude): Settle positive task-notification results
A Claude V2 turn whose terminal SDK result carried origin.kind
"task-notification" had that result discarded, so the run stayed running
forever and every run queued behind it stalled. The drop is now limited to
results reporting zero model turns, which is what the stale debris the guard
was written for actually looks like.

ClaudeAdapterV2 dropped any task-notification-origin result unless the turn was
an agent/provider continuation. An app-owned delegated-task wake run is
agent/server, so its terminal results were discarded and finalizeActiveTurn
never ran. Any turn whose final result carries that origin hangs, not just
wakes. Observed in production against a real session: three terminal success
results with num_turns 154, 60 and 7 were all dropped, the session went silent
for 8h27m, and five queued runs behind it never dispatched.

The guard could not simply be deleted. After interrupt recovery a stale stopped
task_notification and its origin result interleave ahead of the real root
assistant stream and must not terminalize the turn or leak their text.
Zero-turn results are still dropped, so that path is unchanged: this drops
strictly fewer results than before, so no previously working path can regress.

num_turns separates the two cases cleanly. The existing stale fixture sets
numTurns 0 explicitly, makeResultFrame defaults to 1, and the production
results all carried positive turns. The predicate is num_turns === 0 rather
than < 1 or a truthiness check on purpose: num_turns is required on both result
variants in 0.3.205, but if an older emitter ever omitted it, undefined === 0
is false, so the result is accepted rather than dropped. That fails toward
terminalizing rather than toward the hang class this fixes.

Both drops and accepts are logged with num_turns, stop_reason, terminal_reason,
result uuid, session id and message provenance. The drop is debug level because
interrupt recovery produces it routinely; the accept is info, because a
positive-turn task-notification result settling a non-continuation turn is both
the hang fix working and the exact shape a stale positive-turn result would
take.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:27 +02:00
Mike Olsonandcodex 686806f72a fix(orchestrator): Wake settled parents when delegated children finish
An app-owned delegated child wrote its result into the parent projection but
never started a parent run, so an async delegation's result sat unread until the
user's next message. Offer a provider continuation request when a delegated
child terminalizes, with a per-task completionWake policy separating async
delegations from blocking waits.

The wake must also reach the model. ProviderContinuationRequests is a
provider-native mechanism whose dispatch only triggers ingestion of output the
adapter already buffered, and both ClaudeAdapterV2 and AcpAdapterV2 discard the
message text when it is marked creationSource provider. An app-owned child
buffers nothing, so a wake marked that way settled instantly having prompted
nothing. App-owned wakes now dispatch as message_text via a shared
delegatedTaskWakeRequest helper used by both producers.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:27 +02:00
Mike Olson a4d4a2d7c0 fix(acp): Preserve wake evidence across an app-owned wake
This PR introduces the only wakeBuffer clear at the ACP startTurn site, and it
also clears midTurnUnreportedCompletedTaskIds there, both on the reasoning that
a user turn owns the conversation.

An orchestrator-injected wake is not a user turn. #4499
fix/delegated-task-parent-wake dispatches app-owned delegated-child wakes as
creationSource "server", which is non-continuation, so once both land such a
wake would discard this session's pending native wake frames and its kept
mid-turn completion marks, losing agent output and a continuation offer that
nothing else can recover.

acpIsAppOwnedWakeTurn exempts orchestrator-injected wakes from both clears,
matching what ClaudeAdapterV2 already does with its own buffer. Inert without
#4499, since nothing else dispatches creationSource "server". Kept as its own
commit because the concern originates in a different PR.
2026-08-14 11:23:27 +02:00
Mike Olson ceaa4ede4f fix(grok): Prevent spurious wake run after in-turn monitors
- Defer continuation offers for background completions that land while a
  root turn is active and un-finalized; finalize offers exactly one wake
  only when unhandled completed work remains
- Stop late monitor-event mutations from erasing in-turn handled marks, so
  injected-turn ack chatter is never retained as wake evidence
- Clear stale wake buffer frames at non-continuation user-turn start
- Make the late-mutation suppress logic's running/terminal branches
  mutually exclusive
2026-08-14 11:23:27 +02:00
Julius Marmingeandcodex 111029e383 test(orchestrator): align merged V2 compatibility checks
Remove the unreferenced V1 activity payload projection that arrived from main and assert only the public serialized SchemaError shape under Effect beta.102.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:27 +02:00
Julius Marmingeandcodex 53e89fb4c6 fix(server): clean up Claude replay failures
Wake replay stream waiters when outbound validation fails and ensure interrupted recordings close when no tool use arrives.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:27 +02:00
Julius Marmingeandcodex 1d7aed4354 fix(server): enforce ACP auth and preserve fork provenance
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:27 +02:00
Julius Marmingeandcodex 64d2faccc7 fix(server): keep derived threads awake
Reset snooze metadata when creating forks and provider subagent children, with focused regressions for both inheritance paths.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:27 +02:00
Julius Marmingeandcodex 0830883749 fix(mobile): wait for fork shell before navigation
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:27 +02:00
David Whatleyandcodex 4f26e751c7 Add worktree handoff and status tools to the t3-code MCP server (#3754)
Expose MCP tools for worktree handoff and status inspection, with focused server and contract coverage.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:27 +02:00
Alexandcodex f59a5a4416 feat(subagents): disclose projected results consistently (#3866)
Normalize subagent result disclosure across timeline rendering and collapsed/expanded states.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:27 +02:00
Mike Olson c567b83aa9 fix(orchestrator): hydrate shell cache and group multi-environment projects (#3640)
Restore versioned shell-cache hydration, reconcile repository enrichment across multiple environments, and decode non-null settled shell timestamps correctly.
2026-08-14 11:23:27 +02:00
Julius Marminge 24ddaf5694 test(orchestrator): align Codex approval reviewer replays (#4457)
Update every deterministic Codex turn/start expectation with the explicit user approvals reviewer emitted by the adapter, restoring exact replay coverage and unblocking the merge lane.
2026-08-14 11:23:27 +02:00
Mike Olson 7a26bfc75e fix(orchestrator): Preserve claude/codex post-interrupt recovery state (#4229) 2026-08-14 11:23:27 +02:00
Mike Olson 0ab943a5fb test(orchestrator): Align post-merge CTM fixtures (#4193) 2026-08-14 11:23:27 +02:00
Julius Marmingeandcodex f789188c7b fix(web): contain thread details panel effects
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Julius Marmingeandcodex d90cba6656 refactor(web): use shared glass surfaces
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Julius Marmingeandcodex 0bec96fce7 fix(web): remove stacked composer shadows
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Julius Marmingeandcodex 165ce66c97 fix(web): restore v2 composer chrome
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Julius Marmingeandcodex b75aa98050 fix(server): preserve released migration ordering
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Julius Marmingeandcodex daddf826fd fix(orchestration): clarify agent delegation and scheduling
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Julius Marminge c8a8c421b2 Unify T3 MCP tool presentation across clients
- Extract shared T3 MCP tool label resolution
- Show T3 Code branding for matched tool activity rows
- Add tests for shared resolution and mobile feed output
2026-08-14 11:23:26 +02:00
Julius Marminge 606b9086a7 Render T3 MCP tools with branded timeline labels
- Pretty-print known T3 MCP tool names in work rows
- Show the T3 Code logo for recognized MCP tool entries
- Add logic and UI tests for the new tool presentation
2026-08-14 11:23:26 +02:00
Julius Marmingeandcodex 41a16d958a fix(grok): align ACP extensions with open source runtime
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Julius Marmingeandcodex 32b749d07e fix(mobile): support Hermes collection sorting
Reuses the focused compatibility approach from closed PR #3923 and covers the remaining hardware-keyboard reverse iteration.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Julius Marmingeandcodex 9c65560b35 test(orchestrator): align integration fixtures
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Mike Olson 97474423c7 fix(orchestrator): Harden Grok v2 runtime lifecycle
Settle root turns from provider signals and preserve post-settle continuations.

Track asynchronous subagent and monitor work, allow image prompts, and keep steered messages visible.

Separate soft steering from hard Stop while containing and reaping native process trees.
2026-08-14 11:23:26 +02:00
Julius Marmingeandcodex d584feccda fix(orchestrator): dedupe Grok continuation dispatch
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Mike Olsonandcodex 8ccb33f755 fix(orchestrator): harden Grok v2 lifecycle (#3578)
Integrate the current Grok settlement, monitor/subagent lifecycle, interrupt containment, steer visibility, and image support stack into the orchestration-v2 branch.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Julius Marmingeandcodex 1519070601 fix(acp): bind MCP credentials to activated threads
Passes the current target thread MCP configuration through ACP load, resume, and fork requests instead of reusing the credentials captured when the provider process opened.

Addresses https://github.com/pingdotgg/t3code/pull/2829#discussion_r3507807130

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:26 +02:00
Julius Marmingeandcodex b13febf528 fix(acp): release turns after interrupt timeout
Clears the timed-out turn with an identity guard so a late completion cannot clobber a newer active turn.

Addresses https://github.com/pingdotgg/t3code/pull/2829#discussion_r3483533894

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:25 +02:00
Julius Marmingeandcodex 4d7d87c3d9 fix(claude): reopen queries after MCP credential rotation
Fixes review: https://github.com/pingdotgg/t3code/pull/2829#discussion_r3566081244

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:25 +02:00
Julius Marmingeandcodex d1118b6183 fix(claude): enforce read-only tool availability
Fixes review: https://github.com/pingdotgg/t3code/pull/2829#discussion_r3509702833

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:25 +02:00
Julius Marmingeandcodex 6e491d199d fix(claude): honor never-approval runtime policies
Fixes review: https://github.com/pingdotgg/t3code/pull/2829#discussion_r3507807129

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:25 +02:00
Julius Marmingeandcodex 7fa6cdcbd1 fix(claude): allow questions during plan mode
Fixes review: https://github.com/pingdotgg/t3code/pull/2829#discussion_r3501073032

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:25 +02:00
Julius Marmingeandcodex 4c8471a271 fix(claude): preserve approvals with full-access sandbox
Fixes review: https://github.com/pingdotgg/t3code/pull/2829#discussion_r3476628169

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:25 +02:00
Julius Marmingeandcodex f5e797c70e fix(claude): redact launch arguments from protocol logs
Fixes review: https://github.com/pingdotgg/t3code/pull/2829#discussion_r3471595059

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:25 +02:00
Julius Marmingeandcodex c0017bf640 test(desktop): expect orchestrator v2 state directory
Refs CI: https://github.com/pingdotgg/t3code/actions/runs/29750215334/job/88378428137

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:25 +02:00
Julius Marmingeandcodex 728d184c8e fix(ci): restore Claude permission request identity
Refs CI: https://github.com/pingdotgg/t3code/actions/runs/29750215334/job/88378428015

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:25 +02:00
Julius Marmingeandcodex bd76cc06c0 fix(orchestrator): align Claude permission replay with SDK
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:25 +02:00
Alex bc76ab4db3 feat(orchestrator): pass model options through MCP thread targets (#3872) 2026-08-14 11:23:25 +02:00
Alex e62b8710aa fix(orchestrator): scope Claude MCP tool pre-approval (#3862) 2026-08-14 11:23:25 +02:00
Mike Olson b6d302cd82 [orchestrator-v2] fix(orchestrator): Codex background command completion and subagent resume (#3908) 2026-08-14 11:23:25 +02:00
b883940c9a [orchestrator-v2] fix(orchestrator): Restore Claude session continuity for resume, wake, and idle release (#3860)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-14 11:23:25 +02:00
Mike Olson fc72144f40 feat(orchestrator): Add shared provider continuation and background item plumbing
Introduce a provider-agnostic continuation request queue, worker, and optional
hasPendingBackgroundWork idle pin so adapters can surface post-settle native
wake traffic as first-class runs. No adapter offers continuations here; the
per-provider specialty commits wire attach mode.

Also fix shared run event ingestion dropping late background item
completions. The per-run provider event fiber stopped as soon as the root
turn terminalized and no child provider turns or subagent rows remained
active. Background-capable turn items (background commands, monitors,
subagent rows) that complete after root settlement then lost their trailing
turn_item.updated: the projection kept the item running forever even when
the underlying work (and any wake) succeeded.

Track non-terminal command_execution, dynamic_tool, and subagent turn items
owned by the run or an owned child thread, and keep ingesting until they
terminalize, gated on the root terminal status being completed so
interrupted and failed runs do not pin the stream open.

Repro evidence: Codex emits subagent.updated(completed) before the trailing
turn_item.updated(completed), so post-settle subagent items stuck at running
in the UI; background command items never completed in the
codex-background-exec-wake projection even though the wake run fired. The
same stuck-running signature appears on the Claude background Bash wake and
Grok monitor paths, which reuse this shared ingestion loop.
2026-08-14 11:23:25 +02:00
Julius MarmingeandClaude Fable 5 8d7bfec473 feat: scheduled tasks (automations) (#3638)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-14 11:23:25 +02:00
Julius Marmingeandcodex 4e28472e91 Fix Claude task turn mapping
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:25 +02:00
Julius Marminge 6a0fe7c0f6 Allow provider switching via handoff in chat threads
- Let started threads switch providers when handoff is supported
- Keep model picker and block reasons aligned with thread capabilities
- Update logic tests for the new provider-switching rule
2026-08-14 11:23:24 +02:00
Julius Marminge 74217a71af Remove early access badges from Cursor and Grok
- Keep provider labels aligned across server and web metadata
- Leave interaction mode and thread-change behavior unchanged
2026-08-14 11:23:24 +02:00
Julius Marminge 6f35159fbe Switch Cursor provider to the official SDK
- remove ACP model discovery and mismatch probe code
- update provider, orchestration, and tests for SDK-based flows
- refresh marketing copy to match the SDK runtime
2026-08-14 11:23:24 +02:00
maria 89ec767058 fix(web): align thread details panel controls and menus (#3606) 2026-08-14 11:23:24 +02:00
Julius Marminge 29cd06590a Require Cursor API key for provider checks
- Switch Cursor provider status and model discovery to the SDK catalog
- Improve chat content lane alignment and provider secret handling
2026-08-14 11:23:24 +02:00
Julius Marminge 626a879b78 Keep persistent cards visible in folded turns
- Treat persistent resource cards as foldable turn entries
- Preserve cards that arrive before commentary when collapsing settled turns
2026-08-14 11:23:24 +02:00
Julius Marminge bfcf0445d9 Clarify thread relationship icons and ordering
- Show parent-thread links with a dedicated return icon
- Prioritize parent and merge relationships in the thread panel
2026-08-14 11:23:24 +02:00
Julius Marminge 5e28e470b8 Map nested Codex subagent threads correctly
- Preserve app-thread projection when spawning Codex subagents
- Add replay fixture coverage for nested provider-native subagents
2026-08-14 11:23:24 +02:00
Julius Marminge 3f50a50f8d Adopt userdata-v2 and subagent activity mapping
- Move desktop and server state paths to `userdata-v2`
- Handle Codex subagent activity events in orchestration v2
- Update related path and lifecycle tests
2026-08-14 11:23:24 +02:00
Julius Marminge 76785f31f7 Map Grok task envelopes to subagent lineage
- Detect xAI Task tool calls as native subagents
- Project child session IDs and buffered chunks into the orchestration tree
- Add replay fixture coverage for Grok subagent lineage
2026-08-14 11:23:24 +02:00
Julius Marminge a78e69b1cc Add iOS associated domains for Clerk
- Configure applinks and webcredentials for all mobile variants
- Set the Clerk relying party used by app config
2026-08-14 11:23:24 +02:00
Julius Marmingeandcodex 6b04c941d5 Retire V1 client orchestration parity
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:24 +02:00
Julius Marmingeandcodex 96ecd33a39 Expose V2 thread workflows on mobile
Co-authored-by: codex <[email protected]>
2026-08-14 11:23:24 +02:00
Julius Marmingeandcodex 0e80e11955 Enrich mobile V2 execution items
Share V2 item-to-entity linkage across clients and give mobile targeted execution, provider, request, checkpoint, search, subagent, and handoff inspection without reconstructing the timeline.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:23 +02:00
Julius Marmingeandcodex 9b3a9fdf5e Render mobile timelines from V2 turn items
Use the authoritative visibleTurnItems projection directly so mobile preserves server ordering, inherited items, and synthetic items without rebuilding a parallel feed.

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:23 +02:00
Julius Marminge d11747b27c Hide subagent threads and simplify thread controls
- Remove subagent prefixes from titles and timeline labels
- Hide subagent threads in the sidebar and add parent-thread navigation
- Align thread details, picker, and git/script controls with panel styling
2026-08-14 11:23:23 +02:00
Julius Marminge 5e9bd12edd Split open-in editor controls into panel and toolbar variants
- Move Open in editor shortcut handling into a shared hook
- Show Open in picker inside the thread details panel and restyle PR actions
- Tighten popover positioning for the panel layout
2026-08-14 11:23:23 +02:00
Julius Marminge 1a03d3232e Reserve space for inline thread details panel
- Move the inline thread panel to an absolute overlay
- Add shared inset styling so the timeline and composer avoid overlap
- Rename composer glass styling to the shared floating surface class
2026-08-14 11:23:16 +02:00
Julius Marmingeandcodex 4be1e0fe13 Map thread panel into title bar and sidebar
- Add thread-panel presentation logic for inline vs popover layouts
- Move thread details controls into the chat header/sidebar flow
- Add shared wait-for-atom helper and workspace display name parsing

Co-authored-by: codex <[email protected]>
2026-08-14 11:23:16 +02:00
Julius Marminge 6ff48331b7 Record created threads and subagent progress
- Add parent-thread records for spawned child threads
- Persist Claude subagent progress as reasoning items
- Tighten projection verification around readable thread projections
2026-08-14 11:23:08 +02:00
Julius Marminge 0d295cf098 Handle preparing turns across provider orchestration
- Treat preparing as an active turn state in mobile and server flows
- Tighten ACP model option validation and selection reconfiguration
- Add coverage for turn mapping, raw protocol logging, and recovery paths
2026-08-14 11:23:08 +02:00
Julius Marminge 5e1536e260 Integrate orchestration V2 controls and process recovery
- Add V2 item inspection, thread relationships, queued-run controls, and composer dispatch policies
- Reconcile interrupted provider state safely across shutdown and startup
- Preserve checkpoint baselines and shared provider-session projections
2026-08-14 11:23:08 +02:00
Julius Marminge b7f71acd29 Complete orchestration V2 frontend cutover
- Migrate web and mobile state, commands, and persistence to V2 projections
- Render conversations from authoritative visible turn items
- Harden runtime policy, launch handling, attachments, and cache invalidation
2026-08-14 11:23:08 +02:00
Julius Marminge c996dc479e Split the V2 frontend plan into parity and enrichment phases
- Define Shape 4.0 for the client cutover and product parity
- Define Shape 4.5 for V2-native UI capabilities
- Defer existing V1 state migration to an out-of-scope Stage 5
2026-08-14 11:22:52 +02:00
Julius Marminge 9bf8cea6af Integrate orchestration v2 with the application runtime
Retain the existing event-sourced application data plane for projects and shell state while making orchestration v2 the sole agent runtime. Adapt v2 events and receipts to the shared infrastructure and remove the v1 provider reactors.
2026-08-14 11:22:52 +02:00
Julius Marminge 3aa295a9f6 Guarantee MCP revocation during session release 2026-08-14 11:22:52 +02:00
Julius Marminge be243ae91a Remove MCP credential expiration 2026-08-14 11:22:52 +02:00
Julius Marminge 559e41a91f Require MCP registry for V2 provider sessions 2026-08-14 11:22:52 +02:00
Julius Marminge 6d64cac00b Complete orchestration V2 application services 2026-08-14 11:22:52 +02:00
Julius Marminge d358d16a39 Start orchestration V2 application services 2026-08-14 11:22:52 +02:00
Julius Marminge 63f2e161e7 Align orchestration V2 with Effect service conventions 2026-08-14 11:22:52 +02:00
Julius Marminge 27da49519f Share Codex sessions across orchestration threads
- Track explicit thread-to-session bindings and detach without stopping siblings
- Apply runtime settings per Codex thread and filter multiplexed events by turn
- Add migration, projection, lifecycle, and concurrency coverage
2026-08-14 11:22:52 +02:00
Julius Marminge 12173fe8e9 Map orchestration turns to provider instances
- Separate provider driver identity from configured provider instances
- Add durable event, effect, checkpoint, and turn-position persistence
- Route turn lifecycle and recovery through shared orchestration services
2026-08-14 11:22:52 +02:00
Julius Marminge 4aad08e645 Add Orchestration V2 application integration plan
- Define four implementation shapes for the V2-only migration
- Add the plan to the plans index
2026-08-14 11:22:52 +02:00
Julius Marminge c8b20831e2 Add MCP thread management and Codex turn mapping
- Add scoped thread list, read, send, wait, and interrupt tools
- Track creation provenance and map provider turns across adapters
- Centralize thread lifecycle operations in a management service
2026-08-14 11:22:52 +02:00
Julius Marminge 34c6d5ea18 Add ACP replay harness and session lifecycle support
- Add replay agent and fixture-driven ACP transcript testing
- Support session lifecycle, auth methods, and session resume/fork flows
- Expand orchestration V2 adapter coverage and debug tooling
2026-08-14 11:22:52 +02:00
Julius Marminge 0e1cf4e0ed Handle segmented Cursor turns and stable visible timelines
- split streaming assistant and reasoning output into separate segments
- filter hidden interruption artifacts from projections and replay fixtures
- keep visible timeline positions stable when upserting streamed items
2026-08-14 11:22:52 +02:00
Julius Marminge d7abcb569f Add Cursor SDK orchestration replay support
- Wire Cursor adapter and provider session handling into orchestration v2
- Add replay fixtures, recording script, and coverage for Cursor turn flows
- Update docs and debug timeline mapping for Cursor events
2026-08-14 11:22:51 +02:00
Julius Marminge b38863bbd2 Add orchestration MCP toolkit
- Register orchestration tools on the MCP HTTP server
- Grant orchestration capability to MCP sessions
- Add service and integration coverage for delegated tasks and thread creation
2026-08-14 11:22:51 +02:00
Julius Marmingeandcodex 3596d26659 refactor(orchestration-v2): adopt host process spawn policy
Co-authored-by: codex <[email protected]>
2026-08-14 11:22:51 +02:00
Julius Marminge 3211e667fd wip 2026-08-14 11:22:51 +02:00
Julius Marmingeandcodex c4fbe434b6 feat(orchestration-v2): model native subagents
Co-authored-by: codex <[email protected]>
2026-08-14 11:22:51 +02:00
Julius Marminge df9d6ec566 Map orchestration v2 WS methods to auth scopes
- Require operate scope for v2 command dispatch
- Allow read scope for v2 thread and shell subscriptions
2026-08-14 11:22:51 +02:00
Julius Marmingeandcodex 259018c744 fix(orchestration-v2): preserve source history on merged switch
Send full canonical target-thread context when a provider switch consumes a merge-back, and cover returning to an existing provider thread after a cross-provider fork.

Co-authored-by: codex <[email protected]>
2026-08-14 11:22:51 +02:00
Julius Marmingeandcodex 50106cc8da fix(orchestration-v2): compose provider switch merge context
Allow a pending merge-back to be consumed while changing providers and deliver both the provider-switch history and fork delta to the selected provider.

Co-authored-by: codex <[email protected]>
2026-08-14 11:22:51 +02:00
Julius Marmingeandcodex 8923fbd180 feat(orchestration-v2): add merge-back replay coverage
Record provider fixtures for continued forks and sibling merge-backs, exercise context survival end to end, and stop completed run listeners from consuming later provider events.

Co-authored-by: codex <[email protected]>
2026-08-14 11:22:51 +02:00
Julius Marmingeandcodex caf564ad94 fix(orchestration-v2): resolve cross-provider forks
Co-authored-by: codex <[email protected]>
2026-08-14 11:22:51 +02:00
Julius Marmingeandcodex 404393a840 feat(orchestration-v2): support cross-provider handoff
Co-authored-by: codex <[email protected]>
2026-08-14 11:22:51 +02:00
Julius Marmingeandcodex f929f667f8 feat(orchestration-v2): wire claude adapter primitives
Co-authored-by: codex <[email protected]>
2026-08-14 11:22:51 +02:00
Julius Marminge e852d5ccda Document Cursor SDK MCP projection for V2
- Map Cursor SDK agents and runs to V2 thread and turn lifecycles
- Update MCP capability, tool, and testing guidance for SDK-based injection
2026-08-14 11:22:51 +02:00
Julius Marminge 333cec5023 Add turn-interrupt replay coverage and protocol logging
- add interrupt and mid-tool replay fixtures for Claude and Codex
- log Claude Agent SDK protocol frames to native event traces
- project Codex commandExecution start events into orchestration updates
2026-08-14 11:22:51 +02:00
Julius Marminge 4adae8e308 Support active Claude steering and turn replay mapping
- add active steering and interrupt-restart replay fixtures
- update Claude adapter/orchestrator turn handling for steering
- refresh replay and integration test coverage
2026-08-14 11:22:51 +02:00
Julius Marmingeandcodex 92468574f9 Map Claude turns to runtime query policies
- Derive Claude SDK query options from runtime policy
- Add read-only replay fixture and policy mapping tests
- Reuse shared approval-policy fixtures across orchestrator tests

Co-authored-by: codex <[email protected]>
2026-08-14 11:22:51 +02:00
Julius Marminge adb97a1036 Map Claude replay fixtures to multi-turn turns
- Record Claude SDK transcripts across multiple prompts and restart/query modes
- Add approval and tool-call replay coverage for new orchestration fixtures
- Update Claude adapter testkit to model open/prompt/permission frames
2026-08-14 11:22:51 +02:00
Julius Marminge 2fd7bb706b Add model selection to orchestration runs
- persist the selected model on run records
- surface run model selection in the debug UI
- update replay fixtures and contracts for the new field
2026-08-14 11:22:51 +02:00
Julius Marminge 4170d9f395 Extract Claude SDK query runner from provider adapter
- Move Claude provider runtime logic into its own module
- Share the SDK query runner between live and replay paths
- Add replay driver error wrapping for unexpected failures
2026-08-14 11:22:50 +02:00
Julius Marminge b589aa2976 Add Claude replay fixture recorder
- Move Codex replay recording into `apps/server`
- Add Claude Agent SDK replay fixtures and test harness
- Update orchestration-v2 fixture scenarios and docs
2026-08-14 11:22:50 +02:00
Julius Marmingeandcodex 885bde7c3d Add V2 command capability policy
Co-authored-by: codex <[email protected]>
2026-08-14 11:22:50 +02:00
Julius Marminge 81a47cfe19 Add merge-back context handoff support
- Map fork and merge-back turns into stored handoffs and transfer resolutions
- Add shell snapshot projection support plus coverage tests
- Update replay fixtures and web contracts for the new turn flow
2026-08-14 11:22:50 +02:00
Julius Marminge 6fa7bdb177 Add orchestration V2 backend checklist
- Track remaining projection, context transfer, rollback, capability, and subagent work
- Clarify current V2 baseline and debugger-only follow-ups
2026-08-14 11:22:50 +02:00
Julius Marminge ba559425c7 Add thread fork lineage and lazy context transfer
- Add context transfer IDs, schemas, and projections
- Support cheap fork creation and Codex native fork rollback
- Cover fork idempotency and replay behavior in tests
2026-08-14 11:22:50 +02:00
Julius Marmingeandcodex b1c0b267fb Implement orchestration v2 runtime
Co-authored-by: codex <[email protected]>
2026-08-14 11:22:50 +02:00
Julius Marminge 69676c50bc Map Codex turns into orchestration v2
- Add Codex adapter and replay harness wiring
- Introduce in-memory orchestration projections and provider registry
- Expand orchestration contracts for turn and runtime events
2026-08-14 11:22:50 +02:00
Julius Marmingeandcodex ed09178238 Add orchestration v2 replay and service contracts
- Introduce orchestration v2 service interfaces and error types
- Add replay runtime, fixtures, and integration coverage
- Update shared contracts and probe transcripts

Co-authored-by: codex <[email protected]>
2026-08-14 11:22:50 +02:00
Julius Marminge f12635c520 Add orchestration v2 docs and probe fixtures
- Document the target orchestration graph, IDs, lifecycles, and capability model
- Add Codex app-server probe fixtures and update the probe test harness
2026-08-14 11:22:50 +02:00
Julius Marmingeandcodex 8c678b9005 Fix Codex provider status test expectations
Co-authored-by: codex <[email protected]>
2026-08-14 11:22:50 +02:00
Julius Marmingeandcodex 266b32318c Address Codex review feedback
Co-authored-by: codex <[email protected]>
2026-08-14 11:22:50 +02:00
Julius Marminge 4405cb98d3 Switch Codex provider checks to app-server probe
- Use codex app-server snapshots for auth, models, and skills
- Remove legacy CLI/config discovery paths and related helpers
- Update tests for the new provider status flow
2026-08-14 11:22:50 +02:00
Julius Marminge 9fe1122f7d Flush native logs on adapter shutdown
- Close the managed native event logger when the adapter layer tears down
- Make session runtime close idempotent with an atomic closed flag
- Add coverage for flushing thread native logs on shutdown
2026-08-14 11:22:50 +02:00
Julius Marminge 91e92fb128 decoders 2026-08-14 11:22:50 +02:00
Julius Marminge 68b703643d Scope Codex session runtime lifetimes
- Transfer session-owned scopes into adapter state
- Ensure runtime scopes close on stop and startup failure
- Add regression coverage for scoped lifecycle cleanup
2026-08-14 11:22:50 +02:00
Julius Marminge ffbe9de9b8 Normalize Codex IDs and preserve streamed stdout decoding
- Use strict TurnId and ProviderItemId parsing in Codex session routing
- Decode in-memory stdio chunks in streaming mode to avoid split UTF-8 corruption
2026-08-14 11:22:50 +02:00
Julius Marminge 8c853d981c Return Cursor ACP runtime with explicit scope
- Type the runtime effect with `Scope`
- Build the ACP session runtime without wrapping it in `Effect.scoped`
2026-08-14 11:22:50 +02:00
Julius Marminge 9ba4535e5e Delay Codex provider availability until checked
- Initialize provider as unchecked in a pending state
- Update initial probe message to reflect session-local status
2026-08-14 11:22:49 +02:00
Julius Marminge 70778705f4 resynclock 2026-08-14 11:22:49 +02:00
Julius Marminge 11b4f021db revert more 2026-08-14 11:22:49 +02:00
Julius Marminge 7c0d40fefe nit 2026-08-14 11:22:49 +02:00
Julius Marmingeandcodex 90d0f40790 Integrate Codex app-server support
Co-authored-by: codex <[email protected]>
2026-08-14 11:22:49 +02:00
Julius MarmingeandClaude Fable 5 038560e580 fix(web): align every titlebar control cluster on one shared inset (#6592)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-14 11:22:05 +02:00
Julius MarmingeandClaude Fable 5 21a3669cee fix(mobile): prevent OTA update restart crashes (#6324)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-14 10:46:33 +02:00
Julius MarmingeandClaude Fable 5 b3b4b57794 fix(mobile): preserve keyboard suggestions while typing (#6323)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-14 10:45:43 +02:00
6ae44b418a refactor(mobile): name the iOS nav bar height fallback (#6589)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-08-14 08:29:09 +00:00
Michael Charles Aubrey 4a2f8b04bb fix(web): keep thread rename open during IME composition (#6281) 2026-08-14 08:27:29 +00:00
Pavlo TrinkoandClaude Fable 5 8f9ab0845d fix(mobile): add breathing room between the git progress overlay and the app bar (#6587)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-14 10:25:05 +02:00
Julius MarmingeandClaude Fable 5 baaeda305c fix: avoid stale Live Activities when publishing is disabled (#6325)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-14 10:00:25 +02:00
7e01d33f0e perf(build): stop unpacking node_modules wholesale from the Windows asar (#5877)
Co-authored-by: tsouth89 <[email protected]>
Co-authored-by: t3-code[bot] <t3-code[bot]@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <[email protected]>
Co-authored-by: Shivam Sharma <[email protected]>
2026-08-14 08:37:57 +05:30
Chris Deeming 9fd788b5a9 fix(preview): only show browser-ready local servers (#6021) 2026-08-13 22:10:41 -04:00
Chris Deeming 710fd0eeb3 feat(desktop): add favicons to the Browser panel (#5644) 2026-08-13 22:02:09 -04:00
David Hu e15f655ba4 fix(web): show background policy tooltips sooner (#6506) 2026-08-13 22:01:11 -04:00
Theo BrowneandClaude Fable 5 59be6f7846 fix(web): simplify the desktop-managed server update banner copy (#6549)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-13 21:45:51 -04:00
t3-code[bot]andcodex 5304f3e9d4 chore(mobile): bump app version to 1.0.4
Co-authored-by: codex <[email protected]>
2026-08-14 00:01:09 +00:00
85389b9883 Nest mobile task settings in bottom sheets (#6224)
Co-authored-by: codex <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-13 23:59:27 +00:00
Theo Browne db1507e986 feat: allow disabling auto-settle on merge (#5880) 2026-08-13 16:18:15 -07:00
Rakshith Bhat 96bfa67b3d fix(web): align the snoozed thread wake icon (#6215) 2026-08-13 18:14:24 -04:00
Taylor Bombay 5ff3a03ada fix(web): align sidebar wordmark label (#6086) 2026-08-13 18:14:13 -04:00
t3-code[bot]andmaria 23d45d914e fix(web): restore default stage artwork colors (#6535)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: maria <[email protected]>
2026-08-13 18:04:24 -04:00
Paul van DykandClaude Opus 5 bad1143b02 fix(mobile): show a real settings cog in the Android sidebar header (#6520)
Co-authored-by: Claude Opus 5 <[email protected]>
2026-08-13 20:41:17 +00:00
Adamulek123andJulius Marminge 92d4a2e996 fix(web): scope pull request errors to their environment (#6490)
Co-authored-by: Julius Marminge <[email protected]>
2026-08-13 20:40:21 +00:00
Utkarsh Patil 2fab18e289 fix(web): show unlinked icon when viewport aspect ratio is unlocked (#6509) 2026-08-13 16:03:48 -04:00
1b16ed663f fix(web): avoid Clerk close button overlap (#6442)
Co-authored-by: t3-code[bot] <236186684+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Wout Stiens <[email protected]>
2026-08-13 15:08:28 -04:00
SimoneandSimone 83ad26c3a3 fix(mobile): prevent invalid HTML entities from crashing markdown (#6495)
Co-authored-by: Simone <[email protected]>
2026-08-13 15:08:13 -04:00
Chris Deeming fd51561b4e fix(mobile): extend blockquotes across wrapped lines (#6482) 2026-08-13 20:00:03 +02:00
Julius Marminge 9e201941aa Remove rebase requirement before opening PR (#6479) 2026-08-13 15:04:42 +00:00
t3-code[bot]andJulius Marminge 2ab188f1c0 fix: ignore pull request actions in latency tracker (#6476)
Co-authored-by: Julius Marminge <[email protected]>
2026-08-13 14:51:31 +00:00
maria 9513e62e24 Add bil0000 to VOUCHED contributors list (#6462) 2026-08-13 14:26:36 +00:00
Bilal Bakr 97db94c9bf fix(web): keep pull request panel within viewport (#6451) 2026-08-13 08:45:33 -04:00
Exotic 5015d7cf9f fix(web): keep turn minimap stable as composer grows (#6414) 2026-08-13 15:30:37 +05:30
Nick Anisimov df19f6cfe3 fix(server): align Codex collaboration prompts (#6432) 2026-08-13 10:31:53 +02:00
Dominic RoyandClaude Fable 5 6bc6cb6be4 fix(web): keep diff file lists scrollable past expanded files (#6423)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-12 20:11:53 -07:00
Theo BrowneandClaude Fable 5 1e59b4c400 fix(web): keep the typed prompt when a draft changes repo (#6393)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-12 16:26:27 -07:00
t3-code[bot]andUtkarsh Patil 33f9705926 fix(web): make reset zoom hover visible (#6385)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <[email protected]>
2026-08-12 19:13:35 -04:00
Dominic Roy da6253b3dd web/settings: fix source control scan on relay environments (#6230) 2026-08-12 16:13:06 -07:00
GianmarcoandCursor ac1264e2ca feat(web): project favicon and workspace icons in command subtitles (#6330)
Co-authored-by: Cursor <[email protected]>
2026-08-12 17:32:58 -04:00
Theo Browne 2eb099fdc8 fix(web): cmd+click sidebar PR numbers open in the browser (#6378) 2026-08-12 14:28:37 -07:00
Bilal BakrandJulius Marminge b28f9bf0a1 feat(web): pull request surfaces — filters & qualifiers, all-server listing, update branch, reactions, in-place editing, smarter diffs (#6039)
Co-authored-by: Julius Marminge <[email protected]>
2026-08-12 22:58:36 +02:00
d0b8d6306b feat(connect): deregister account environments from any client (#4844)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-08-12 22:46:23 +02:00
Exotic 9666b87516 fix(web): preserve appearance mode when changing themes (#6343) 2026-08-12 16:43:40 -04:00
Alex e3a9c2518d test(mobile): seed snoozed showcase threads (#5155) 2026-08-12 16:43:18 -04:00
Julius Marminge 18918d1c4d Fix mobile command popover glass rendering (#6370) 2026-08-12 22:21:45 +02:00
t3-code[bot]andmaria 8d24b5131f fix(web): open modified PR clicks in browser (#6278)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: maria <[email protected]>
2026-08-12 14:32:44 -04:00
Exotic 770946d026 fix(web): render tooltips above dropdowns (#6241) 2026-08-12 14:32:20 -04:00
8601797233 fix(web): align update toast release notes link (#6322)
Co-authored-by: t3-code[bot] <219304759+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <[email protected]>
Co-authored-by: Exotic <[email protected]>
2026-08-12 14:32:10 -04:00
Exotic b73232bdd3 feat(web): reset sidebar width on double click (#6320) 2026-08-12 10:07:39 -04:00
Wout Stiens f131228a59 fix(web): theme Clerk surfaces (#6300) 2026-08-12 19:36:04 +05:30
t3-code[bot]andWout Stiens e321667b10 fix(web): prevent changed files header overlap (#6314)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Wout Stiens <[email protected]>
2026-08-12 08:56:13 -04:00
Julius Marminge 849bac8946 fix(connect): preserve CLI OAuth parameters through browser sign-in (#6285) 2026-08-12 12:58:34 +02:00
t3-code[bot]andUtkarsh Patil 6fd088af9f fix(web): align mobile onboarding header (#6293)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <[email protected]>
2026-08-12 16:07:44 +05:30
Wout Stiens b54bfc9312 feat(web): a better right panel empty state (#6258) 2026-08-12 15:28:46 +05:30
Nick Anisimovandshivam e1378a1f4d fix(mobile): keep ordered lists inside user bubbles (#6154)
Co-authored-by: shivam <[email protected]>
2026-08-12 14:39:51 +05:30
t3-code[bot]andmaria 5a84614809 fix(web): align the composer model picker (#6252)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: maria <[email protected]>
2026-08-11 22:38:45 -04:00
maria 63e6faef62 chore: add dara to vouched (#6259) 2026-08-11 21:51:00 -04:00
Chris Deeming d37a9b09b8 feat(mobile): add thread title regeneration (#6253) 2026-08-11 21:43:05 -04:00
Exotic 560d4a4560 fix(web): keep sidebar wordmark visible at minimum width (#6246) 2026-08-11 19:57:10 -04:00
maria 52e5a75a87 feat(web): compact sidebar footer actions (#6210) 2026-08-11 18:53:40 -04:00
Exotic c196f422ed fix(web): clean up composer resize animation (#6209) 2026-08-11 23:21:44 +02:00
f0b57ca231 feat(web): add Open VSX theme search (#5654)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-08-11 20:06:05 +00:00
t3-code[bot] 2db08457f2 fix(web): use upload icon for disabled push action (#6207) 2026-08-11 20:25:24 +02:00
Wout Stiens 083fa4ab24 feat(web): use OKLCH for theme palettes (#6036) 2026-08-11 20:00:17 +02:00
Exotic 35172010b1 fix(web): use a clearer pull action icon (#6194) 2026-08-11 16:39:59 +00:00
Mina Yacoub 57b1052679 fix(web): thread error banner dismiss survives reconnect and rerenders (#6123) 2026-08-11 12:27:55 -04:00
1e355a2a34 fix(web): render dropdowns above toasts (#6165)
Co-authored-by: Rodrigo Brechard <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-11 12:27:02 -04:00
Utkarsh Patilandshivam 44621c345f feat(web): add back buttons for the pull requests and usage pages in the sidebar footer (#6031)
Co-authored-by: shivam <[email protected]>
2026-08-11 12:26:24 -04:00
Arham AminandClaude Opus 4.8 220e573b14 fix(shared): detect Azure DevOps SSH remotes (ssh.dev.azure.com) (#6187)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-11 16:14:02 +00:00
Arham AminandClaude Opus 4.8 6befe42eb0 fix(shared): normalize a bare Windows drive root the same as C:\ / C:/ (#6189)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-11 15:52:23 +00:00
Julius Marmingeandcodex b30a9bc414 feat(web): make environment artwork theme aware (#6183)
Co-authored-by: codex <[email protected]>
2026-08-11 17:46:52 +02:00
Wout Stiens ac4780f451 fix(web): restore typography font sizes to defaults (#6172) 2026-08-11 17:21:58 +02:00
Julius Marmingeandcodex 3da7f9c5c3 fix(mobile): guard App Store release versions (#6177)
Co-authored-by: codex <[email protected]>
2026-08-11 15:06:54 +00:00
Julius Marminge c842c6f5b9 Add hourly past-24-hour usage view (#6170) 2026-08-11 16:47:13 +02:00
6676f9c83b fix(mobile): stabilize thread composer and interactions (#5986)
Co-authored-by: codex <[email protected]>
Co-authored-by: Thuong Tin <[email protected]>
Co-authored-by: Kapish14 <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-11 14:05:03 +00:00
Utkarsh Patilandshivam 65b005f1e4 feat(web): add Copy Thread ID to the sidebar and chat header thread context menu (#5574)
Co-authored-by: shivam <[email protected]>
2026-08-11 18:32:02 +05:30
Utkarsh Patilandshivam 752acbf654 feat: add ability to create a new thread in the current project with shift+click and show shortcut in tooltip (#5994)
Co-authored-by: shivam <[email protected]>
2026-08-11 18:26:53 +05:30
Guilherme Vieira f5fce74169 fix(pull-requests): route self-hosted GitLab remotes (#6061) 2026-08-11 13:11:19 +02:00
t3-code[bot] 9c7622dac3 fix(server): handle unborn HEAD in VCS status (#5944)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
2026-08-10 23:34:18 -04:00
yassiEmp c14bcca103 fix(server): advertise 256-color TERM on Windows terminals (#5693) 2026-08-10 23:33:58 -04:00
bkntr 1fa315ea93 fix(server): skip Linux libc detection on Windows/macOS (#5354) 2026-08-10 23:33:18 -04:00
Taras f9730979c1 perf(web): skip base64 for oversized image candidates (#5220) 2026-08-10 23:33:08 -04:00
AlexandIllia Panasenko 59d0c922e9 fix(web): persist sidebar shelf collapse state (#5136)
Co-authored-by: Illia Panasenko <[email protected]>
2026-08-10 23:32:22 -04:00
Arham AminandClaude Opus 4.8 2ea51bd31f fix(server): OpenCode model parsing drops models with a slash in the JSON body (#5072)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-10 23:31:31 -04:00
Pavlo TrinkoandClaude Fable 5 e5c82d79a0 fix(mobile): keep chat composer above the Android gesture bar (#5988)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-10 20:31:00 -04:00
Jono Kemball 9afef94a61 feat: add three-hour snooze option (#5914) 2026-08-11 00:03:26 +02:00
Utkarsh Patil a7b0366cbe fix(web): account for Windows window controls in PR page header (#6049) 2026-08-10 22:10:00 +02:00
Julius Marminge 428d9f9f67 Allow Android tablets to rotate (#5613) 2026-08-10 21:18:13 +02:00
t3-code[bot] 1b120f352f fix(ci): extend release publish timeout (#6034) 2026-08-10 21:01:09 +02:00
Chris Deeming 0a7c662d39 fix(web): improve built-in theme contrast (#6000) 2026-08-10 12:06:55 -04:00
Utkarsh Patil b91a000a17 feat(web): add duplicate action to the T3 Code default theme (#6013) 2026-08-10 18:02:27 +02:00
Tylerandtsouth89 8de0aa24d9 perf(desktop): probe the Windows shell environment concurrently (#5878)
Co-authored-by: tsouth89 <[email protected]>
2026-08-10 11:53:10 -04:00
cad2c93616 feat: multi-provider pull requests page with in-app reviews (#4849)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: maria <[email protected]>
Co-authored-by: maria-rcks <[email protected]>
Co-authored-by: codex <[email protected]>
2026-08-10 17:47:02 +02:00
t3-code[bot] 78f462c4e1 chore(release): prepare v0.0.33 2026-08-10 12:00:11 +00:00
Julius Marmingeandcodex 3b72d17cbc fix(mobile): parse EAS fingerprint JSON (#5991)
Co-authored-by: codex <[email protected]>
2026-08-10 11:35:40 +00:00
d440442db6 fix(mobile): stop Android user bubbles with code blocks from overlapping (#5659)
Co-authored-by: Rodrigo Brechard <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-10 12:36:08 +02:00
Mina Yacoub 67ef189d8b fix(mobile): detect PowerShell cmdlet errors in work log rows (#5726) 2026-08-10 12:34:28 +02:00
Utkarsh Patil fbcae59ef5 fix(web): use import/export-appropriate icons for theme buttons (#5964) 2026-08-10 15:48:54 +05:30
Wout Stiens 9821bca1ce fix(web): use themed confirmation dialogs (#5624) 2026-08-10 02:23:27 -04:00
Chris Deeming 3d74474f6c fix(web): update pills use readable theme foregrounds (#5938) 2026-08-09 23:26:45 -04:00
Carter Smith f0e2975180 fix(web): align project name with headline (#5864) 2026-08-09 23:22:48 -04:00
Theo BrowneandClaude Opus 5 d43210050b fix(web): trait menu closes after you pick a level (#5879)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-09 23:22:28 -04:00
SimoneandSimone ef051bdb87 fix(web): enable restore defaults after theme mix changes (#5928)
Co-authored-by: Simone <[email protected]>
2026-08-09 23:21:56 -04:00
Tristan Knight 0ca9fb3fb5 fix(web): show worktree icon in sidebar v2 (#5909) 2026-08-09 23:21:39 -04:00
Ellie Gummere cbd55d6374 fix(web): correct model picker trigger padding (#5935) 2026-08-10 04:32:13 +02:00
Julius Marminge 96906805f1 Add settings and usage breadcrumbs (#5929) 2026-08-10 02:12:19 +00:00
Julius Marminge 73b2e8fdd4 Automate production mobile EAS releases (#5609) 2026-08-10 04:11:22 +02:00
Julius Marmingeandcodex 5da45337f7 Preserve back navigation when opening settings (#5930)
Co-authored-by: codex <[email protected]>
2026-08-10 01:55:32 +00:00
Julius Marminge f21d5e444e Move project settings to contextual project routes (#5923) 2026-08-10 02:57:39 +02:00
t3-code[bot] 9a1472d955 fix(web): match usage titlebar text styling (#5897)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
2026-08-09 20:14:15 -04:00
Theo Browne 2abe66800c fix(server): sandbox user-provided SVGs (#5916) 2026-08-09 16:51:43 -07:00
Theo BrowneandClaude Fable 5 0d38866dcf fix(server): usage no longer double-counts forked Codex sessions (#5887)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-09 15:56:17 -07:00
Julius MarmingeandClaude Fable 5 f993fa1c5f fix(mobile): long-pressing a thread row no longer navigates into the thread (#5901)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-10 00:29:31 +02:00
Utkarsh Patil 83d769f02d fix(web): match settings search shortcut styling to command palette's (#5841) 2026-08-09 17:48:10 -04:00
Arham AminandClaude Opus 4.8 c8ad4b8135 fix(shell): add ~/.local/bin to the Windows CLI resolver so native-installed providers are found (#5074)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-09 14:45:08 -07:00
t3-code[bot] bd18d8d6d1 fix(web): unify usage page chrome (#5823) 2026-08-09 23:26:26 +02:00
nathangerday 659986ce38 fix(web): thread title button no longer eats the drag area (#5857) 2026-08-09 17:22:52 -04:00
062b4618c2 fix(shared): bound the file-link label so bracket runs stop rescanning (#5782)
Co-authored-by: tsouth89 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-09 14:16:12 -07:00
Matt Urenovich deb901d638 fix(server): favicon resolution no longer pins the event loop (#5538) 2026-08-09 21:10:49 +00:00
Utkarsh Patil 02f4ce5667 fix(web): match create theme and import theme buttons to the standard outline style (#5860) 2026-08-09 14:04:34 -04:00
Robert Soriano 285cf5947b fix(web): preserve desktop route during Clerk auth (#5770) 2026-08-09 17:33:03 +00:00
Julius Marminge 1a003e383a Add cross-platform mobile usage dashboard (#5743) 2026-08-09 12:10:27 +02:00
Theo BrowneandClaude Fable 5 963ebf5bd7 ci: label-gated hosted-web preview deploys (#5465)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-09 00:30:27 -07:00
Theo BrowneandClaude Opus 5 ba9c9ae81d fix(server): one greedy agent process no longer takes down the whole server (#5788)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-08 22:13:26 -07:00
Theo Browne 076e9048dc feat(web): project icons can be chosen manually (#5775) 2026-08-08 22:13:16 -07:00
Theo BrowneandClaude Fable 5 05eb051184 feat(web): keep unsent drafts one click away in the sidebar (#5777)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 20:29:21 -07:00
Theo BrowneandClaude Fable 5 ddaa6afef5 feat(server): vp run migrate-dev-db seeds worktree dev dbs with real data (#5773)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 19:51:18 -07:00
Theo BrowneandClaude Opus 5 6f69b4407f fix(web): sidebar rows show the branch again, not a truncated plan step (#5776)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-08 19:45:21 -07:00
Theo BrowneandClaude Fable 5 6dbffa022d feat: pick worktree or current checkout per project (#5766)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 19:44:58 -07:00
Theo BrowneandClaude Fable 5 5bb8c03664 fix(server): settle no longer leaves monitors and dev servers running (#5774)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 19:44:15 -07:00
Theo BrowneandClaude Fable 5 886195ec1e fix(web): usage totals no longer jump while devices report in (#5772)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 19:05:16 -07:00
Theo BrowneandClaude Fable 5 288d8e3457 feat(web): overhaul project settings into a real settings page (#5768)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 18:50:03 -07:00
Theo BrowneandClaude Fable 5 5208bdeb0d fix(web): pinned reorder no longer reshuffles while writes land (#5767)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 18:46:27 -07:00
Theo BrowneandClaude Fable 5 a6c9b41f90 feat(server): agents can now open the images you paste into chat (#5757)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 18:43:53 -07:00
Theo BrowneandClaude Fable 5 70c423a5e4 fix(web): usage page loses the cost quality panel, gains a back button (#5756)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 21:31:20 -04:00
Theo Browne 89c320df0b fix(server): stop Codex threads with queued follow-ups (#5762) 2026-08-08 17:52:06 -07:00
Theo Browne 7b2cf4374f chore: vouch saphid (#5763) 2026-08-08 20:44:28 -04:00
Theo Browne 49964e38c0 chore: vouch gfsaaser24 (#5761) 2026-08-09 00:32:10 +00:00
e70cdb478d fix(server): stop Claude resume handshakes from completing turns that never ran (#5710)
Co-authored-by: t3-turbo-simulation <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 17:24:42 -07:00
naMqe be01b287b9 fix(web): add missing cursor-pointer styling to dropdowns and interactive buttons (#5716) 2026-08-08 20:02:57 -04:00
Theo BrowneandClaude Fable 5 c2f8cb7ca1 feat(web): show how many subagents are running at a glance (#5745)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 16:20:06 -07:00
Leonel Rivas 89ee692bf0 fix(web): persist diff view mode (#5731) 2026-08-08 17:02:51 -04:00
Theo BrowneandClaude Opus 5 a20923ce46 fix(web): usage chart no longer makes Claude look like the bigger spender (#5697)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-08 05:43:03 -07:00
Theo BrowneandClaude Opus 5 8101cd0449 feat(usage): usage page reading provider transcripts across environments (#5684)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-08 03:59:04 -07:00
Theo BrowneandClaude Fable 5 30164cb1ba feat(mobile): one sheet for model and thread settings (#5625)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 03:51:20 -07:00
Theo BrowneandClaude Fable 5 0640410726 fix(desktop): zoom shortcuts no longer die when the preview browser has focus (#5691)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 02:24:38 -07:00
Theo BrowneandClaude Fable 5 2c7267ad43 fix(server): stop the reaper from silently killing live background subagents (#5677)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 21:42:14 -07:00
Chris Deeming daf8ee0b2f fix(web): inherit terminal size in simple typography (#5628) 2026-08-07 23:31:47 -04:00
t3-code[bot] ed886fe181 fix(web): delay transient reconnect warnings (#5670)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
2026-08-07 23:17:18 -04:00
Theo BrowneandClaude Opus 5 4eaf5ef8bb fix(server): stop PR status lookups amplifying GitHub rate limits (#5673)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-07 18:09:46 -07:00
Theo BrowneandClaude Fable 5 0de9540739 feat: sidebar v2 is now the default sidebar (#5672)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 18:06:10 -07:00
Theo BrowneandClaude Fable 5 31891a1a0c feat(web): fold plan mode and token-by-token output into Legacy features (#5664)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 17:17:44 -07:00
Illia Panasenko 45d9aa90ba fix(web): show Stop button while input is pending (#5554) 2026-08-07 17:03:52 -04:00
Henry Zhang 7a84f6cf10 fix(web): reconnect the composer seam for remote non-Git projects (#5633) 2026-08-07 17:03:31 -04:00
maria f0fb406acf feat(web): make sidebar artwork theme-aware (#5636) 2026-08-07 15:41:59 -04:00
t3-code[bot] 82406bce99 chore: vouch chrisdeeming (#5641)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
2026-08-07 15:01:39 -04:00
Chris Deeming 72d673a855 feat(desktop): remember recently used sites in the Browser panel (#5270) 2026-08-07 14:45:56 -04:00
t3-code[bot] e2cd2383ce chore(ci): vouch StiensWout (#5637)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
2026-08-07 14:29:50 -04:00
Theo BrowneandClaude Fable 5 5661c6116c feat(web): drag pinned threads into your own order (#5581)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 06:57:22 -07:00
Theo BrowneandClaude Opus 5 6d70e6d778 fix(mobile): reconnects no longer shift the thread list (#5372)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-07 06:21:04 -07:00
t3-code[bot] be1a836745 chore(release): prepare v0.0.32 2026-08-07 11:50:54 +00:00
Utkarsh Patil 239ef1c54d fix(web): show the correctly matching shortcut in new thread button's tooltip (#5594) 2026-08-07 12:54:36 +02:00
Utkarsh Patil 61b51ae0e3 feat(web): click the pin icon to unpin a thread (#5578) 2026-08-07 12:54:11 +02:00
Julius Marminge bfc69e4b4d Bump mobile app version to 1.0.2 (#5588) 2026-08-07 12:35:07 +02:00
Gabriel De Andradeandcodex af281c9fc4 fix(mobile): repair Clerk auth navigation headers (#5140)
Co-authored-by: codex <[email protected]>
2026-08-07 12:29:06 +02:00
Pavlo Trinko bd422fd8d1 fix(mobile): keep Android chat text from showing through the composer (#5582) 2026-08-07 10:22:49 +00:00
Tyler Saari 33a03c8a7b fix(mobile): pad scroll views above Android nav bar (#5415) 2026-08-07 10:21:31 +00:00
Justyn Leung a17459e8a9 fix(mobile): avoid iOS terminal reset on clear (#5440) 2026-08-07 10:20:15 +00:00
Theo BrowneandClaude Fable 5 b2ee17d7c1 feat(web): thread actions from the chat header title (#5592)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 10:18:12 +00:00
Theo BrowneandClaude Opus 5 7963cc70f3 feat(server): record runtime mode per turn and on mode changes (#5593)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-07 03:16:11 -07:00
Jay Meistrichandcodex b792ed9f7b fix(web): stabilize chat timeline positioning (#5449)
Co-authored-by: codex <[email protected]>
2026-08-07 12:12:19 +02:00
Theo BrowneandClaude Fable 5 2e66b1fdfc fix(web): live background-work banner no longer hides behind the update notice (#5595)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 10:10:36 +00:00
Jay Meistrich 8100062a78 fix(mobile): improve keyboard avoiding (#5451) 2026-08-07 09:40:06 +00:00
Theo BrowneandClaude Fable 5 a1762fdd74 fix(dev): Improve instructions for --share (#5586)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 09:28:51 +00:00
Theo BrowneandClaude Fable 5 388b43a27c perf(dev): faster cold-start for dev web serving (#5584)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 02:28:00 -07:00
Theo BrowneandClaude Fable 5 23f0a1ae38 fix(web): reading a thread clears Done; Woke is dismissible (#5579)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 02:09:16 -07:00
85b1734d4d feat(web): add modular theme library (#5226)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: maria-rcks <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-08-07 10:37:43 +02:00
Theo BrowneandClaude Opus 5 3ffe84f968 fix(web): stop the sidebar "Working" label from pulsing (#5580)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-07 01:27:31 -07:00
Mateleo 220efad62b fix: add missing space before 'GitHub releases page' link on download page (#4511) 2026-08-07 01:21:18 -07:00
Theo BrowneandClaude Fable 5 b98a0f0d22 fix(mobile): invisible T3 Connect devices can now be seen and removed (#5563)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 00:58:26 -07:00
Theo BrowneandClaude Opus 5 95305c36fa feat(web): per-device provider settings (#4479)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-07 00:57:22 -07:00
Theo BrowneandClaude Fable 5 48aa875c0e feat(web): remove Build/Plan toggle from the composer (#5551)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 00:42:50 -07:00
Theo BrowneandClaude Fable 5 a8cd2ad2eb fix(web): plans stop hijacking the UI, fold into chat instead (#5558)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-07 00:16:14 -07:00
Theo BrowneandClaude Fable 5 4a07c1ca9d docs: ship production T3 Connect public config in .env.example (#5573)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-06 23:53:19 -07:00
Theo Browne cf5c9948c8 fix(web): keep agent panel rows stable (#5569) 2026-08-06 23:19:20 -07:00
Theo BrowneandClaude Opus 5 2288d416aa fix(web): stop the "requests are slow" warning from firing on every provider update (#5570)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-06 23:18:34 -07:00
Theo Browne ddfe45c66e test(server): catch client transfer regressions in CI (#5350) 2026-08-06 23:17:49 -07:00
Theo BrowneandClaude 9547cf2463 fix(server): one disconnecting client no longer blocks every reconnect (#5572)
Co-authored-by: Claude <[email protected]>
2026-08-06 23:15:40 -07:00
Theo BrowneandClaude Fable 5 1c7d059f55 fix: scrolling up during a running thread no longer snaps back to the bottom (#5566)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-06 21:32:01 -07:00
Theo Browne 6fa4576078 fix(server): settle stopped Claude subagents (#5568) 2026-08-06 21:15:59 -07:00
ae7b27de82 fix: prevent reconnect loops during server stalls (#5561)
Co-authored-by: t3-turbo-simulation <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Theo Browne <[email protected]>
2026-08-06 21:14:50 -07:00
Theo BrowneandClaude Fable 5 6b73b3defe feat: paginate thread loading with user-anchored turn windows (#5493)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-06 19:33:49 -07:00
Theo Browne 7aad7911f6 fix(server): let stopped threads settle immediately (#5553) 2026-08-06 18:43:13 -07:00
Theo Browne 6da92244cc fix(web): show one toast when snoozing threads in bulk (#5560) 2026-08-06 18:16:36 -07:00
Theo BrowneandClaude Fable 5 c471145e96 fix(server): stopping a Claude thread no longer shows an ede_diagnostic error (#5557)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-06 17:55:20 -07:00
Theo Browne 64a991ad45 fix(web): show remote environment for non-Git projects (#5555) 2026-08-06 17:55:00 -07:00
Theo BrowneandClaude Fable 5 0ec4fbc4a3 fix(server): stop showing commit/push/PR notices as errors in the work log (#5559)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-06 17:52:29 -07:00
Theo BrowneandClaude Fable 5 ea50b695a7 fix(web): update tooltip no longer dismisses when scrolling release notes (#5547)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-06 17:31:12 -07:00
Theo BrowneandClaude Fable 5 331c6dce7f fix(server): skip origin fetch when creating worktrees in repos without an origin remote (#5556)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-06 20:13:10 -04:00
Wout Stiens 4f5834ba72 fix(web): clear woke state on explicit thread actions (#5486) 2026-08-06 14:08:35 -04:00
Wout Stiens aa16c180e5 fix(web): align composer inline chips with prompt text (#5495) 2026-08-06 12:57:02 -04:00
Carlos Rico-OspinaandClaude Opus 5 470d4eb993 fix(mobile): stop thread messages reading through pending cards (#5450)
Co-authored-by: Claude Opus 5 <[email protected]>
2026-08-06 12:56:01 -04:00
t3-code[bot] 99d91ddaa4 fix(acp): keep unknown approvals actionable (#5430)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
2026-08-06 12:55:31 -04:00
t3-code[bot] ab3b55e29a fix(web): clarify auto permission fallback (#5431)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
2026-08-06 12:55:00 -04:00
Theo BrowneandClaude Fable 5 e4abc31f1e docs(server): pin interleaved-collapse divergence as intentional with test
Bugbot flagged that clients collapse only adjacent lifecycle rows, so
dropping a superseded update separated by an interleaved parallel call
diverges from full-history rendering. Measured on a real database: 1.5%
of dropped rows (553/36,581), all pure in-flight state whose final result
the retained completion still shows, and zero dropped rows carry a
client-merged payload field their completion lacks (verified across all
49,515 update rows). Documents the tradeoff and adds a test pinning it.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-06 08:24:08 -04:00
Theo BrowneandClaude Fable 5 b7d1981b57 fix(server): drop superseded tool updates from snapshots
A tool.updated row is the in-flight snapshot of a call; once the call
completes, the tool.completed row carries the final state and both
clients fold every matching update into it. Shipping the updates buys
nothing: 47k such rows exist in one real database, and a single thread
carries 3,291 of them.

Filter them out of thread snapshots, mirroring the existing
context-window dedup. Matching is per turn and only against a LATER
completion, so a revert that discards the completing turn cannot leave
a call unrepresented, and a later update under the same identity (the
next call, still in flight) survives. Live events are untouched.

Rows are matched on the same identity the clients collapse by: an
explicit data.toolCallId when the adapter emits one, otherwise the
itemType/title/detail triple. No tool lifecycle row in the real db
carries a toolCallId, so the fallback does the work.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-06 08:24:08 -04:00
Theo Browne 64a3cd6d7d fix(server): separate trial cleanup from handoff retention 2026-08-06 08:09:51 -04:00
Theo Browne 48e2c27f2f fix(web): make update version tooltips accessible 2026-08-06 08:09:51 -04:00
Theo Browne 8b2ea5721a fix(server): order explicit service shutdown 2026-08-06 08:09:51 -04:00
Theo Browne df2f1273e9 fix(server): clean up interrupted update trials 2026-08-06 08:09:51 -04:00
Theo BrowneandClaude Fable 5 f9e8236899 fix(server): release the tunnel when an explicit stop interrupts an update
A pending update in the launcher state is not proof a replacement
server is coming: `t3 service uninstall` or `systemctl stop` during
the pending window also tears the server down, permanently. The
launcher now writes a stop marker before signalling its child on an
explicit stop and clears it on the next start; the shutdown tunnel
release keeps the tunnel only for pending updates without the marker.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-06 08:09:51 -04:00
Theo BrowneandClaude Fable 5 8f341f20c9 test(server): use the launcher state writer in release tests
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-06 08:09:51 -04:00
Theo BrowneandClaude Fable 5 808d685355 fix(server): keep the managed tunnel across remote update restarts
Measured on a live update: the server was back in ~9s but stayed
unreachable for ~96s, because releasing the tunnel on shutdown forces
the replacement tunnel's hostname route through 1-2 minutes of edge
propagation. An update handoff always brings a server right back
(new version or rollback), so the tunnel is never orphaned; skip the
release when the launcher state file records a pending update. The
next boot respawns the connector from the stored config against the
same tunnel and is reachable as soon as it connects.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-06 08:09:51 -04:00
Theo BrowneandClaude Fable 5 80720ad592 fix(web): calm one-row server update status and banner
The version-skew banner is no longer an amber warning: it reads
"Server update available" with the raw versions (unreadable for
nightlies) moved to a tooltip. The in-flight rail (Download/Install/
Resume) becomes a single status row, "Downloading…" then
"Restarting…", since the wire installing stage is a sub-second
launcher handoff and "resuming" meant nothing to most people.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-06 08:09:51 -04:00
Hugo Blom a483337a02 fix: respect time format for sidebar snooze (#4438) 2026-08-06 11:40:58 +02:00
Theo BrowneandClaude Fable 5 1ffba7093a fix(web): closed plan sidebar stays closed when returning to a thread (#5484)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-06 02:37:27 -07:00
Theo BrowneandClaude Fable 5 3da315e7b5 perf(server): stop shipping full MCP tool results in thread payloads (#5482)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-06 02:34:27 -07:00
Theo BrowneandClaude Fable 5 a2ca89aa10 feat: native subagent & workflow observability (#5219)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-06 00:32:28 -04:00
Theo BrowneandClaude Fable 5 990bb0b689 fix: reconnect faster after remote server updates (#5404)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-05 19:12:52 -07:00
Julius Marminge 7251f1a1f1 Prevent terminal loading flash (#5432) 2026-08-05 23:09:23 +02:00
t3-code[bot] 30e471530b fix(web): preserve terminal font size when splitting (#5444)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
2026-08-05 17:02:53 -04:00
Julius Marminge de592a00e8 Enrich terminal font previews (#5428) 2026-08-05 16:03:10 +00:00
Wout Stiens 2a04db134c fix(web): keep terminal font settings reliable (#5397) 2026-08-05 13:42:56 +02:00
Theo Browne 37d3667de4 fix(web): keep model picker shortcuts in sync (#5400) 2026-08-05 04:23:18 -07:00
Theo Browne 9697b765e5 fix(ci): isolate releases from shared API rate limits (#5394) 2026-08-05 02:36:10 -07:00
Wout Stiens 9d9a872bcc fix(web): restore terminal link hover styles (#5382) 2026-08-05 11:20:17 +02:00
Wout Stiens 9235c83eb7 fix(web): keep the composer command menu anchored to the composer (#5336) 2026-08-05 11:19:58 +02:00
shivamandT3 Code Test e0c85a20ef fix(mobile): avoid double dividers between thread sections (#5391)
Co-authored-by: T3 Code Test <[email protected]>
2026-08-05 13:28:10 +05:30
Fllip 3c5bdb84a9 fix(web): truncate long project switcher names (#5348) 2026-08-05 02:03:56 -04:00
shivam 70de6e1786 fix(mobile): prevent Android thread search crash (#5386) 2026-08-05 11:30:10 +05:30
shivamandT3 Code Test 47dfc65265 fix(mobile): preserve grouped project workspaces (#4642)
Co-authored-by: T3 Code Test <[email protected]>
2026-08-05 10:51:35 +05:30
Theo Browne 41ebf22eea fix(web): clear main branch lint warnings (#5384) 2026-08-04 21:31:39 -07:00
Hwanseo Choi 3d429662c9 fix(mcp): unblock Kimi models in OpenCode with preview tools (#5128) 2026-08-04 23:03:15 -04:00
Theo Browne 7b38fb5c6b fix(server): allow remote updates with database migrations (#5374) 2026-08-04 18:41:56 -07:00
Fllip 7537adc30f fix(web): prevent legacy model picker layout shift (#5349) 2026-08-04 20:05:44 -04:00
Theo Browne 94696b0f54 fix(desktop,web): improve in-app browser shortcuts and URL behavior (#4703) 2026-08-04 17:01:34 -07:00
Theo BrowneandClaude Fable 5 fff6a5b028 feat(web): make pairing QR codes actually scannable, with endpoint choice (#5360)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-04 16:53:54 -07:00
Theo BrowneandClaude Fable 5 da6e1a9678 feat(sidebar-v2): thread pinning for sidebar v2 (#5312)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-04 16:35:51 -07:00
8eca20005b feat(web): configurable fonts and sizes under Settings → Appearance (#5103)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-08-05 00:55:06 +02:00
Theo Browne 2fa1fec8d8 refactor(server): make title prompts plaintext (#5368) 2026-08-04 15:51:56 -07:00
Theo Browne 9bd2a4c688 fix(server): keep regenerated titles on topic (#5365) 2026-08-04 15:32:05 -07:00
maria 4fb03aff0b fix(web): better right panel (new diffs styling) (#5260) 2026-08-05 00:00:24 +02:00
Theo Browne d7950ac153 fix(server): generate durable thread titles (#5357) 2026-08-04 14:02:33 -07:00
Theo BrowneandClaude Fable 5 36caf34c68 fix(desktop,web): contain renderer memory growth and recover from renderer OOM crashes (#5148)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-04 13:37:03 -07:00
Bilal Bakr 90e3778660 fix(web): stop the chat timeline reading through the provider status banner (#5353) 2026-08-04 15:41:07 -04:00
Rushikesh Gaikwad 94331c58ec fix(mobile): show correct provider icons for Grok, Cursor, and OpenCode (#4586) 2026-08-04 11:04:37 -07:00
Arham AminandClaude Opus 4.8 c30a6d9b99 fix(server): scrub AppImage XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR from terminals (#5075)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-04 09:35:10 -04:00
Yukun Shan 37ae1abbe9 fix(ssh): isolate managed tunnel processes (#4347) 2026-08-04 09:34:23 -04:00
Arham AminandClaude Opus 4.8 82b76e2138 fix(server): use a Cursor todo's title when its content is blank (#5073)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-04 09:19:12 -04:00
naMqe 8a16cadbaf fix(web): increase tooltip z-index to overlay popovers and menus (#5326) 2026-08-04 09:18:34 -04:00
Julius Marminge 2b1d4fecb8 Upgrade Effect to beta.103 (#5331) 2026-08-04 13:56:50 +02:00
t3-code[bot] cec1bb9de3 fix(web): align multiline error alert controls (#5304) 2026-08-04 13:34:22 +02:00
t3-code[bot] 25ec0b9d13 fix(web): simplify chat code blocks (#5301) 2026-08-04 13:34:10 +02:00
Rodrigo BrechardandRodrigo Brechard 966cc05a90 fix(contracts): decode ServerProviders forward-compatibly (#5327)
Co-authored-by: Rodrigo Brechard <[email protected]>
2026-08-04 13:07:22 +02:00
Wout Stiens 1cbd88aba0 fix(server): strip replayable terminal queries from history (#5319) 2026-08-04 12:52:05 +02:00
Wout Stiens 553867262c fix(terminal): protect held Ctrl/Cmd+W close shortcut (#5322) 2026-08-04 12:51:36 +02:00
Wout StiensandClaude Opus 5 11639bf439 fix(web): blink the terminal cursor again (#5314)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-04 12:50:19 +02:00
t3-code[bot] a261a6440a fix(web): match loading screen to dark theme (#5303) 2026-08-04 00:50:56 +02:00
Mike OlsonandJulius Marminge 6f04a5cffb fix(desktop): Niri/Hyprland - Linux secret storage backend (#2916)
Co-authored-by: Julius Marminge <[email protected]>
2026-08-03 22:02:47 +02:00
maria 30c9622806 fix(web): polish interface spacing (#5252) 2026-08-02 23:35:04 -04:00
Julius Marminge 69dfb7f09a fix(desktop): claim the t3code:// scheme default on Linux at startup (#5054) 2026-08-02 21:53:37 +00:00
Theo Browne e60821f0e0 feat: fold legacy models into separate menus (#5190) 2026-08-02 00:45:05 -07:00
Theo BrowneandClaude 64bf016191 fix(server): stop npx service updates from silently leaving the old server running (#5217)
Co-authored-by: Claude <[email protected]>
2026-08-01 22:42:39 -07:00
Arham AminandClaude Opus 4.8 5192f777fe fix(server): surface cloudflared FTL/PNC relay logs as warnings, not debug (#5076)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-01 16:10:25 -04:00
t3-code[bot] 283c7ac4ba fix: normalize app icon glyph sizing (#5202)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
2026-08-01 15:21:40 -04:00
Illia Panasenko 78eb3ecae9 fix(web): stop settle controls overlapping the status label (#4574) 2026-08-01 15:06:31 -04:00
Theo Browne d3037064e6 fix(server): make remote updates rollback-safe (#5181) 2026-08-01 05:48:03 -07:00
Theo BrowneandClaude Fable 5 0ad91b6e7f fix(server): follow branch drift in dedicated worktrees so PRs link to their thread (#5159)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 20:18:58 -07:00
Theo BrowneandClaude Fable 5 ca72e381c6 fix(server): bound thread catch-up replay and stop full-DB snapshot hydration (#5147)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 16:14:15 -07:00
Theo Browne 491219bf1f fix: threads with open PRs no longer auto-settle (#5151) 2026-07-31 15:46:15 -07:00
shivamandClaude Fable 5 e5c7547067 feat(web): add settings sidebar search (#4682)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 18:11:27 -04:00
shivamandClaude Fable 5 bfc31507f8 feat(web): search threads from the sidebar (#4769)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 16:52:20 -04:00
shivamandT3 Code Test 03adf215ce follow-up normalization after #4700. (#4498)
Co-authored-by: T3 Code Test <[email protected]>
2026-07-31 16:11:28 -04:00
Alex 916cff733c feat(mobile): make settled threads collapsible (#5056) 2026-07-31 14:55:29 -04:00
Gabriel De Andrade a041981276 feat(mobile): add thread snoozing (#5053) 2026-07-31 10:22:52 -04:00
Wout StiensandClaude Fable 5 964cc27901 refactor: move the canonical libghostty-vt vendor to the repository root (#5102)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 14:20:27 +02:00
Wout StiensandClaude Fable 5 acf761b2f5 feat(web): render terminals with libghostty-vt (#4860)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 13:15:25 +02:00
Julius MarmingeandClaude Fable 5 ab8182cb4e fix(ci): rotate iPad showcase captures without Simulator UI scripting (#5094)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 13:11:56 +02:00
Theo BrowneandClaude Fable 5 ef4ec2ad4b fix(server): self-update no longer rolls itself back on restart (#5095)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 03:46:47 -07:00
Theo BrowneandClaude Fable 5 61514c1294 feat(cli): npx t3 pair - generate QR code from a running server (#4955)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 03:18:55 -07:00
Mike Olson 894d6d68f5 fix(oxlint-plugin): Resolve the oxlint bin without assuming a pnpm layout (#5066) 2026-07-31 11:45:00 +02:00
Alex fccec9f097 fix(ci): capture iPad App Store screenshots in landscape (#5065) 2026-07-31 10:12:23 +02:00
Julius Marminge 50a3d6b872 fix(ci): repair the mobile showcase screenshots workflow (#5057) 2026-07-31 10:11:12 +02:00
Theo BrowneandClaude Fable 5 e259dd23c7 fix(mobile): server model, worktree, and origin preferences now apply to new tasks (#5064)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-30 21:21:39 -07:00
Julius MarmingeandClaude Fable 5 df78cda8bf fix(contracts): decode growing config unions forward-compatibly (#5055)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 01:11:46 +02:00
Alex 605c2bb734 fix(mobile): show the correct build channel in Android's Threads page header (#4861) 2026-07-30 22:30:46 +00:00
Aditya Vardhan Sharma cb11a71d63 fix(mobile): accept Android clipboard images in composer (#4836) 2026-07-31 00:20:33 +02:00
Simon DobaandClaude Opus 5 41124c7260 fix(desktop): link release notes from the update downloaded toast (#4771)
Co-authored-by: Claude Opus 5 <[email protected]>
2026-07-31 00:19:34 +02:00
Max Anderson b0b275227b chore: add mobile issue template area (#4895) 2026-07-31 00:19:00 +02:00
Alex cb293fe790 fix(mobile): restore iOS Threads branding (#4862) 2026-07-31 00:17:47 +02:00
Simone 1d694dcbd8 fix(mobile): default bare IP pairing to HTTP (#4990) 2026-07-30 22:17:38 +00:00
Arham AminandClaude Opus 4.8 32407df9c5 fix(shared): lenient JSON parser deletes commas inside string values (#5025)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-30 22:16:22 +00:00
Elaine Lyons 162e774294 fix(mobile): remove unnecessary photo library permission (#4929) 2026-07-31 00:15:38 +02:00
Arham AminandClaude Opus 4.8 063ed7120a feat(shared): support shorthand (major-only) versions in the semver helpers (#5027)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-30 22:13:46 +00:00
Utkarsh Patil 34b15a9ace perf(server): cache default branch name and origin existence across status refreshes (#5008) 2026-07-31 00:08:59 +02:00
Julius MarmingeandClaude Fable 5 fbecb7365e fix(desktop): bump Clerk Electron SDK to 0.0.24 and register t3code:// scheme on Linux (#5015)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 00:06:49 +02:00
Julius MarmingeandClaude Fable 5 4029b858ea fix(ci): drop sparse-checkout from EAS workflows
actions/checkout implements sparse-checkout with --filter=blob:none, so
the runner repo is a partial clone missing the .repos/ blobs. eas-cli
archives the project via `git clone --depth 1 file://<workspace>`,
which upload-pack cannot serve from a partial clone and exits 128
(#4802 broke both EAS build workflows this way).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-30 13:15:03 -07:00
maria 5b2577f6a9 style(web): make scroll-to-end pill translucent (#5036) 2026-07-30 20:08:05 +00:00
Julius MarmingeandClaude Fable 5 bc142f84a2 chore(mobile): bump app version to 1.0.1
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-30 13:07:10 -07:00
Theo Browne e4829603ff perf(ci): cut stale runs and redundant setup (#4802) 2026-07-30 14:25:31 -04:00
Gabriel De Andrade 1d77cec991 fix: cache project favicons across web and mobile (#4767) 2026-07-30 14:13:50 -04:00
maria 4ba4871af7 fix(web): fill fast mode icon (#5004) 2026-07-30 12:42:21 -04:00
Wout Stiens edc503a7a8 fix(server): restore PR detection without HOME (#4985) 2026-07-30 12:17:44 -04:00
Gabriel De Andrade 323dc321a2 fix(mobile): support pre-Liquid-Glass iOS bottom toolbar (#4984) 2026-07-30 12:01:14 -04:00
Julius Marmingeandcodex 6154b46cb8 Check for mobile app updates on launch (#4958)
Co-authored-by: codex <[email protected]>
2026-07-30 16:57:00 +02:00
abc409c2d4 Add project file picker (⌘P) and project content search (⇧⌘F) (#4855)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-30 16:39:15 +02:00
Theo BrowneandClaude Fable 5 1877237c7a fix(connect): reboots no longer strand the relay link, 403s now say why (#4988)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-30 07:31:53 -07:00
Theo BrowneandClaude Fable 5 e0513d2983 fix(web): server updates no longer look like warnings (#4992)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-30 07:30:24 -07:00
Theo BrowneandClaude Fable 5 9dd425b223 docs: split user and maintainer docs, fix 100+ stale claims (#4807)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-30 06:10:47 -07:00
Theo BrowneandClaude Fable 5 50871eb5de fix: marketing site Vercel builds no longer die after ~100 deploys (#4975)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-30 05:31:42 -07:00
Theo Browne 4b71a2ae2f feat(search): find threads by conversation content (#4959) 2026-07-30 05:30:11 -07:00
Theo Browne 197d348711 fix(web): show server update progress through reconnect (#4903) 2026-07-30 04:45:04 -07:00
Theo Browne 5c9358acaa feat(web): regenerate thread titles from sidebar (#4810) 2026-07-30 04:39:38 -07:00
Theo BrowneandClaude Fable 5 cbe8052020 feat(web): pasting a huge screenshot now compresses it instead of erroring (#4967)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-30 04:35:06 -07:00
Theo Browne 69a18ce912 perf(mobile): reconnect environments immediately on resume (#4878) 2026-07-30 04:10:26 -07:00
Theo BrowneandClaude Fable 5 f0c6ba9946 fix(web): keep worktree default when switching a draft's machine (#4964)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-30 03:48:33 -07:00
Theo BrowneandClaude Fable 5 90f3913a81 fix(mobile): stop long iOS threads from jumping while scrolling up (#4867)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-30 03:05:25 -07:00
Theo Browne 2652fee49b fix(mobile): support dragged images in the composer (#4953) 2026-07-30 03:01:56 -07:00
Theo BrowneandClaude Fable 5 2f466ffc9c docs: seed worktrees with a copy of real userdata instead of banning it (#4949)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-30 09:29:27 +00:00
Theo Browne 9146ed2f49 fix(web): show Codex fast mode as a bolt (#4947) 2026-07-30 02:15:48 -07:00
Theo BrowneandClaude Fable 5 f0f16e4f6e perf(mobile): sends respond instantly, thread opens stop freezing (#4882)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-30 01:54:59 -07:00
Theo Browne 00da6b57a4 fix(mobile): stop shared content errors in Personal Team builds (#4943) 2026-07-30 01:48:16 -07:00
Theo BrowneandClaude Fable 5 6ab2f16809 fix(connect): suggest a serve command that matches how you ran connect (#4897)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-30 01:46:10 -07:00
Wout Stiens 6efcf3e10c fix(web): align remote server update action (#4731) 2026-07-30 01:30:23 -04:00
Theo BrowneandClaude Fable 5 748203ea19 docs: link iOS and Android app store downloads (#4902)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-29 21:54:08 -07:00
Max Katz b125b76351 fix(composer): hide default Codex service tier (#4784) 2026-07-29 22:35:53 -04:00
Wout Stiens 758decaa56 fix(clients): disable add project while disconnected (#4834) 2026-07-29 22:14:06 -04:00
Theo BrowneandClaude Fable 5 2d9066e089 fix(web): settle button now works on hover, not just right-click (#4905)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-29 19:01:24 -07:00
Jono Kemball 35a684000d fix(web): restore sidebar v2 thread actions and terminal icon (#4712) 2026-07-29 21:48:01 -04:00
Gabriel De Andrade 9e3e9bb4f0 fix(mobile): reduce thread feed scroll jank (#4874) 2026-07-29 21:21:16 -04:00
t3-code[bot] a8e05cbb92 chore(release): prepare v0.0.31 2026-07-29 20:56:43 +00:00
e6987965f6 fix(web): remember the rendered-markdown choice across threads (#4853)
Co-authored-by: Simon Doba <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
2026-07-29 18:01:03 +00:00
Jake Leventhal fc28abf24b Fix editable file focus and live syntax highlighting (#3979) 2026-07-29 19:06:39 +02:00
ohbentos 85a8986870 fix(git): disable external diff for review diff previews (#4854) 2026-07-29 16:27:00 +00:00
Utkarsh Patil faea70aeba perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat (#4843) 2026-07-29 18:24:11 +02:00
Wout Stiens d19039aeef fix(server): detect repositories after initialization (#4848) 2026-07-29 11:48:57 -04:00
Julius Marmingeandcodex 49c0d96edf Reduce idle work and disk churn with native resource diagnostics (#2679)
Co-authored-by: codex <[email protected]>
2026-07-29 14:42:01 +02:00
Julius Marminge 3137c2b162 Preserve the thread shell while detail loads (#4830) 2026-07-29 13:54:17 +02:00
Julius Marminge c3e8fb67d7 Update model version from claude-opus-4-8 to claude-opus-5 (#4832) 2026-07-29 11:39:24 +00:00
wukko 72b960fa39 build(desktop): reduce installed app size by ~300MB (#4824) 2026-07-29 12:39:23 +02:00
Julius Marminge 08e4932f04 Simplify files panel header (#4828) 2026-07-29 10:36:54 +00:00
1b4830ff06 fix(desktop): restore T3 Connect sign-in (#4809)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-29 10:59:12 +02:00
t3-code[bot] 694f8d1c6e chore(release): prepare v0.0.30 2026-07-29 01:12:24 +00:00
Julius Marminge 1b61ce1112 Fix Connect sign-in settings label (#4806) 2026-07-29 01:03:04 +00:00
Julius Marminge 60af905e70 Remove Connect waitlist and add GA announcement tooling (#4691) 2026-07-29 02:29:01 +02:00
Julius Marmingeandcodex 8650f05f95 refactor(server): use native HTTP compression streams (#4798)
Co-authored-by: codex <[email protected]>
2026-07-29 00:03:39 +00:00
Julius Marmingeandcodex 8fe8f9a9c1 fix(mobile): defer filesystem navigation (#4799)
Co-authored-by: codex <[email protected]>
2026-07-29 01:46:59 +02:00
Julius Marmingeandcodex 936593c258 refactor(client): share filesystem browse navigation (#4797)
Co-authored-by: codex <[email protected]>
2026-07-29 01:24:29 +02:00
Theo Browne 2919147c80 fix(release): skip scripts during Vercel installs (#4796) 2026-07-28 16:16:14 -07:00
Julius Marmingeandcodex 1ba3d01bc6 fix(web): defer command palette filesystem navigation (#2109)
Co-authored-by: codex <[email protected]>
2026-07-29 00:58:38 +02:00
Theo BrowneandClaude Fable 5 5fcdefd057 perf(server): trim stale context-window rows and drop dead replay RPC (#4791)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-28 15:50:43 -07:00
Julius Marmingeandcodex 38a6e3ce65 Fix Git ref refresh resource storms (#4727)
Co-authored-by: codex <[email protected]>
2026-07-29 00:42:50 +02:00
Theo BrowneandClaude Fable 5 f2d2fb2f24 fix(web): stashed prompts now survive switching providers (#4787)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-28 15:22:22 -07:00
Theo Browne 8829e2f9b9 perf(server): gzip large thread snapshots (#4788) 2026-07-28 15:17:30 -07:00
Julius Marminge 2deea7abb0 Prevent sidebar row labels from truncating (#4789) 2026-07-28 21:58:21 +00:00
Theo Browne b64ae880e0 docs: overhaul agent guidance (#4782) 2026-07-28 14:10:26 -07:00
Theo BrowneandClaude Fable 5 887dd6e455 perf(server): negotiate permessage-deflate on the websocket (#4705)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-28 06:03:03 -07:00
Julius MarmingeandClaude f1a68ac9b0 Fix Android showcase capture and rebuild v2 queued rows (#4730)
Co-authored-by: Claude <[email protected]>
2026-07-28 14:09:34 +02:00
Julius MarmingeandClaude Fable 5 55dd01612e Link inline code file paths in chat markdown (#4726)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-28 13:37:36 +02:00
jan 3c50a64885 fix(web): prevent diff panel scroll jumping (#4724) 2026-07-28 12:29:18 +02:00
jan 9ccfd9dfef fix(desktop): allow updater-controlled relaunch (#4721) 2026-07-28 11:45:02 +02:00
Max Katz 4f584da0f8 feat(web): add appearance settings category (#4715) 2026-07-28 11:28:29 +02:00
Max Katz 362f127922 feat(web): add maria's sidebar header artwork toggle (#4652) 2026-07-28 11:17:45 +02:00
Theo Browne 9cf9fc9c5c Settle merged PR threads immediately (#4704) 2026-07-28 11:15:14 +02:00
Julius Marmingeandcodex e00781a661 Fix relay credential lookup for unlinked environments (#4692)
Co-authored-by: codex <[email protected]>
2026-07-28 11:12:07 +02:00
Julius Marminge d25b15737a Fix mobile showcase workflow without Clerk (#4718) 2026-07-28 11:08:43 +02:00
Julius Marminge b0c4992c79 Make mobile Thread List v2 the default (#4717) 2026-07-28 10:48:31 +02:00
Max Katz dd5ea32488 fix(web): 33 web UI fixes (#4700) 2026-07-27 21:43:49 -07:00
Theo BrowneandClaude Opus 5 c13a021e43 feat: default sidebar v2 on for nightly and dev builds (#4491)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-07-27 21:41:08 -07:00
Theo BrowneandClaude Fable 5 476d69cd1d fix(mobile): threads load snapped to bottom on iOS (#4689)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-27 19:24:44 -07:00
Julius Marminge a148e08197 Add OTA update checks to mobile settings (#4686) 2026-07-28 00:55:00 +02:00
t3-code[bot] 831eb66fee chore(release): prepare v0.0.29 2026-07-27 22:37:18 +00:00
Krzysztof Moch 1153afb4fb fix(mobile): match react version to react-native 0.85.3 vendored renderer (19.2.3) (#4675) 2026-07-27 23:25:07 +02:00
Julius Marmingeandcodex a2ffb122e2 Show origin ref in branch trigger label (#4680)
Co-authored-by: codex <[email protected]>
2026-07-27 23:13:11 +02:00
Julius Marminge 3957a95818 Use glass surfaces for web toasts (#4681) 2026-07-27 23:06:39 +02:00
Julius Marminge 6a3df51707 Fix sidebar highlighting for draft threads (#4679) 2026-07-27 22:48:45 +02:00
Julius Marminge 6afbed3c36 Clear provider update actions while updating (#4676) 2026-07-27 20:07:23 +00:00
jan eea3ea4c6f feat(diff-panel): show total line additions and deletions (#4674) 2026-07-27 22:05:15 +02:00
10bca3f44e feat: add configurable source control writing settings (#4204)
Co-authored-by: Claude <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-27 22:02:15 +02:00
Julius Marmingeandcodex e77f42c111 Prevent draft thread detail polling before shell registration (#4670)
Co-authored-by: codex <[email protected]>
2026-07-27 21:52:11 +02:00
maria 6e3b73884b fix(server): bound editor discovery during config loading (#4291) 2026-07-27 21:18:55 +02:00
Julius Marminge 5ba6ef7f84 Use tarball archiving for hosted web deploys (#4669) 2026-07-27 21:15:40 +02:00
Julius Marminge 80ead5f3a7 Add glass styling for thread tooltips and simplify preview tab handling (#4665) 2026-07-27 20:28:01 +02:00
Julius Marmingeandcodex 32af2f0024 fix(preview): stabilize PiP viewport identity (#4661)
Co-authored-by: codex <[email protected]>
2026-07-27 20:08:28 +02:00
jan f0121f31d0 fix: close actions dropdown when editing (#4660) 2026-07-27 19:59:21 +02:00
Julius Marminge 0e19c103ef Keep MCP credentials alive across provider turns (#4659) 2026-07-27 19:57:22 +02:00
Max Katz 32843c2551 fix(web): constrain branch toolbar context (#4657) 2026-07-27 12:42:33 -04:00
Julius Marminge da11342e03 Fix live sidebar resize limits and defer Alchemy runtime context (#4655) 2026-07-27 18:07:40 +02:00
Julius Marmingeandcodex 180620e436 Fix Relay Worker RuntimeContext wiring (#4653)
Co-authored-by: codex <[email protected]>
2026-07-27 15:59:55 +00:00
Julius MarmingeandClaude Fable 5 96398e3775 feat(connect): release the Cloudflare tunnel when the environment shuts down (#4531)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-27 17:33:41 +02:00
Julius Marmingeandcodex d2d40b6c1a Drop redundant Relay user indexes (#4648)
Co-authored-by: codex <[email protected]>
2026-07-27 15:03:07 +00:00
Julius Marmingeandcodex 724887717f fix(web): scope PR state to the thread branch (#4460)
Co-authored-by: codex <[email protected]>
2026-07-27 17:00:19 +02:00
jan bdf99c17bf feat: allow new thread creation through project breadcrumbs (#4638) 2026-07-27 16:46:09 +02:00
Julius Marminge 108e01746c Upgrade Effect and Alchemy betas (#4643)
Prepare Relay production infrastructure for the PlanetScale PS_20 HA topology, upgrade Effect and Alchemy to compatible betas, reconcile migration state, and preserve patched MCP session termination behavior.\n\nCo-authored-by: codex <[email protected]>
2026-07-27 16:21:02 +02:00
Theo BrowneandClaude Fable 5 200fa826b0 feat(web): prompt stash — cmd+S saves the composer to a per-provider queue (#4453)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-27 06:34:13 -07:00
Julius Marmingeandcodex f4c394323d Add background preview capture and picture-in-picture support (#4397)
Co-authored-by: codex <[email protected]>
2026-07-27 13:58:17 +02:00
Julius Marminge 2b06c08a4b Add managed tunnel limits migration (#4635) 2026-07-27 11:56:49 +00:00
Julius MarmingeandClaude Fable 5 a78f245dff feat(relay): limit managed tunnels per user (#4530)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-27 13:51:31 +02:00
Theo Browne 23ea08daf2 test: account for lazy thread feed details (#4628) 2026-07-27 03:44:29 -07:00
Alex Southwell b4680cbfd0 perf(mobile): defer work-log detail serialization (#4607) 2026-07-27 03:03:49 -07:00
Theo Browne d60f6e971f fix: cut websocket throughput in half by pruning activity payloads (#4622) 2026-07-27 02:56:34 -07:00
Theo Browne 89c5a192f4 fix(dev): skip browser-blocked ports (#4608) 2026-07-26 20:26:21 -07:00
Theo BrowneandClaude Opus 5 23b5502217 feat(dev): Make t3 code dev instances shareable over Tailscale (#4556)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 19:48:09 -07:00
Theo BrowneandClaude Opus 5 a17cbc3b40 feat(dev): keep worktree dev state isolated on T3 Code dev servers (#4555)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 15:26:59 -07:00
Theo BrowneandClaude Opus 5 5719e8ac40 feat(web): show fast mode as a bolt instead of a "Normal" label (#4488)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-07-24 19:28:37 -07:00
jan 38cfc25e54 feat(web): add collapse-all toggle to diff panel (#4475) 2026-07-24 18:15:45 -04:00
41a430a88e Add Claude Opus 5 model (#4472)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: Theo Browne <[email protected]>
2026-07-24 13:16:33 -07:00
13663 changed files with 1484781 additions and 246879 deletions

No files matched your search

+17 -16
View File
@@ -13,13 +13,25 @@ Use this skill for the web client. For iOS Simulator, Android Emulator, or physi
2. Choose a base directory that belongs only to the current worktree or test:
- Use the repository's ignored `.t3` directory for reusable worktree-local state.
- Use `mktemp -d /tmp/t3code-test.XXXXXX` for disposable state and retain the printed absolute path.
3. Start the full web stack with `vp run dev --home-dir <base-dir>`.
3. Start the full web stack with `vp run dev`. Add `--share` when the user needs to open it from another tailnet device. In a linked worktree it defaults to that worktree's gitignored `.t3`; pass `--home-dir <base-dir>` only when the test needs a different isolated directory.
4. Keep the terminal session alive and read the selected server port, web port, base directory, and pairing URL from its output.
Treat a base directory as disposable only when it was created or deliberately selected for the current test. Never delete or directly seed the shared `~/.t3` directory. Prefer starting with a new temporary base directory over clearing state of uncertain ownership.
The worktree-local default deliberately outranks an ambient `T3CODE_HOME`; do not pass the shared home through to a worktree dev server.
Ports are derived from the worktree path but can shift when occupied. Always read the actual values from the `[dev-runner]` line.
Shared browser dev is single-origin: Vite proxies the backend paths, so never set `VITE_HTTP_URL` or `VITE_WS_URL` for `dev`/`dev:web`.
The dev runner disables browser auto-open by default. Do not pass `--browser` during automated testing: an automatically opened page can consume the one-time bootstrap token before the controlled browser uses it.
### Verify a shared environment before human handoff
When another person will use the printed pairing URL, first open the shared origin without the pairing path or fragment in the controlled browser and confirm the T3 Code app loads. This browser navigation is required even when curl succeeds because browsers block some otherwise reachable ports before making a network request.
Do not open the other person's complete pairing URL during this reachability check; doing so consumes its one-time token. If the agent also needs an authenticated browser, create and consume a separate pairing token, then leave a fresh token for the other person.
## Preserve the environment while iterating
Treat the overall testing or implementation loop—not an assistant turn or one verification pass—as the environment lifecycle boundary.
@@ -28,7 +40,7 @@ Treat the overall testing or implementation loop—not an assistant turn or one
- Do not stop the server merely because one verification pass completed or because you are yielding a response to the user.
- Before starting another environment, check whether the existing process and browser tab still serve the task. Reuse them when healthy instead of discarding useful state.
- On a later turn, verify that the existing process is alive and reuse its printed ports and base directory. If it exited, restart with the same base directory; create a new pairing token only when the browser session is no longer valid.
- Tell the user when a test environment remains available, including its non-secret web URL when useful. Never include a pairing token.
- Tell the user when a test environment remains available, including its non-secret web URL when useful. Include a pairing token only when the user still needs to pair (see below).
## Authenticate the browser on the first navigation
@@ -38,24 +50,13 @@ Treat the overall testing or implementation loop—not an assistant turn or one
4. Wait for the pairing exchange and redirect to finish before navigating elsewhere.
5. Continue in the same browser context so its stored bearer session remains available.
Treat pairing URLs as secrets. Do not copy them into final responses, screenshots, committed files, or durable logs. A pairing token is short-lived and single-use; opening the URL in another browser or opening it twice can consume it.
Keep pairing URLs out of screenshots, committed files, and durable logs. When the user asked for a shared environment, the deliverable IS the full pairing URL — paste it in your reply, token and all; a bare origin is useless to them. A pairing token is short-lived and single-use; opening the URL in another browser or opening it twice can consume it, so never open a URL you handed to the user.
## Recover a consumed or expired pairing token
Create another token against the same database and web URL as the running dev server:
Run `node apps/server/src/bin.ts pair` from the repository root. It discovers the running dev server (worktree `.t3` first, same precedence as the dev runner) and prints a fresh `Pair URL` against the server's current web origin, including a `--share` tailnet origin. Pass `--base-dir <base-dir>` only when the server was started with `--home-dir`, using the identical path.
```bash
T3CODE_PORT=<server-port> node apps/server/src/bin.ts auth pairing create \
--base-dir <base-dir> \
--dev-url <web-url> \
--base-url <web-url> \
--ttl 15m \
--label agent-ui-test
```
Use the `Pair URL` from this command once. Derive `<server-port>` and `<web-url>` from the current dev-runner output, including any automatically selected port offset. Setting `T3CODE_PORT` keeps the administrative CLI from probing for an unrelated free port.
Always pass `--dev-url` for a dev-runner environment so the generated pairing URL uses the current web origin. An explicit base directory stores runtime state in `<base-dir>/userdata`; the `<base-dir>/dev` fallback is only used by an implicit dev home. Use `auth pairing list` to inspect active token metadata; it intentionally cannot reveal token secrets.
Tokens from `pair` carry standard client scopes. The startup pairing URL carries admin scopes; if the user needs Settings → Connections management (`access:write`), restart the server and hand over the new startup URL instead.
## Inspect or seed SQLite state
+17 -17
View File
@@ -66,7 +66,7 @@ Use these client origins:
- Android Emulator: `http://10.0.2.2:<server-port>`
- Physical device: bind the backend to `0.0.0.0` and use the host's reachable LAN origin
Always enter the complete `http://` origin; the mobile host field otherwise assumes HTTPS. When testing web and mobile together, run `vp run dev --home-dir <base-dir> --host 127.0.0.1` instead and do not launch a second backend over the same base directory.
Enter the complete `http://` origin to make the test transport explicit. Bare IP addresses default to HTTP, while bare hostnames default to HTTPS. When testing web and mobile together, run `vp run dev --home-dir <base-dir> --host 127.0.0.1` instead and do not launch a second backend over the same base directory.
## Start or reuse Metro safely
@@ -125,31 +125,29 @@ Do not start, stop, erase, or reconfigure an emulator owned by another task. Tra
## Pair each client once
Issue a fresh credential against the running backend's exact base directory:
Use the bundled helper from the repository root. It issues a fresh credential against the running backend's exact base directory, opens the existing Add Environment route with the credential in an encoded query parameter, and asks that route to connect once:
```bash
T3CODE_PORT=<server-port> node apps/server/src/bin.ts auth pairing create \
--base-dir <base-dir> \
--base-url <mobile-origin> \
--ttl 15m \
--label agent-mobile-<short-device-id>
.agents/skills/test-t3-mobile/scripts/pair-client.sh \
ios <simulator-udid> <server-port> <base-dir>
.agents/skills/test-t3-mobile/scripts/pair-client.sh \
android <emulator-serial> <server-port> <base-dir>
```
In PowerShell, set `$env:T3CODE_PORT = "<server-port>"` first and run the `node ... auth pairing create` command without the leading assignment.
Run only the command for the selected platform. The helper uses `http://127.0.0.1:<server-port>` for iOS and `http://10.0.2.2:<server-port>` for Android. Pass a fifth argument only when testing a non-development URL scheme.
If the visible Add Environment action is not exposed as a semantic target, open the app's registered route instead of guessing coordinates:
The helper opens this registered route:
```bash
xcrun simctl openurl <simulator-udid> 't3code-dev://connections/new'
adb -s <emulator-serial> shell am start -W \
-a android.intent.action.VIEW \
-d 't3code-dev://connections/new' \
com.t3tools.t3code.dev
```text
t3code-dev://connections/new?pairingUrl=<encoded-pairing-url>&autoConnect=1
```
Run only the command for the selected platform.
The Add Environment route owns the behavior: `pairingUrl` prefills its normal host and token inputs, while `autoConnect=1` submits once in development builds and returns to Home after success. Without `autoConnect`, the same route only prefills the form for manual inspection.
In T3 Code Dev, open Add Environment and enter the complete `<mobile-origin>` and newly printed `Token`. Verify the expected seeded projects appear before exercising the affected flow.
Do not enter pairing hosts or tokens through simulator keyboard automation. Xcode's semantic typer sends HID-style key events through the simulator's active keyboard state, which can corrupt uppercase tokens and punctuation even when the host Mac uses a U.S. input source. The one-shot route is the deterministic pairing path. Use the visible form only as a fallback, and paste credentials rather than typing them character by character.
Verify the expected seeded projects appear before exercising the affected flow.
Pairing credentials are secret, short-lived, and single-use. Create a different credential for every simulator, emulator, physical device, or browser. If an attempt fails, issue a new credential rather than retrying the old one. Do not expose tokens in screenshots, commits, or final responses.
@@ -183,6 +181,8 @@ Keep local verification focused. Do not turn this workflow into a full repositor
- **Old UI or an old error appears:** verify Metro's worktree, variant, URL, and port before diagnosing the app.
- **The environment remains empty:** verify the platform-specific HTTP origin, use a fresh token, and confirm project seeding used the identical base directory.
- **A second client cannot pair:** pairing tokens are single-use; issue another token.
- **The pairing form opens but does not connect:** confirm the deep link uses the existing `connections/new` route, includes `autoConnect=1`, and carries a freshly minted encoded `pairingUrl`.
- **Pairing text changes case or punctuation:** do not retry semantic typing. Use `scripts/pair-client.sh`; the simulator keyboard layout and HID input path are not reliable for credentials.
- **iOS semantic actions fail:** set explicit XcodeBuildMCP defaults and refresh with `snapshot_ui`.
- **Android cannot reach Metro:** verify `adb reverse` for the exact Metro port and relaunch the development-client URL.
- **Android cannot reach the backend:** use `10.0.2.2`, not `127.0.0.1`, for the Android Emulator.
+72
View File
@@ -0,0 +1,72 @@
#!/usr/bin/env bash
set -euo pipefail
usage() {
echo "Usage: $0 <ios|android> <device-id> <server-port> <base-dir> [url-scheme]" >&2
exit 2
}
[[ $# -ge 4 && $# -le 5 ]] || usage
platform="$1"
device_id="$2"
server_port="$3"
base_dir="$4"
url_scheme="${5:-t3code-dev}"
case "$platform" in
ios)
mobile_origin="http://127.0.0.1:${server_port}"
;;
android)
mobile_origin="http://10.0.2.2:${server_port}"
;;
*)
usage
;;
esac
repo_root="$(git rev-parse --show-toplevel)"
cd "$repo_root"
if ! pairing_output="$({
T3CODE_PORT="$server_port" node apps/server/src/bin.ts auth pairing create \
--base-dir "$base_dir" \
--base-url "$mobile_origin" \
--ttl 15m \
--label "agent-mobile-${device_id:0:8}"
} 2>&1)"; then
echo "Could not mint a mobile pairing credential." >&2
exit 1
fi
pairing_url="$(printf '%s\n' "$pairing_output" | sed -n 's/^Pair URL: //p' | tail -n 1)"
if [[ -z "$pairing_url" ]]; then
echo "Could not parse the mobile pairing URL." >&2
exit 1
fi
deep_link="$(PAIRING_URL="$pairing_url" URL_SCHEME="$url_scheme" node - <<'NODE'
const query = new URLSearchParams({
pairingUrl: process.env.PAIRING_URL,
autoConnect: "1",
});
process.stdout.write(`${process.env.URL_SCHEME}://connections/new?${query}`);
NODE
)"
case "$platform" in
ios)
xcrun simctl openurl "$device_id" "$deep_link"
;;
android)
# adb shell re-joins its arguments and evaluates them through the device
# shell, so the deep link's `?`/`&` must be quoted once more for that shell.
adb -s "$device_id" shell \
"am start -W -a android.intent.action.VIEW -d '$deep_link' com.t3tools.t3code.dev" \
>/dev/null
;;
esac
echo "Opened the existing Add Environment route with a fresh pairing credential."
+12 -9
View File
@@ -1,12 +1,14 @@
# Optional: T3 Connect source builds
# Leave these unset to disable optional T3 Connect features in local source builds.
# Release builds inject their public values at build time. Do not add server-side
# secrets to this file.
# `cp .env.example .env` enables T3 Connect against the production deployment.
# These are the same public identifiers baked into official release builds, not
# secrets. Remove or comment them out to build with cloud features disabled.
# Do not add server-side secrets to this file.
# Get these from the Clerk Dashboard under API keys, JWT templates, and OAuth applications.
# T3CODE_CLERK_PUBLISHABLE_KEY=pk_test_...
# T3CODE_CLERK_JWT_TEMPLATE=t3-relay
# T3CODE_CLERK_CLI_OAUTH_CLIENT_ID=oauthapp_...
# Production Clerk instance. To use your own, get these from the Clerk Dashboard
# under API keys, JWT templates, and OAuth applications.
T3CODE_CLERK_PUBLISHABLE_KEY=pk_live_Y2xlcmsudDMuY29kZXMk
T3CODE_CLERK_JWT_TEMPLATE=t3-relay
T3CODE_CLERK_CLI_OAUTH_CLIENT_ID=hzxSgY2cH10sDU2r
# Optional: signed macOS passkey builds. The RP domain defaults to the Frontend API
# hostname encoded in T3CODE_CLERK_PUBLISHABLE_KEY. Set the override only when Clerk
@@ -15,8 +17,9 @@
# T3CODE_MACOS_PROVISIONING_PROFILE=/absolute/path/to/t3code.provisionprofile
# T3CODE_CLERK_PASSKEY_RP_DOMAINS=example.clerk.accounts.dev,clerk.example.com
# Get this from your relay deployment. `infra/relay` deploys update it automatically.
# T3CODE_RELAY_URL=https://relay.example.com
# Production relay. For a self-hosted relay, `infra/relay` deploys update it
# automatically.
T3CODE_RELAY_URL=https://relay.t3.codes
# Optional: hosted app origin used by the CLI's out-of-band OAuth flow.
# Defaults to https://app.t3.codes; override to test against a staging deployment.
+1
View File
@@ -30,6 +30,7 @@ body:
- apps/web
- apps/server
- apps/desktop
- apps/mobile
- packages/contracts or packages/shared
- Build, CI, or release tooling
- Docs
@@ -30,6 +30,7 @@ body:
- apps/web
- apps/server
- apps/desktop
- apps/mobile
- packages/contracts or packages/shared
- Build, CI, or release tooling
- Docs
+6
View File
@@ -11,9 +11,11 @@
# Keep entries sorted alphabetically.
github:adityavardhansharma
github:binbandit
github:chrisdeeming
github:chuks-qua
github:cursoragent
github:gbarros-dev
github:gfsaaser24
github:github-actions[bot]
github:hwanseoc
github:jamesx0416
@@ -25,7 +27,9 @@ github:Noojuno
github:notkainoa
github:PatrickBauer
github:realAhmedRoach
github:saphid
github:shiroyasha9
github:StiensWout
github:Yash-Singh1
github:eggfriedrice24
github:Ymit24
@@ -33,3 +37,5 @@ github:shivamhwp
github:jappyjan
github:justsomelegs
github:UtkarshUsername
github:SunkenInTime
github:bil0000
+76 -3
View File
@@ -6,6 +6,10 @@ on:
branches:
- main
concurrency:
group: ci-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check:
name: Check
@@ -14,6 +18,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
@@ -22,6 +31,11 @@ jobs:
cache: true
run-install: true
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Ensure Electron runtime is installed
run: vp run --filter @t3tools/desktop ensure:electron
@@ -31,6 +45,9 @@ jobs:
- name: Typecheck
run: vpr typecheck
- name: Check resource monitor formatting
run: cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
- name: Build desktop pipeline
run: vp run build:desktop
@@ -47,6 +64,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
# Blacksmith boots GitHub's Ubuntu runner image (gcc is usually present),
# but ACP process-tree live tests compile a small pthread fixture with `cc`
# and soft-skip when it is missing. Install build-essential so that path
# always runs in CI instead of silently no-oping.
- name: Install C toolchain for process-tree fixtures
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential
command -v cc
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
@@ -55,26 +87,60 @@ jobs:
cache: true
run-install: true
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Ensure Electron runtime is installed
run: vp run --filter @t3tools/desktop ensure:electron
- name: Test
env:
T3CODE_TRANSFER_BUDGET_REPORT_PATH: ${{ runner.temp }}/t3code-transfer-budget.md
T3CODE_TRANSFER_BUDGET_RESULT_PATH: ${{ runner.temp }}/thread-transfer-result.json
run: vp run test
- name: Publish transfer budget report
if: always()
run: |
if test -f "${{ runner.temp }}/t3code-transfer-budget.md"; then
tee -a "$GITHUB_STEP_SUMMARY" < "${{ runner.temp }}/t3code-transfer-budget.md"
else
echo "Transfer budget report was not produced." >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload thread transfer result
if: always()
uses: actions/upload-artifact@v7
with:
name: thread-transfer-results
path: ${{ runner.temp }}/thread-transfer-result.json
if-no-files-found: ignore
retention-days: 30
- name: Test resource monitor
run: cargo test --locked --manifest-path native/resource-monitor/Cargo.toml
mobile_native_static_analysis:
name: Mobile Native Static Analysis
runs-on: blacksmith-12vcpu-macos-26
runs-on: blacksmith-6vcpu-macos-26
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
run-install: |
args:
- --filter=@t3tools/scripts...
- name: Install mobile native static analysis tools
run: brew bundle install --file apps/mobile/Brewfile
@@ -89,13 +155,20 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
run-install: |
args:
- --filter=@t3tools/scripts...
- name: Exercise release-only workflow steps
run: node scripts/release-smoke.ts
+8 -1
View File
@@ -38,13 +38,20 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
run-install: |
args:
- --filter=t3code-relay...
- name: Deploy production relay stage
id: deploy
+14 -3
View File
@@ -2,13 +2,18 @@ name: Mobile EAS Preview
on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]
types: [opened, reopened, synchronize, labeled]
jobs:
preview:
name: EAS Preview
if: contains(github.event.pull_request.labels.*.name, '🚀 Mobile Continuous Deployment')
if: |
contains(github.event.pull_request.labels.*.name, '🚀 Mobile Continuous Deployment') &&
(github.event.action != 'labeled' || github.event.label.name == '🚀 Mobile Continuous Deployment')
runs-on: blacksmith-8vcpu-ubuntu-2404
concurrency:
group: mobile-eas-preview-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
@@ -34,6 +39,10 @@ jobs:
uses: actions/checkout@v6
with:
fetch-depth: 0
# No sparse-checkout here: it makes actions/checkout fetch with
# --filter=blob:none, and eas-cli archives the project via
# `git clone --depth 1 file://<workspace>`, which fails (exit 128)
# when the partial clone can't serve the unfetched blobs.
- name: Setup Vite+
if: steps.expo-token.outputs.present == 'true'
@@ -41,7 +50,9 @@ jobs:
with:
node-version-file: package.json
cache: true
run-install: true
run-install: |
args:
- --filter=@t3tools/mobile...
- name: Expose pnpm
if: steps.expo-token.outputs.present == 'true'
+183 -6
View File
@@ -5,6 +5,25 @@ name: Mobile EAS Production
# in the same OS/pnpm as the EAS build; a macOS `eas build` computes a different
# fingerprint (platform-specific deps + pnpm version) and errors. On this Linux
# runner, with corepack pinning pnpm 10.24 in eas.json, local == build.
#
# Every merge to main that touches the mobile app reconciles, per platform:
# 1. Store builds: if the latest production build's version differs from
# app.config.ts, cut a new build and submit it (TestFlight + Play internal
# track). Bumping `version` is therefore all it takes to
# start the next release train — the first build of a version enters
# external-TestFlight beta review immediately, and later builds of the
# same version auto-approve until that version is released. After App
# Store approval, Apple closes the release train and `version` must be
# bumped before another iOS build can be submitted. Releasing to the App
# Store stays a manual App Store Connect step.
# 2. OTA: publish a production-channel update for each platform where at
# least one finished production build matches the current native
# fingerprint. Old-version binaries with a matching fingerprint receive
# it too. When native drift means no binary could install the update,
# it is skipped and flagged in the job summary instead of published
# into the void.
# workflow_dispatch remains as a manual override for both modes (e.g. to
# retry an errored build or force an OTA).
on:
workflow_dispatch:
inputs:
@@ -25,14 +44,38 @@ on:
- ios
- android
- all
version:
description: "Optional build version override (blank uses app.config.ts; an override is committed before building)"
required: false
type: string
message:
description: "OTA update message (mode=update only)"
required: false
type: string
push:
branches: [main]
paths:
- apps/mobile/**
- packages/client-runtime/**
- packages/contracts/**
- packages/shared/**
- assets/**
- scripts/**
- patches/**
- pnpm-lock.yaml
- pnpm-workspace.yaml
- .github/workflows/mobile-eas-production.yml
# Serialize runs so OTAs publish in merge order. GitHub keeps at most one
# queued run per group, so a burst of merges collapses into one run of the
# newest commit — intermediate commits don't need their own OTA.
concurrency:
group: mobile-eas-production
cancel-in-progress: false
jobs:
production:
name: EAS Production ${{ inputs.mode }}
name: EAS Production ${{ github.event_name == 'push' && 'auto' || inputs.mode }}
runs-on: blacksmith-8vcpu-ubuntu-2404
permissions:
contents: read
@@ -52,11 +95,25 @@ jobs:
echo "EXPO_TOKEN is not available; skipping EAS production job."
fi
- id: version_app_token
name: Mint release app token for version override
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build' && inputs.version != ''
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout
if: steps.expo-token.outputs.present == 'true'
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ steps.version_app_token.outputs.token || github.token }}
# No sparse-checkout here: it makes actions/checkout fetch with
# --filter=blob:none, and eas-cli archives the project via
# `git clone --depth 1 file://<workspace>`, which fails (exit 128)
# when the partial clone can't serve the unfetched blobs.
- name: Setup Vite+
if: steps.expo-token.outputs.present == 'true'
@@ -64,7 +121,9 @@ jobs:
with:
node-version-file: package.json
cache: true
run-install: true
run-install: |
args:
- --filter=@t3tools/mobile...
- name: Expose pnpm
if: steps.expo-token.outputs.present == 'true'
@@ -92,15 +151,74 @@ jobs:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: eas env:pull production --non-interactive
- name: Build and submit
if: steps.expo-token.outputs.present == 'true' && inputs.mode == 'build'
- name: Apply manual version override
if: steps.version_app_token.outcome == 'success'
env:
GH_TOKEN: ${{ steps.version_app_token.outputs.token }}
APP_SLUG: ${{ steps.version_app_token.outputs.app-slug }}
RELEASE_VERSION: ${{ inputs.version }}
run: |
if [ "$GITHUB_REF_TYPE" != "branch" ]; then
echo "Version overrides require dispatching this workflow from a branch; received $GITHUB_REF_TYPE '$GITHUB_REF_NAME'." >&2
exit 1
fi
if ! [[ "$RELEASE_VERSION" =~ ^[0-9]+(\.[0-9]+){1,2}$ ]]; then
echo "Version override must contain two or three dot-separated integers; received '$RELEASE_VERSION'." >&2
exit 1
fi
node --input-type=module -e '
import fs from "node:fs";
const path = "apps/mobile/app.config.ts";
const source = fs.readFileSync(path, "utf8");
const next = source.replace(
/^( version: ")[^"]+(".*)$/m,
`$1${process.env.RELEASE_VERSION}$2`,
);
if (next === source && !source.includes(` version: "${process.env.RELEASE_VERSION}"`)) {
throw new Error("Could not update app version");
}
fs.writeFileSync(path, next);
'
vp fmt apps/mobile/app.config.ts
if git diff --quiet -- apps/mobile/app.config.ts; then
echo "app.config.ts is already at $RELEASE_VERSION; no version commit needed."
exit 0
fi
user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
git config user.name "${APP_SLUG}[bot]"
git config user.email "${user_id}+${APP_SLUG}[bot]@users.noreply.github.com"
git add apps/mobile/app.config.ts
git commit \
-m "chore(mobile): bump app version to $RELEASE_VERSION" \
-m "Co-authored-by: codex <[email protected]>"
git push origin "HEAD:refs/heads/${GITHUB_REF_NAME}"
- name: Summarize manual build version
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'
working-directory: apps/mobile
run: |
version="$(npx expo config --json --type public | jq -r '.version')"
{
echo "## Manual production build"
echo
echo "- App version: \`$version\`"
echo "- Platform: \`${{ inputs.platform }}\`"
echo
echo "> Apple closes an iOS release train after App Store approval. Before building iOS, confirm \`$version\` is newer than the approved App Store version."
} >> "$GITHUB_STEP_SUMMARY"
- name: Build and submit (manual)
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'
working-directory: apps/mobile
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: eas build --platform ${{ inputs.platform }} --profile production --auto-submit --non-interactive --no-wait
- name: Publish OTA update
if: steps.expo-token.outputs.present == 'true' && inputs.mode == 'update'
- name: Publish OTA update (manual)
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'update'
working-directory: apps/mobile
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
@@ -111,3 +229,62 @@ jobs:
--platform ${{ inputs.platform }} \
--message "${{ inputs.message || format('Production OTA ({0})', github.sha) }}" \
--non-interactive
# No --status filter on build:list: an in-queue/in-progress build must
# count as existing, or every merge during the build window would cut a
# duplicate. After an errored build, retry via workflow_dispatch
# mode=build — pushes won't re-trigger it until the app version changes.
- id: store_builds
name: Ensure store builds exist for the current app version
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'push'
continue-on-error: true
working-directory: apps/mobile
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: |
failed=0
version="$(npx expo config --json --type public | jq -r '.version')"
for platform in ios android; do
latest="$(eas build:list --platform "$platform" --build-profile production --limit 1 --json --non-interactive | jq -r '.[0].appVersion // "none"')"
if [ "$latest" = "$version" ]; then
echo "$platform: production build for $version already exists (or is in progress)"
continue
fi
echo "$platform: latest production build is $latest, app.config.ts says $version — building"
if eas build --platform "$platform" --profile production --auto-submit --non-interactive --no-wait; then
echo ":building_construction: $platform: scheduled production build and submission for $version" >> "$GITHUB_STEP_SUMMARY"
else
failed=1
echo ":x: $platform: production build or submission failed for $version" >> "$GITHUB_STEP_SUMMARY"
fi
done
exit "$failed"
- name: Publish fingerprint-gated OTA
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'push'
working-directory: apps/mobile
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: |
message="$(git log -1 --pretty=%s | head -c 120) ($(git rev-parse --short=9 HEAD))"
for platform in ios android; do
# eas-cli prints an environment-loaded notice to stdout before the
# JSON even with --json, so discard everything before the document.
hash="$(eas fingerprint:generate --platform "$platform" --environment production --json --non-interactive | sed -n '/^{/,$p' | jq -er '.hash | select(type == "string" and length > 0)')"
matching="$(eas build:list --platform "$platform" --build-profile production --status finished --fingerprint-hash "$hash" --limit 1 --json --non-interactive | jq 'length')"
if [ "$matching" -gt 0 ]; then
eas update \
--channel production \
--environment production \
--platform "$platform" \
--message "$message" \
--non-interactive
echo ":white_check_mark: $platform: OTA published to production (fingerprint \`$hash\`)" >> "$GITHUB_STEP_SUMMARY"
else
echo ":warning: $platform: no finished production build matches fingerprint \`$hash\` — OTA skipped; JS changes reach $platform only once a matching build ships" >> "$GITHUB_STEP_SUMMARY"
fi
done
- name: Propagate store build failure
if: steps.store_builds.outcome == 'failure'
run: exit 1
@@ -0,0 +1,205 @@
name: Mobile Fingerprint Check
# Detects whether a PR changes the native fingerprint — i.e. whether merging
# it would leave main un-OTA-able until a new store build ships. Native-change
# PRs get the "📱 Native Change" label so they can be held and merged as a
# batch right before the next store submission, keeping main OTA-able for
# everything else in between. (Once one native PR merges, every later merge
# inherits the drifted fingerprint and loses OTA reach too — that is why the
# signal has to fire before merge, not after.)
#
# The check is advisory: it always passes, the label is the signal. Both
# fingerprints are computed in this one job (same OS, same corepack-pinned
# pnpm), so the comparison is self-consistent; no EXPO_TOKEN needed.
on:
pull_request:
paths:
- apps/mobile/**
- packages/client-runtime/**
- packages/contracts/**
- packages/shared/**
- assets/**
- scripts/**
- patches/**
- pnpm-lock.yaml
- pnpm-workspace.yaml
- .github/workflows/mobile-fingerprint-check.yml
concurrency:
group: mobile-fingerprint-check-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
fingerprint:
name: Native fingerprint diff
runs-on: blacksmith-8vcpu-ubuntu-2404
permissions:
contents: read
issues: write
pull-requests: write
env:
APP_VARIANT: production
NODE_OPTIONS: --max-old-space-size=8192
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# Default pull_request checkout is the merge commit (PR applied on
# top of base), so the "head" fingerprint is the state main would
# actually be in after merging — stale branches compare cleanly.
fetch-depth: 0
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: |
args:
- --filter=@t3tools/mobile...
- name: Expose pnpm
run: |
pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")"
vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin"
echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
"$vp_pnpm_bin/pnpm" --version
- name: Fingerprint merge result
working-directory: apps/mobile
run: |
mkdir -p "$RUNNER_TEMP/fp/head" "$RUNNER_TEMP/fp/base"
for platform in ios android; do
npx expo-updates fingerprint:generate --platform "$platform" > "$RUNNER_TEMP/fp/head/$platform.json"
done
- name: Fingerprint base
run: |
git checkout --quiet "${{ github.event.pull_request.base.sha }}"
# Re-sync node_modules to the base commit's lockfile before
# fingerprinting — a dep-changing PR must not fingerprint the base
# against head's installed packages.
pnpm install --filter=@t3tools/mobile...
cd apps/mobile
for platform in ios android; do
npx expo-updates fingerprint:generate --platform "$platform" > "$RUNNER_TEMP/fp/base/$platform.json"
done
- id: compare
name: Compare fingerprints
run: |
changed=""
{
echo "## Native fingerprint diff"
echo
for platform in ios android; do
head_hash="$(jq -r .hash "$RUNNER_TEMP/fp/head/$platform.json")"
base_hash="$(jq -r .hash "$RUNNER_TEMP/fp/base/$platform.json")"
if [ "$head_hash" = "$base_hash" ]; then
echo "- ✅ **$platform**: unchanged (\`$head_hash\`) — OTA-compatible"
continue
fi
changed="$changed $platform"
echo "- 📱 **$platform**: \`$base_hash\` → \`$head_hash\` — merging requires a new native build before OTAs work again"
jq -r -n \
--slurpfile h "$RUNNER_TEMP/fp/head/$platform.json" \
--slurpfile b "$RUNNER_TEMP/fp/base/$platform.json" '
($b[0].sources | map({ (.filePath // .id): .hash }) | add // {}) as $bm
| $h[0].sources[]
| select($bm[(.filePath // .id)] != .hash)
| " - \(.type): `\(.filePath // .id)`"'
done
} >> "$GITHUB_STEP_SUMMARY"
echo "changed_platforms=${changed# }" >> "$GITHUB_OUTPUT"
- name: Sync native change label
# Fork PRs get a read-only token under pull_request; the check stays
# advisory there (summary only). This workflow must not move to
# pull_request_target — it installs and runs PR code.
if: github.event.pull_request.head.repo.full_name == github.repository
uses: actions/github-script@v8
env:
CHANGED_PLATFORMS: ${{ steps.compare.outputs.changed_platforms }}
with:
script: |
const managedLabel = {
name: "📱 Native Change",
color: "d93f0b",
description:
"Changes the native fingerprint; merging blocks production OTAs until a new store build ships.",
};
const nativeChanged = (process.env.CHANGED_PLATFORMS ?? "").trim() !== "";
const issueNumber = context.payload.pull_request.number;
try {
const { data: existing } = await github.rest.issues.getLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: managedLabel.name,
});
if (
existing.color !== managedLabel.color ||
(existing.description ?? "") !== managedLabel.description
) {
await github.rest.issues.updateLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: managedLabel.name,
color: managedLabel.color,
description: managedLabel.description,
});
}
} catch (error) {
if (error.status !== 404) {
throw error;
}
try {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: managedLabel.name,
color: managedLabel.color,
description: managedLabel.description,
});
} catch (createError) {
if (createError.status !== 422) {
throw createError;
}
}
}
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
per_page: 100,
});
const hasLabel = currentLabels.some((label) => label.name === managedLabel.name);
if (nativeChanged && !hasLabel) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
labels: [managedLabel.name],
});
} else if (!nativeChanged && hasLabel) {
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
name: managedLabel.name,
});
} catch (removeError) {
if (removeError.status !== 404) {
throw removeError;
}
}
}
core.info(
`PR #${issueNumber}: native fingerprint ${nativeChanged ? `changed (${process.env.CHANGED_PLATFORMS})` : "unchanged"}`,
);
@@ -37,13 +37,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
run-install: |
args:
- --filter=@t3tools/mobile...
- --filter=@t3tools/scripts...
- --filter=t3...
- name: Expose pnpm
run: |
@@ -77,13 +86,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
run-install: |
args:
- --filter=@t3tools/mobile...
- --filter=@t3tools/scripts...
- --filter=t3...
- name: Expose pnpm
run: |
+107 -17
View File
@@ -38,6 +38,10 @@ jobs:
uses: actions/checkout@v6
with:
fetch-depth: 0
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- id: check
name: Compare HEAD to last nightly tag
@@ -84,6 +88,10 @@ jobs:
uses: actions/checkout@v6
with:
fetch-depth: 0
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
@@ -192,6 +200,10 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{ needs.preflight.outputs.ref }}
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
@@ -269,14 +281,19 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{ needs.preflight.outputs.ref }}
fetch-depth: 0
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
run-install: |
args:
- --filter=t3...
- name: Build node-pty linux-x64 prebuild
shell: bash
@@ -326,21 +343,29 @@ jobs:
platform: mac
target: dmg
arch: arm64
rust_target: aarch64-apple-darwin
resource_key: darwin-arm64
- label: macOS x64
runner: blacksmith-12vcpu-macos-26
platform: mac
target: dmg
arch: x64
rust_target: x86_64-apple-darwin
resource_key: darwin-x64
- label: Linux x64
runner: blacksmith-32vcpu-ubuntu-2404
platform: linux
target: AppImage
arch: x64
rust_target: x86_64-unknown-linux-gnu
resource_key: linux-x64
- label: Windows x64
runner: blacksmith-32vcpu-windows-2025
platform: win
target: nsis
arch: x64
rust_target: x86_64-pc-windows-msvc
resource_key: win32-x64
# - label: Windows arm64
# runner: windows-11-arm
# platform: win
@@ -351,14 +376,26 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{ needs.preflight.outputs.ref }}
fetch-depth: 0
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
run-install: |
args:
- --filter=@t3tools/desktop...
- --filter=t3...
- --filter=@t3tools/scripts...
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust_target }}
- name: Download relay client tracing config
uses: actions/download-artifact@v8
@@ -598,6 +635,19 @@ jobs:
# done
# fi
- name: Collect resource monitor
shell: bash
run: |
set -euo pipefail
binary_name="t3-resource-monitor"
if [[ "${{ matrix.platform }}" == "win" ]]; then
binary_name="${binary_name}.exe"
fi
source_path="native/resource-monitor/target/${{ matrix.rust_target }}/release/${binary_name}"
target_dir="resource-monitor-publish/${{ matrix.resource_key }}"
mkdir -p "$target_dir"
cp "$source_path" "$target_dir/$binary_name"
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
@@ -605,6 +655,13 @@ jobs:
path: release-publish/*
if-no-files-found: error
- name: Upload resource monitor
uses: actions/upload-artifact@v7
with:
name: resource-monitor-${{ matrix.resource_key }}
path: resource-monitor-publish/${{ matrix.resource_key }}/*
if-no-files-found: error
publish_cli:
name: Publish CLI to npm
needs: [preflight, relay_public_config, build]
@@ -624,6 +681,10 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{ needs.preflight.outputs.ref }}
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
@@ -659,6 +720,24 @@ jobs:
- name: Build CLI package
run: vp run --filter t3 build
- name: Download resource monitors
uses: actions/download-artifact@v8
with:
pattern: resource-monitor-*
path: ${{ runner.temp }}/resource-monitors
- name: Bundle resource monitors into CLI package
shell: bash
run: |
set -euo pipefail
for artifact_dir in "$RUNNER_TEMP"/resource-monitors/resource-monitor-*; do
resource_key="${artifact_dir##*/resource-monitor-}"
target_dir="apps/server/dist/resource-monitor/${resource_key}"
mkdir -p "$target_dir"
cp "$artifact_dir"/t3-resource-monitor* "$target_dir/"
chmod +x "$target_dir"/t3-resource-monitor 2>/dev/null || true
done
- name: Publish CLI package
run: node apps/server/scripts/cli.ts publish --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --app-version "${{ needs.preflight.outputs.version }}" --verbose
@@ -667,20 +746,18 @@ jobs:
needs: [preflight, build, publish_cli]
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build.result == 'success' && needs.publish_cli.result == 'success' }}
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 10
timeout-minutes: 30
permissions:
contents: write
steps:
- id: app_token
name: Mint release app token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ needs.preflight.outputs.ref }}
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
@@ -740,7 +817,7 @@ jobs:
- name: Publish release
if: needs.preflight.outputs.previous_tag != ''
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ needs.preflight.outputs.tag }}
target_commitish: ${{ needs.preflight.outputs.ref }}
@@ -757,11 +834,11 @@ jobs:
release-assets/*.blockmap
release-assets/*.yml
fail_on_unmatched_files: true
token: ${{ steps.app_token.outputs.token }}
token: ${{ github.token }}
- name: Publish first release
if: needs.preflight.outputs.previous_tag == ''
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ needs.preflight.outputs.tag }}
target_commitish: ${{ needs.preflight.outputs.ref }}
@@ -777,7 +854,7 @@ jobs:
release-assets/*.blockmap
release-assets/*.yml
fail_on_unmatched_files: true
token: ${{ steps.app_token.outputs.token }}
token: ${{ github.token }}
deploy_web:
name: Deploy hosted web app
@@ -802,6 +879,10 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{ needs.preflight.outputs.ref }}
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
@@ -864,6 +945,7 @@ jobs:
echo "Deploying hosted web app for $channel_name channel."
deployment_url="$(
vp dlx [email protected] deploy \
--archive=tgz \
--prod \
--skip-domain \
--yes \
@@ -915,6 +997,10 @@ jobs:
fetch-depth: 0
token: ${{ steps.app_token.outputs.token }}
persist-credentials: true
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- id: app_bot
name: Resolve GitHub App bot identity
@@ -985,6 +1071,10 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{ needs.preflight.outputs.ref }}
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
+132
View File
@@ -0,0 +1,132 @@
name: Web Preview
# Label a PR `preview:web` to get a hosted-web preview deployment on Vercel for
# that push and every subsequent push. The deployment is a plain (non-prod,
# non-aliased) deploy into the existing hosted-web Vercel project, so the
# latest/nightly channel aliases are never touched.
#
# The build intentionally omits the T3 Connect cloud config (Clerk keys, relay
# URL): previews boot as the hosted-static app with manual pairing only. Pair a
# server into a preview with `t3 pair --tailscale` (or any reachable HTTPS
# backend) and open the pairing URL against the preview origin.
#
# The preview must be opened at the exact deployment URL from the PR comment.
# Vite bakes that URL in as the hosted origin (via VERCEL_URL), and
# `isHostedStaticApp` matches on origin, so branch-alias URLs will not
# self-identify as the hosted app.
on:
pull_request:
types: [labeled, synchronize, reopened]
permissions:
contents: read
pull-requests: write
concurrency:
group: web-preview-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
deploy:
name: Deploy web preview
# Same-repo PRs only: fork PRs do not receive the Vercel secrets, and this
# workflow should skip rather than fail for them. On `labeled` events, only
# the preview label itself triggers a deploy.
if: >-
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'preview:web') &&
(github.event.action != 'labeled' || github.event.label.name == 'preview:web')
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 10
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: |
args:
- --filter=@t3tools/scripts...
- --filter=@t3tools/web...
- id: deploy
name: Deploy preview
shell: bash
run: |
set -euo pipefail
if [[ -z "${VERCEL_TOKEN:-}" || -z "${VERCEL_ORG_ID:-}" || -z "${VERCEL_PROJECT_ID:-}" ]]; then
echo "Missing one or more required Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID." >&2
exit 1
fi
vercel_scope="${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
deployment_url="$(
vp dlx [email protected] deploy \
--archive=tgz \
--yes \
--token "$VERCEL_TOKEN" \
--scope "$vercel_scope"
)"
echo "Deployed $deployment_url"
echo "deployment_url=$deployment_url" >> "$GITHUB_OUTPUT"
- name: Comment deployment URL
uses: actions/github-script@v8
env:
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment_url }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
with:
script: |
const marker = "<!-- web-preview-deploy -->";
const body = [
marker,
"### Web preview",
"",
`${process.env.DEPLOYMENT_URL} (for ${process.env.HEAD_SHA.slice(0, 7)})`,
"",
"Open this exact URL — the hosted-app origin is baked in at build time.",
"Pair a server into it with `t3 pair --tailscale`, or paste a host + pairing",
"code under Settings → Connections.",
].join("\n");
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
per_page: 100,
});
const existing = comments.find((comment) => comment.body?.includes(marker));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body,
});
}
+1
View File
@@ -30,6 +30,7 @@ dist-electron/
.showcase/
apps/mobile/.showcase/
artifacts/app-store/screenshots/
native/**/target/
node_modules/
.alchemy/
*.log
@@ -1,6 +1,6 @@
---
title: Effect Service Conventions
model: claude-opus-4-8
model: claude-opus-5
effort: high
input: full_diff
tools:
@@ -0,0 +1,246 @@
# Plan: Thread Lineage And Lazy Context Transfer
## Summary
Implement the shared backend foundation for forking, provider handoff, merge-back, and future subagents without forcing provider selection at fork time. The first slice should create cheap app-level fork lineage and defer expensive context materialization until a run starts and the target provider is known.
Architecture reference: `docs/orchestration-v2/thread-lineage-and-context-transfer.md`.
## Goals
- Support user-created fork threads for exploration.
- Keep fork creation provider-neutral and cheap.
- Reuse the same source-point/context-transfer model for provider switching, merge-back, and future subagents.
- Prefer native same-provider fork at first dispatch when available.
- Fall back to portable context only when native transfer is unavailable or target provider differs.
- Keep all behavior replayable through V2 events/projections.
## Non-Goals For First Slice
- Full portable context generation quality.
- Cross-provider adapter implementation beyond the data/runtime hook.
- Merge-back UI.
- Native or custom subagent orchestration.
- Forking from actively streaming provider state.
- Backward compatibility with old dev databases.
## Core Data Model
Add schema/contracts for:
```ts
type ContextTransferType =
| "fork"
| "provider_handoff"
| "merge_back"
| "subagent_spawn"
| "subagent_result";
type ContextSourcePoint = {
threadId: ThreadId;
runId?: RunId;
checkpointId?: CheckpointId;
turnItemId?: TurnItemId;
providerThreadRef?: NativeThreadRef;
providerTurnRef?: NativeTurnRef;
};
type ContextTransferStatus =
| "pending"
| "resolved_native"
| "resolved_portable"
| "failed"
| "consumed"
| "superseded";
```
Persist:
- `orchestration_v2_projection_context_transfers`
- optional later portable handoff payload columns/table if the existing context handoff projection is not enough
For the first slice, `ContextTransfer` is required. Materialized `ContextHandoff` payloads can be deferred until portable context is implemented.
## Events
Add V2 events:
- `context-transfer.created`
- `context-transfer.updated`
- possibly `context-handoff.created` later
Do not emit provider-native fork details as app identity. Native fork refs belong in the transfer resolution payload and provider thread refs.
## Commands
Add:
```ts
type ThreadForkCommand = {
type: "thread.fork";
commandId: CommandId;
sourceThreadId: ThreadId;
targetThreadId: ThreadId;
sourcePoint:
| { type: "latest_stable" }
| { type: "run"; runId: RunId }
| { type: "checkpoint"; checkpointId: CheckpointId };
title?: string;
createdAt: string;
};
```
First-slice policy:
- `latest_stable` resolves to latest completed run checkpoint.
- explicit completed run/checkpoint is accepted.
- active run source is rejected or resolved to latest stable checkpoint; choose one policy and test it.
- target thread starts idle.
- no provider session/thread is created by `thread.fork`.
## Runtime Hook
Add a provider-neutral start-context resolver used by run startup:
```ts
resolveStartContext({
threadId,
runId,
provider,
modelSelection,
userMessage,
}): Effect<StartContextResolution, StartContextResolutionError>
```
Resolution order:
1. No pending transfer targeting the thread/run: normal run start.
2. Pending fork transfer and same provider with native fork support: resolve native fork.
3. Pending transfer requiring portable context: return explicit unsupported/stub result in first slice, or build minimal portable context if cheap.
4. Failed resolution: fail command before provider side effects.
The resolver should be called before provider thread creation/startTurn so the adapter can decide whether to create, resume, or native-fork provider state.
## Codex Native Fork Path
Investigate the app-server native fork API in `effect-codex-app-server` and Codex docs/probes.
Implementation target:
- use native fork only when source provider is Codex and source native refs are strong;
- create or bind a new `ProviderThread` for the forked native thread;
- when the source point is an earlier completed Codex provider turn, fork the latest native thread first and then rollback the forked native thread by later terminal provider turns;
- mark `ContextTransfer.status = resolved_native` and then `consumed` when the first run starts;
- preserve source app thread lineage separately from native thread refs.
If native API details are not clean, land the data model and resolver first with native fork marked unsupported, then add Codex native fork in a follow-up.
## Portable Context Fallback
The first slice should define the fallback boundary even if it does not fully implement high-quality summarization.
Minimum viable fallback:
- detect cross-provider fork/handoff need;
- create failed/unsupported transfer resolution with a clear command error, or
- generate a deterministic minimal context handoff from app projection if we want a usable MVP.
Do not silently concatenate hidden summaries into the user message without a `ContextTransfer`/`ContextHandoff` record.
## Merge-Back Preparation
Do not implement merge-back in the first slice, but keep model support:
- `ContextTransfer.type = "merge_back"`
- `basePoint` on transfer
- source thread may differ from target thread
The later merge-back command should create a transfer from fork latest stable point back to source thread and consume it with the next user message.
## Subagent Preparation
Do not implement subagents in this slice, but keep model support:
- `createdBy: "agent"`
- `type: "subagent_spawn"` and `"subagent_result"`
- source/target thread relationship fields
Native subagent ingestion can later map provider-native child refs into the same graph. Cross-provider app-owned subagents can later create child app threads using the same transfer primitive.
## Projection And Debugger
Backend projection first:
- expose thread lineage in thread projection;
- expose context transfers in debug projection;
- expose transfer status and resolution strategy.
Debugger after backend:
- fork button/control from stable source point;
- show thread lineage/source point;
- show pending/resolved/failed transfers;
- show native vs portable resolution.
Do not build debugger controls before the backend projection is authoritative.
## Tests
Use `bun run test`, not `bun test`.
Required backend tests:
- `thread.fork` from latest completed checkpoint creates target thread and pending transfer.
- fork command is idempotent through command receipts.
- fork does not create provider session/thread eagerly.
- first run on same-provider fork invokes native resolution path when capability exists.
- unsupported native fork falls back or fails according to explicit policy.
- active-run fork policy is deterministic.
- replay/recovery preserves target thread lineage and pending transfer.
Add test provider layers only at external service boundaries. Do not mock core orchestration policy.
## Implementation Order
1. Add contract schemas and ids for context transfers/source points.
2. Add migration/projection table for context transfers.
3. Add event store/projection handling for transfer events.
4. Add `thread.fork` command policy and orchestrator path.
5. Add tests for cheap idle fork creation and recovery.
6. Add start-context resolver interface.
7. Wire resolver into run startup with no-op behavior.
8. Add Codex native fork capability investigation and adapter path.
9. Add tests for same-provider native fork resolution.
10. Add debug projection surface after backend behavior is stable.
## Validation
Before considering the slice complete:
- `bun fmt`
- `bun lint`
- `bun typecheck`
- targeted backend tests with `bun run test`
If backend code changes are included, tests must cover the new orchestration behavior before the task is considered done.
## Implementation Status
Implemented in this slice:
- context transfer ids, schemas, JSON codecs, events, and projection storage
- app-thread lineage on thread creation and fork creation
- `thread.fork` command using `latest_stable`, explicit run, or explicit checkpoint source points
- cheap idle fork creation with no eager provider session/thread/run
- Codex same-provider native `thread/fork` resolution on first target dispatch
- Codex native fork-from-earlier-run resolution with `thread/fork` plus fork-local `thread/rollback`
- transfer status progression through `pending`, `resolved_native`, and `consumed`
- command receipt idempotency for duplicate fork commands
- replay-backed integration coverage for lazy fork creation and native Codex fork consumption
Explicitly deferred:
- portable `ContextHandoff` materialization for cross-provider forks/provider handoff
- merge-back command/runtime
- subagent spawn/result runtime
- debugger controls for creating/inspecting transfers
File diff suppressed because it is too large. Load diff
+1
View File
@@ -12,3 +12,4 @@
10. `10-unify-process-session-abstraction.md`
19. `19-version-control-phase-1-vcs-driver-foundation.md`
20. `20-version-control-phase-2-source-control-provider-foundation.md`
21. `21-orchestration-v2-application-integration.md`
+1 -1
View File
@@ -1 +1 @@
alchemy/test/**
alchemy/test/**
Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
# Regenerate the PR screenshots from the built site and commit them if changed.
# Usage: .github/pr-assets/update-screenshots.sh [pr-number]
# Assumes website/dist is freshly built (DOCS_FAST=1 bun astro build).
set -euo pipefail
PR="${1:-721}"
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
OUT="$ROOT/.github/pr-assets/$PR"
DIST="$ROOT/website/dist"
CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
PORT=4899
[ -d "$DIST" ] || { echo "website/dist missing — build first"; exit 1; }
mkdir -p "$OUT"
python3 -m http.server "$PORT" --directory "$DIST" >/dev/null 2>&1 &
SERVER_PID=$!
trap 'kill $SERVER_PID 2>/dev/null || true' EXIT
sleep 1
shot() { # shot <file> <path> [extra chrome flags...]
local file="$1" path="$2"; shift 2
"$CHROME" --headless=new --disable-gpu --hide-scrollbars \
--window-size=1600,1000 --virtual-time-budget=6000 \
"$@" --screenshot="$OUT/$file" "http://localhost:$PORT$path" 2>/dev/null
echo "$file: $(wc -c <"$OUT/$file" | tr -d ' ') bytes"
}
shot landing.png /
shot docs-tab.png /getting-started/
shot cloudflare-hub.png /cloudflare/
shot aws-hub.png /aws/
shot planetscale-hub.png /planetscale/
shot axiom-hub.png /axiom/
shot reference.png /providers/cloudflare/workers/durableobject/
shot cloudflare-hub-dark.png /cloudflare/ --force-dark-mode --blink-settings=preferredColorScheme=2
cd "$ROOT"
if git status --porcelain -- ".github/pr-assets/$PR" | grep -q .; then
git add ".github/pr-assets/$PR"
git commit -q -m "chore(website): refresh PR screenshots
Co-Authored-By: Claude Fable 5 <[email protected]>"
git push
echo "screenshots refreshed and pushed"
else
echo "screenshots unchanged"
fi
+41
View File
@@ -0,0 +1,41 @@
name: check
# Runs the website docs validator (`bun run docs:check`) on every PR
# so broken links / missing API references fail fast before merge.
on:
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: read
env:
NODE_VERSION: "24"
jobs:
check:
runs-on: ubuntu-22-large
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# `bun install` needs the distilled submodule (workspace member)
submodules: true
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
- run: bun install
- run: bun tsc -b
- run: bun run docs:check
+55
View File
@@ -0,0 +1,55 @@
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Configure AWS credentials
id: aws
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
output-credentials: true
- name: Run Claude Code
uses: anthropics/claude-code-action@v1
env:
AWS_ACCESS_KEY_ID: ${{ steps.aws.outputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ steps.aws.outputs.aws-secret-access-key }}
AWS_SESSION_TOKEN: ${{ steps.aws.outputs.aws-session-token }}
AWS_REGION: us-east-1
AWS_DEFAULT_REGION: us-east-1
CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_args: |
--model claude-fable-5
--allowedTools "Bash(aws:*),WebFetch,WebSearch"
-137
View File
@@ -1,137 +0,0 @@
name: Deploy Website
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "website/**"
- "packages/alchemy/**"
- "bun.lock"
- ".github/workflows/deploy.yml"
pull_request:
types:
- opened
- reopened
- synchronize
- closed
paths:
- "website/**"
- "packages/alchemy/**"
- "bun.lock"
- ".github/workflows/deploy.yml"
concurrency:
group: deploy-website-${{ github.ref }}
cancel-in-progress: false
env:
STAGE: ${{ github.event_name == 'pull_request' && format('pr-{0}',
github.event.number) || (github.ref == 'refs/heads/main' && 'prod' ||
github.ref_name) }}
jobs:
deploy:
if: ${{ github.event.action != 'closed' }}
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Mint a token for the alchemy-version-bot GitHub App so the PR
# preview comment (created via GitHub.Comment in alchemy.run.ts)
# posts under the bot's identity instead of `github-actions[bot]`.
# Same App as release.yml — its installation scopes already cover
# PR comments.
- name: Generate bot token
id: bot-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.ALCHEMY_VERSION_BOT_ID }}
private-key: ${{ secrets.ALCHEMY_VERSION_BOT_PRIVATE_KEY }}
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Install dependencies
run: bun install
# Build the website ahead of `alchemy deploy`. The
# Cloudflare.StaticSite resource declares the same `bun run build`
# in its config and runs it as part of the create lifecycle, but
# on update plans alchemy reads `dist/` during plan.diff before
# the embedded Build resource gets a chance to (re)run, causing
# a NotFound on a fresh CI checkout. Building here makes the
# workflow correct under both create and update plans.
- name: Build website
working-directory: website
run: bun run build
- name: Deploy
working-directory: website
run: bun alchemy deploy --stage ${{ env.STAGE }} --yes
env:
# Alchemy's Cloudflare auth provider accepts either a scoped
# API token (CLOUDFLARE_API_TOKEN) or the legacy global API
# key paired with email (CLOUDFLARE_API_KEY +
# CLOUDFLARE_EMAIL). We use the latter here so CI matches
# the credentials in Doppler / .env, where only the admin
# global key is provisioned.
CLOUDFLARE_API_KEY: ${{ secrets.ADMIN_CLOUDFLARE_API_KEY }}
CLOUDFLARE_EMAIL: ${{ secrets.ADMIN_CLOUDFLARE_EMAIL }}
CLOUDFLARE_ACCOUNT_ID: ${{ env.STAGE == 'prod' &&
secrets.PROD_CLOUDFLARE_ACCOUNT_ID ||
secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
PULL_REQUEST: ${{ github.event.number }}
# On `pull_request` events GitHub Actions' built-in
# `GITHUB_SHA` is the synthetic merge commit (PR head merged
# into base) — that SHA never shows up in the PR's git log.
# `GITHUB_SHA` is also a reserved env var, so a step-level
# override is silently ignored. Pass the PR head SHA under
# a non-reserved name and read it from alchemy.run.ts.
BUILD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
GITHUB_TOKEN: ${{ steps.bot-token.outputs.token }}
cleanup:
runs-on: ubuntu-latest
if:
${{ github.event_name == 'pull_request' && github.event.action == 'closed'
}}
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Generate bot token
id: bot-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.ALCHEMY_VERSION_BOT_ID }}
private-key: ${{ secrets.ALCHEMY_VERSION_BOT_PRIVATE_KEY }}
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Install dependencies
run: bun install
- name: Safety Check
run: |-
if [ "${{ env.STAGE }}" = "prod" ]; then
echo "ERROR: Cannot destroy prod environment in cleanup job"
exit 1
fi
- name: Destroy Preview Environment
working-directory: website
run: bun alchemy destroy --stage ${{ env.STAGE }} --yes
env:
CLOUDFLARE_API_KEY: ${{ secrets.ADMIN_CLOUDFLARE_API_KEY }}
CLOUDFLARE_EMAIL: ${{ secrets.ADMIN_CLOUDFLARE_EMAIL }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
PULL_REQUEST: ${{ github.event.number }}
GITHUB_TOKEN: ${{ steps.bot-token.outputs.token }}
-180
View File
@@ -1,180 +0,0 @@
name: pr-package
# Publishes alchemy + better-auth + pr-package tarballs to the pr-package
# service at pkg.ing on every push to main and every PR sync. On PR close,
# deletes every tag we ever assigned for that PR so the underlying tarballs
# become orphaned and the bucket cleans them up.
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, closed]
permissions:
contents: read
pull-requests: write
env:
PR_PACKAGE_HOST: pkg.ing
NODE_VERSION: "24"
jobs:
# ── Publish on push-to-main and PR sync. ──────────────────────────────────
publish:
if: github.event_name == 'push' || (github.event_name == 'pull_request' &&
github.event.action != 'closed')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
# Build everything: tsdown bundles alchemy (bin/ + cli lib) and tsc -b
# populates lib/ for the layer packages (better-auth, pr-package).
# Their tarballs ship both src/ and lib/, and consumers in non-bun
# runtimes resolve via the `import` condition → ./lib/index.js.
- run: bun run build:packages
- name: Compute tags
id: tags
env:
EVENT: ${{ github.event_name }}
# `head_ref` for PRs (source branch), `ref_name` for push (e.g. "main").
BRANCH: ${{ github.event_name == 'pull_request' && github.head_ref ||
github.ref_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
# PR builds run on the merge commit by default; tag the actual head sha
# so consumers can pin to a specific PR commit.
SHA: ${{ github.event_name == 'pull_request' &&
github.event.pull_request.head.sha || github.sha }}
run: |
set -euo pipefail
short="${SHA:0:7}"
long="$SHA"
tags=("$short" "$long" "$BRANCH")
if [ "$EVENT" = "pull_request" ]; then
tags+=("pr-${PR_NUMBER}")
fi
json=$(printf '%s\n' "${tags[@]}" | jq -R . | jq -s -c .)
echo "tags=$json" >> "$GITHUB_OUTPUT"
echo "short=$short" >> "$GITHUB_OUTPUT"
echo "Tags: $json"
# PR builds expire after 1 week; pushes to main omit the header and
# fall back to the worker's defaultTtl (3 weeks).
- name: Publish alchemy
env:
TOKEN: ${{ secrets.PR_PACKAGE_TOKEN }}
TAGS: ${{ steps.tags.outputs.tags }}
TTL: ${{ github.event_name == 'pull_request' && '1 week' || '' }}
working-directory: packages/alchemy
run: |
set -euo pipefail
rm -f *.tgz
bun pm pack --destination .
tgz=$(ls *.tgz)
echo "Publishing $tgz with tags $TAGS ttl=${TTL:-default}"
curl -fsSL --show-error -X PUT \
"https://${PR_PACKAGE_HOST}/projects/alchemy/packages" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-Tags: ${TAGS}" \
${TTL:+-H "X-TTL: ${TTL}"} \
-H "Content-Type: application/gzip" \
--data-binary "@${tgz}"
- name: Publish better-auth
env:
TOKEN: ${{ secrets.PR_PACKAGE_TOKEN }}
TAGS: ${{ steps.tags.outputs.tags }}
TTL: ${{ github.event_name == 'pull_request' && '1 week' || '' }}
working-directory: packages/better-auth
run: |
set -euo pipefail
rm -f *.tgz
bun pm pack --destination .
tgz=$(ls *.tgz)
echo "Publishing $tgz with tags $TAGS ttl=${TTL:-default}"
curl -fsSL --show-error -X PUT \
"https://${PR_PACKAGE_HOST}/projects/@alchemy.run/better-auth/packages" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-Tags: ${TAGS}" \
${TTL:+-H "X-TTL: ${TTL}"} \
-H "Content-Type: application/gzip" \
--data-binary "@${tgz}"
- name: Publish pr-package
env:
TOKEN: ${{ secrets.PR_PACKAGE_TOKEN }}
TAGS: ${{ steps.tags.outputs.tags }}
TTL: ${{ github.event_name == 'pull_request' && '1 week' || '' }}
working-directory: packages/pr-package
run: |
set -euo pipefail
rm -f *.tgz
bun pm pack --destination .
tgz=$(ls *.tgz)
echo "Publishing $tgz with tags $TAGS ttl=${TTL:-default}"
curl -fsSL --show-error -X PUT \
"https://${PR_PACKAGE_HOST}/projects/@alchemy.run/pr-package/packages" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-Tags: ${TAGS}" \
${TTL:+-H "X-TTL: ${TTL}"} \
-H "Content-Type: application/gzip" \
--data-binary "@${tgz}"
# PR-only: leave a sticky comment with the install URLs pinned to this
# commit. Uses pkg.ing (the canonical short host), which serves both
# the pretty alias paths and the underlying /projects/:project/tags/:tag
# API directly.
- name: Generate bot token
if: github.event_name == 'pull_request'
id: bot-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.ALCHEMY_VERSION_BOT_ID }}
private-key: ${{ secrets.ALCHEMY_VERSION_BOT_PRIVATE_KEY }}
- name: Comment on PR
if: github.event_name == 'pull_request'
env:
GH_TOKEN: ${{ steps.bot-token.outputs.token }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
SHORT_SHA: ${{ steps.tags.outputs.short }}
run: |
set -euo pipefail
MARKER="<!-- pr-package-comment -->"
# Use `bun add <name>@<url>` instead of `bun add <url>`. Without an
# explicit name, bun's resolver hits a DependencyLoop bug when the
# consumer already has the same package name resolved from npm
# (oven-sh/bun#5789, oven-sh/bun#17946). The aliased form bypasses
# the buggy reconciliation path and works on fresh and existing
# projects alike.
BODY=$(printf '%s\n\nInstall the packages built from this commit:\n\n**alchemy**\n```sh\nbun add alchemy@https://pkg.ing/alchemy/%s\n```\n\n**@alchemy.run/better-auth**\n```sh\nbun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/%s\n```\n\n**@alchemy.run/pr-package**\n```sh\nbun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/%s\n```\n' "$MARKER" "$SHORT_SHA" "$SHORT_SHA" "$SHORT_SHA")
existing=$(gh api --paginate \
"repos/${REPO}/issues/${PR_NUMBER}/comments" \
--jq ".[] | select(.user.login == \"alchemy-version-bot[bot]\") | select(.body | startswith(\"${MARKER}\")) | .id" \
| head -1)
if [ -n "$existing" ]; then
gh api -X PATCH "repos/${REPO}/issues/comments/${existing}" -f body="$BODY"
else
gh api -X POST "repos/${REPO}/issues/${PR_NUMBER}/comments" -f body="$BODY"
fi
+42
View File
@@ -0,0 +1,42 @@
name: pr-package
on:
push:
branches: [main]
pull_request:
# `labeled` so adding the `force-ci` label re-triggers the run. We
# intentionally do NOT listen to `closed` — pr-package tags persist
# past PR close so existing install URLs keep resolving.
types: [opened, synchronize, reopened, labeled]
# Reusable workflows can't widen permissions — the caller must grant
# `pull-requests: write` for the sticky install-instructions comment.
permissions:
contents: read
pull-requests: write
jobs:
pr-package:
uses: alchemy-run/actions/.github/workflows/pr-package.yml@a18b368e044cb380a8c4904d5cfbccbc2798e768 # main
with:
# The bun workspace includes `distilled/packages/*` from the
# distilled submodule, so the publish jobs must check it out.
submodules: "true"
# A submodule-pointer bump doesn't fall under any package dir, but
# it changes what gets bundled — republish everything.
rebuild-all-paths: |
distilled
cloudflare-tools
# `|| true` keeps the cp harmless in packages whose pkg dir is
# nested differently or that don't need the root README.
build-command: "cp ../../README.md . 2>/dev/null || true; bun run build"
# Every package's tsc build pulls in the alchemy -> distilled
# project-reference chain (distilled/aws is huge), so all three
# need the larger runner — same as distilled's own CI.
packages: |
[
{ "dir": "packages/alchemy", "name": "alchemy", "runner": "ubuntu-22-large" },
{ "dir": "packages/better-auth", "name": "@alchemy.run/better-auth", "runner": "ubuntu-22-large" },
{ "dir": "packages/pr-package", "name": "@alchemy.run/pr-package", "runner": "ubuntu-22-large" }
]
secrets: inherit
+38 -419
View File
@@ -1,432 +1,51 @@
name: Release NPM Package
name: release
on:
workflow_dispatch:
inputs:
channel:
description: "Release channel"
required: true
type: choice
default: beta
options:
- release
- beta
- alpha
- tag
spec:
version:
description: >-
Channel-specific value. tag: REQUIRED, the explicit full version (e.g.
2.0.0-experimental.1). release: REQUIRED, patch|minor|major or an
explicit x.y.z. beta|alpha: optional, an integer N to force
2.0.0-<channel>.N; leave blank to auto-increment.
Release spec. Empty = next beta. `patch|minor|major` or `x.y.z`
for a stable release. `beta` / `beta.N` / `alpha` / `alpha.N`
for a prerelease. Anything else = tag release on
`0.0.0-<name>`.
required: false
type: string
default: ""
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
# Reusable workflows can't widen permissions — the caller must grant
# `contents: write` (commit + tag) and `id-token: write` (npm OIDC).
permissions:
contents: write
id-token: write
env:
NODE_VERSION: "24"
# Files produced by the bump job and consumed by every publish job + the
# final commit job. Listed once here so additions stay in sync.
BUMP_ARTIFACT_PATHS: |
packages/alchemy/lib
packages/alchemy/bin
packages/alchemy/package.json
packages/better-auth/package.json
packages/better-auth/lib
packages/pr-package/package.json
packages/pr-package/lib
bun.lock
jobs:
# ── Step 1: Compute the next version and stage the bump in-memory. ──
# No git commit: we want a failed publish to leave no orphan commit
# behind. The staged files ride to the publish jobs (and the final commit
# job) as an artifact.
bump:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.bump.outputs.version }}
channel: ${{ inputs.channel }}
sha: ${{ steps.sha.outputs.sha }}
steps:
- name: Validate inputs
env:
CHANNEL: ${{ inputs.channel }}
SPEC: ${{ inputs.spec }}
run: |
case "$CHANNEL" in
tag)
if [ -z "$SPEC" ]; then
echo "::error::'tag' channel requires an explicit version in 'spec' (e.g. 2.0.0-experimental.1)"
exit 1
fi
;;
release)
if [ -z "$SPEC" ]; then
echo "::error::'release' channel requires a 'spec' (patch|minor|major|x.y.z)"
exit 1
fi
;;
esac
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- id: sha
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
registry-url: https://registry.npmjs.org/
node-version: ${{ env.NODE_VERSION }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- id: bump
env:
CHANNEL: ${{ inputs.channel }}
SPEC: ${{ inputs.spec }}
run: |
if [ -n "$SPEC" ]; then
VERSION=$(bun ./scripts/release/bump.ts "$CHANNEL" "$SPEC")
else
VERSION=$(bun ./scripts/release/bump.ts "$CHANNEL")
fi
echo "Resolved version: $VERSION (channel: $CHANNEL)"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
# Build everything once, up front, against the bumped versions. Outputs
# ride to every publish job as the `build-output` artifact so we don't
# rebuild three times in parallel.
- run: bun run build:packages
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: bump-files
path: ${{ env.BUMP_ARTIFACT_PATHS }}
if-no-files-found: error
retention-days: 7
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: build-output
path: |
packages/*/lib
packages/*/bin
if-no-files-found: error
retention-days: 7
include-hidden-files: true
# ── Step 2: Commit (bump + changelog) and tag BEFORE publishing.
# Committing first means the publishable source of truth is the tagged
# commit; publish jobs check it out by SHA. Durability: if a previous
# attempt already committed and tagged but failed during npm publish, the
# bump job's HEAD-tag detection reuses the existing version, and this job
# detects HEAD is already at the tag and skips the commit/push.
# Skipped for `tag` channel — those releases are intentionally uncommitted.
commit-and-tag:
needs: bump
if: inputs.channel != 'tag'
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.commit.outputs.sha }}
steps:
- name: Generate bot token
id: bot-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.ALCHEMY_VERSION_BOT_ID }}
private-key: ${{ secrets.ALCHEMY_VERSION_BOT_PRIVATE_KEY }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.ref }}
fetch-depth: 0
token: ${{ steps.bot-token.outputs.token }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: bump-files
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- name: Configure git
run: |
git config user.email "alchemy-version-bot[bot]@users.noreply.github.com"
git config user.name "alchemy-version-bot[bot]"
- id: commit
name: Commit bump + changelog, tag, push
env:
VERSION: ${{ needs.bump.outputs.version }}
run: |
set -euo pipefail
TAG="v${VERSION}"
# Durability: if HEAD already points at the release tag (resumed
# run after a previous attempt committed+tagged but publish
# failed), there is nothing to do. Use HEAD as the publish SHA.
HEAD_TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || true)
if [ "$HEAD_TAG" = "$TAG" ]; then
echo "HEAD is already at ${TAG}; skipping commit/tag/push"
SHA=$(git rev-parse HEAD)
echo "sha=${SHA}" >> "$GITHUB_OUTPUT"
exit 0
fi
# Generate release notes; release-notes.ts is idempotent and
# bails out if the tag heading is already present in CHANGELOG.md.
bun scripts/release/release-notes.ts "${TAG}"
# Stage bump files (overwritten by the downloaded artifact) and
# the new changelog entry as a single commit.
git add packages/alchemy/package.json \
packages/better-auth/package.json \
packages/pr-package/package.json \
bun.lock \
CHANGELOG.md
if git diff --cached --quiet; then
echo "No changes to commit (already on a release commit?)"
else
git commit -m "chore(release): ${VERSION}"
fi
if ! git rev-parse --verify "refs/tags/${TAG}" >/dev/null 2>&1; then
git tag -a "${TAG}" -m "Release ${TAG}"
fi
git push origin HEAD
if git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1; then
echo "Tag ${TAG} already on remote, skipping tag push"
else
git push origin "refs/tags/${TAG}"
fi
SHA=$(git rev-parse HEAD)
echo "sha=${SHA}" >> "$GITHUB_OUTPUT"
# ── Step 3a: Build and publish `alchemy`. ──
# For non-tag channels, checkout the just-committed tagged SHA; for the
# `tag` channel (no commit), checkout the bump's pre-bump SHA and rely
# on the bump-files artifact instead.
publish-alchemy:
needs: [bump, commit-and-tag]
if:
always() && needs.bump.result == 'success' && (needs.commit-and-tag.result
== 'success' || needs.commit-and-tag.result == 'skipped')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.commit-and-tag.outputs.sha || needs.bump.outputs.sha }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
registry-url: https://registry.npmjs.org/
node-version: ${{ env.NODE_VERSION }}
- name: Upgrade npm for OIDC trusted publishing
run: |
npm install -g npm@latest && npm --version
sed -i '/always-auth/d' ~/.npmrc 2>/dev/null || true
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: bump-files
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-output
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- run: bun scripts/release/publish-package.ts packages/alchemy ${{
needs.bump.outputs.channel }}
# ── Step 3b: Build and publish `@alchemy.run/better-auth`. ──
publish-better-auth:
needs: [bump, commit-and-tag, publish-alchemy]
if:
always() && needs.bump.result == 'success' && (needs.commit-and-tag.result
== 'success' || needs.commit-and-tag.result == 'skipped') &&
needs.publish-alchemy.result == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.commit-and-tag.outputs.sha || needs.bump.outputs.sha }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
registry-url: https://registry.npmjs.org/
node-version: ${{ env.NODE_VERSION }}
- name: Upgrade npm for OIDC trusted publishing
run: |
npm install -g npm@latest && npm --version
sed -i '/always-auth/d' ~/.npmrc 2>/dev/null || true
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: bump-files
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-output
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- run: bun scripts/release/publish-package.ts packages/better-auth ${{
needs.bump.outputs.channel }}
# ── Step 3c: Build and publish `@alchemy.run/pr-package`. ──
publish-pr-package:
needs: [bump, commit-and-tag, publish-alchemy]
if:
always() && needs.bump.result == 'success' && (needs.commit-and-tag.result
== 'success' || needs.commit-and-tag.result == 'skipped') &&
needs.publish-alchemy.result == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.commit-and-tag.outputs.sha || needs.bump.outputs.sha }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
registry-url: https://registry.npmjs.org/
node-version: ${{ env.NODE_VERSION }}
- name: Upgrade npm for OIDC trusted publishing
run: |
npm install -g npm@latest && npm --version
sed -i '/always-auth/d' ~/.npmrc 2>/dev/null || true
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: bump-files
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-output
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- run: bun scripts/release/publish-package.ts packages/pr-package ${{
needs.bump.outputs.channel }}
# ── Step 4: Create GitHub Release and notify Discord. ──
# Runs only after every publish job succeeded. The bump+changelog commit
# and tag were already pushed by `commit-and-tag` before publishing.
finalize:
needs:
[
bump,
commit-and-tag,
publish-alchemy,
publish-better-auth,
publish-pr-package,
]
if: inputs.channel != 'tag'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.commit-and-tag.outputs.sha }}
fetch-depth: 0
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- name: Create GitHub Release
env:
VERSION: ${{ needs.bump.outputs.version }}
CHANNEL: ${{ needs.bump.outputs.channel }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun scripts/release/github-release.ts "v${VERSION}" "${CHANNEL}"
- name: Notify Discord
if: success() && env.DISCORD_WEBHOOK != ''
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
VERSION: ${{ needs.bump.outputs.version }}
CHANNEL: ${{ needs.bump.outputs.channel }}
run: bun scripts/release/discord-notify.ts "v${VERSION}" "${CHANNEL}"
release:
uses: alchemy-run/actions/.github/workflows/release.yml@a18b368e044cb380a8c4904d5cfbccbc2798e768 # main
with:
# The bun workspace includes `distilled/packages/*` from the
# distilled submodule, so consumer checkouts must fetch it.
submodules: "true"
version: ${{ inputs.version }}
repo: alchemy-run/alchemy
current-version: "2.0.0"
# Each package builds in its own publish job: the tsc build pulls
# in the alchemy -> distilled project-reference chain (distilled/aws
# is huge), which doesn't fit the bump job's ubuntu-latest box.
build-mode: per-package
# The alchemy package ships the repo-root README.md; copy it in
# before the build so `bun pm pack` picks it up. Same trick the
# legacy `publish:npm` script used (`|| true` keeps it harmless
# elsewhere).
build-command: "cp ../../README.md . 2>/dev/null || true; bun run build"
packages: |
[
{ "dir": "packages/alchemy", "name": "alchemy", "runner": "ubuntu-22-large" },
{ "dir": "packages/better-auth", "name": "@alchemy.run/better-auth", "runner": "ubuntu-22-large" },
{ "dir": "packages/pr-package", "name": "@alchemy.run/pr-package", "runner": "ubuntu-22-large" }
]
secrets: inherit
-93
View File
@@ -1,93 +0,0 @@
name: test
# Smoke-tests `alchemy destroy → deploy → destroy` against each example.
# `bun test:canary` drives the whole suite — it iterates both bun and pnpm
# runtimes itself and publishes canary tarballs to pkg.ing before deploying.
on:
# TODO(sam): re-enable these when they are running reliably and not polluting our account
# push:
# branches: [main]
# pull_request:
# types: [opened, reopened, synchronize]
workflow_dispatch:
permissions:
contents: read
# Required for aws-actions/configure-aws-credentials to mint a session
# via OIDC instead of long-lived AWS_ACCESS_KEY_ID secrets.
id-token: write
env:
PKGING_HOST: pkg.ing
NODE_VERSION: "24"
# PR runs use `pr-<n>` so each PR has its own isolated cloud namespace;
# main pushes use `main`; manual `workflow_dispatch` runs use the branch
# name. Forwarded to the smoke test as $SMOKE_STAGE.
SMOKE_STAGE: ${{ github.event_name == 'pull_request' && format('pr-{0}',
github.event.number) || (github.ref == 'refs/heads/main' && 'main' ||
github.ref_name) }}
concurrency:
# Cancel an in-progress run for the same PR (or branch) when a new push
# arrives — the smoke suite mutates real cloud state, so two parallel
# runs against the same SMOKE_STAGE would race.
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
with:
version: latest
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
# Bootstrap install so `bun test:canary` itself can resolve. The
# test then runs its own `bun install` + `pnpm install` in canary
# `beforeAll` after rewriting the catalog to pkg.ing tarballs, so
# there's nothing pnpm-specific to wire up here.
- run: bun install
# OIDC → short-lived AWS session. Exports AWS_ACCESS_KEY_ID,
# AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION; the
# `output-credentials: true` flag also surfaces aws-account-id as a
# step output (which we forward as `AWS_ACCOUNT_ID` below — the
# action does NOT set it as an env var on its own).
- id: aws-creds
uses: aws-actions/configure-aws-credentials@d979d5b3a71173a29b74b5b88418bfda9437d885 # v6.1.1
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
output-credentials: true
- name: Smoke
env:
# AWS — `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`,
# `AWS_SESSION_TOKEN`, `AWS_REGION` are already exported by
# configure-aws-credentials; we only need to forward the account
# id, which Alchemy's `loadFromEnv` requires when CI=true.
AWS_ACCOUNT_ID: ${{ steps.aws-creds.outputs.aws-account-id }}
CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
NEON_API_KEY: ${{ secrets.NEON_API_KEY }}
PR_PACKAGE_TOKEN: ${{ secrets.PR_PACKAGE_TOKEN }}
PKGING_HOST: ${{ env.PKGING_HOST }}
SMOKE_STAGE: ${{ env.SMOKE_STAGE }}
run: bun test:canary
+136
View File
@@ -0,0 +1,136 @@
name: website
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "website/**"
- "packages/alchemy/**"
- "bun.lock"
- ".github/workflows/deploy.yml"
pull_request:
# `labeled` so adding `deploy-website` on an open PR triggers a
# deploy without needing another push.
types:
- opened
- reopened
- synchronize
- labeled
- closed
paths:
- "website/**"
- "packages/alchemy/**"
- "bun.lock"
- ".github/workflows/deploy.yml"
concurrency:
group: deploy-website-${{ github.ref }}
cancel-in-progress: false
env:
STAGE: ${{ github.event_name == 'pull_request' && format('pr-{0}',
github.event.number) || (github.ref == 'refs/heads/main' && 'prod' ||
github.ref_name) }}
jobs:
deploy:
# Deploy on push-to-main and `workflow_dispatch` always. On PRs,
# require BOTH:
# - the PR is internal (forks can't access bot/Cloudflare secrets
# so `create-github-app-token` would error immediately), AND
# - the PR carries the `deploy-website` label (opt-in — most PRs
# don't need a website preview, so default to skipping).
if: >-
github.event.action != 'closed' &&
(github.event_name != 'pull_request' ||
(github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'deploy-website')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# `bun install` needs the distilled submodule (workspace member)
submodules: true
# Mint a token for the alchemy-version-bot GitHub App so the PR
# preview comment (created via GitHub.Comment in alchemy.run.ts)
# posts under the bot's identity instead of `github-actions[bot]`.
# Same App as release.yml — its installation scopes already cover
# PR comments.
- name: Generate bot token
id: bot-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ secrets.ALCHEMY_VERSION_BOT_ID }}
private-key: ${{ secrets.ALCHEMY_VERSION_BOT_PRIVATE_KEY }}
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Install dependencies
run: bun install
# Secrets (Cloudflare credentials, etc.) are injected by
# `doppler run` from the `alchemy-v2` project — `prod` config on
# main, `dev` config everywhere else.
- name: Deploy
working-directory: website
run: bun alchemy deploy --stage "$STAGE" --yes
env:
PULL_REQUEST: ${{ github.event.number }}
CLOUDFLARE_API_TOKEN: ${{ startsWith(env.STAGE, 'prod') && secrets.PROD_CLOUDFLARE_API_TOKEN || secrets.TEST_CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ startsWith(env.STAGE, 'prod') && secrets.PROD_CLOUDFLARE_ACCOUNT_ID || secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
BUILD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
GITHUB_TOKEN: ${{ steps.bot-token.outputs.token }}
cleanup:
runs-on: ubuntu-latest
if: >-
github.event_name == 'pull_request' && github.event.action == 'closed' &&
github.event.pull_request.head.repo.full_name == github.repository
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# `bun install` needs the distilled submodule (workspace member)
submodules: true
- name: Generate bot token
id: bot-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ secrets.ALCHEMY_VERSION_BOT_ID }}
private-key: ${{ secrets.ALCHEMY_VERSION_BOT_PRIVATE_KEY }}
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Install Doppler CLI
uses: dopplerhq/cli-action@4819d808ab99e5cde19a0637a16536a4038fad73 # v4
- name: Install dependencies
run: bun install
- name: Safety Check
run: |-
if [ "${{ env.STAGE }}" = "prod" ]; then
echo "ERROR: Cannot destroy prod environment in cleanup job"
exit 1
fi
- name: Destroy Preview Environment
working-directory: website
run: >-
doppler run --project "$DOPPLER_PROJECT" --config "$DOPPLER_CONFIG"
-- bun alchemy destroy --stage "$STAGE" --yes
env:
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}
PULL_REQUEST: ${{ github.event.number }}
GITHUB_TOKEN: ${{ steps.bot-token.outputs.token }}
+6 -1
View File
@@ -45,4 +45,9 @@ examples/cloudflare-worker/src/scratch.ts
!/packages/alchemy/bin/cli.js
.vendor/*
.tmp
pnpm-lock.yaml
pnpm-lock.yaml
!.vendor/distilled
.ai-workspace/
/processes/
.probe
+11 -1
View File
@@ -1,3 +1,13 @@
[submodule "vendor/alchemy"]
path = .vendor/alchemy
url = git@github.com:alchemy-run/alchemy.git
url = https://github.com/alchemy-run/alchemy.git
# ~900MB reference-only checkout of the v1 repo — skipped by
# `git submodule update --init` (CI included). Fetch explicitly with
# `git submodule update --init --checkout .vendor/alchemy`.
update = none
[submodule "distilled"]
path = distilled
url = https://github.com/alchemy-run/distilled.git
[submodule "cloudflare-tools"]
path = cloudflare-tools
url = https://github.com/alchemy-run/cloudflare-tools.git
+3 -1
View File
@@ -17,6 +17,8 @@
"**/*.mdx",
"**/*.md",
"**/.vendor/**",
"**/package.json"
"**/package.json",
"./distilled",
"**/fixtures/chart/templates/**"
]
}
+17 -6
View File
@@ -1,12 +1,17 @@
{
"diffEditor.renderSideBySide": false,
"js/ts.experimental.useTsgo": true,
"typescript.experimental.useTsgo": true,
"typescript.tsdk": "node_modules/@typescript/native-preview/lib",
"typescript.native-preview.tsdk": "node_modules/@typescript/native-preview/lib",
// Point the editor at THIS workspace's pinned typescript@7 install. The
// Effect diagnostics (e.g. `anyUnknownInErrorContext`) come from
// `effect-tsgo patch` (run automatically on install via `prepare`), which
// patches the workspace `node_modules/typescript` binary in place — the
// editor must use the WORKSPACE version or no Effect diagnostics appear.
// Opt in once per machine via Command Palette -> "TypeScript: Select
// TypeScript Version" -> "Use Workspace Version".
// (`enablePromptUseWorkspaceTsdk` below makes the editor prompt for this.)
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.importModuleSpecifierEnding": "js",
"typescript.preferences.importModuleSpecifierEnding": "ts",
"oxc.enable": true,
"oxc.lint.run": "onSave",
"json.schemaDownload.enable": true,
@@ -45,6 +50,12 @@
"packages/alchemy/bin/**/*.js*": true,
"packages/alchemy/bin/**/*.d*": true
},
"files.watcherExclude": {
"**/distilled/**": true
},
"search.exclude": {
"**/distilled/**": true
},
"[typescript]": {
"editor.indentSize": 2,
"editor.defaultFormatter": "oxc.oxc-vscode"
@@ -62,4 +73,4 @@
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"oxc.enable.oxfmt": true
}
}
+342 -53
View File
@@ -22,10 +22,9 @@ A Resource Provider implements the following Lifecycle Operations:
- **Pre-Create** - an optional operation that creates a stub of a Resource before reconcile runs. Used to resolve circular dependencies — e.g. Function A and B depend on each other, so we create a stub of Function A first and then `reconcile` later wires up the real dependency.
- **Reconcile** - converges a Resource's actual cloud state to the desired state described by the new Input Properties. Called for both first-time provisioning and subsequent updates. The provider receives `output` (current Attributes) and `olds` (previous Props) which may both be `undefined` on a greenfield create, both defined on an update, or `output !== undefined && olds === undefined` on an adoption. See the **Reconciler doctrine** section below for the required shape.
- **Delete** - deletes an existing Resource. It must be designed as idempotent because it is always possible for state persistence to fail after the delete operation is called. If the resource doesn't exist during deletion, it should not be considered an error.
- **Capability** - a runtime requirement of a Function (e.g. require `SQS.SendMessage` on a `SQS.Queue`). Each Capability is split into two parts: a `Binding.Service` (runtime SDK wrapper) and a `Binding.Policy` (deploy-time IAM/binding attachment).
- **Binding.Service** - an Effect Service that wraps an SDK client and exposes a `.bind(resource)` method returning a typed callable for runtime use. Provided as a Layer on the **Function** Effect so it gets bundled into the Lambda/Worker. See [Binding](./packages/alchemy/src/Binding.ts).
- **Binding.Policy** - an Effect Service that runs only at deploy time to attach IAM policies (AWS) or bindings (Cloudflare) to a Function's role/config. At runtime, `Binding.Policy` uses `Effect.serviceOption` so it gracefully becomes a no-op when the layer is not provided. Policy layers are provided on the **Stack** via `AWS.providers()()`, not on the Function.
- **Binding** - data attached to a Resource via `resource.bind(data)`. A Binding is a `{ context: PolicyContext, data: BindingData }` tuple that is collected on the Stack during plan/deploy. Bindings enable circular references between Resources — the `Binding.Policy` calls `ctx.bind({ policyStatements: [...] })` on the target Function, which records the binding data on the Stack. The Resource Provider then receives the resolved binding data in its `reconcile` lifecycle operation via the `bindings` parameter.
- **Capability** - a runtime requirement of a Function (e.g. require read access to an `R2Bucket`, or `SQS.SendMessage` on a `SQS.Queue`). A Capability is modeled as one or more `Binding.Service`s. Where the underlying API distinguishes access levels, split it into `Read` / `Write` / `ReadWrite` services (see the **Read/Write/ReadWrite binding convention** below); otherwise a single service suffices. Each service typically ships two interchangeable implementations: a native **binding** (`*Binding`) and a token-scoped **HTTP** client (`*Http`).
- **Binding.Service** - an Effect Service that exposes a `.bind(resource)` method returning a typed runtime client. Its outer (init) Effect resolves the host Function/Worker and its environment, then registers the deploy-time binding — environment variables, IAM policy statements (AWS), or a native Cloudflare binding — by calling ``host.bind`${resource}`(data)``, guarded by `!globalThis.__ALCHEMY_RUNTIME__` so it is a no-op once running inside the deployed Function/Worker. Provided as a Layer on the **Function/Worker** Effect so it gets bundled into the Lambda/Worker. See [Binding](./packages/alchemy/src/Binding.ts).
- **Binding** - data attached to a target Function/Worker via ``host.bind`${resource}`(data)`` from inside a `Binding.Service`. The binding data is collected on the Stack during plan/deploy. Bindings enable circular references between Resources — e.g. a capability binds `{ policyStatements: [...] }` (AWS) or `{ bindings: [...] }` (Cloudflare) onto the host. The Resource Provider then receives the resolved binding data in its `reconcile` lifecycle operation via the `bindings` parameter.
- **Binding Contract** - the shape of data a Resource accepts from Bindings. For example, a Lambda Function accepts `{ env?: Record<string, any>, policyStatements?: PolicyStatement[] }` because it needs environment variables and IAM policies. A Cloudflare Worker accepts `{ bindings: Worker.Binding[] }` for its native binding system. The Binding Contract is declared as the fourth type parameter on the `Resource` interface. See [Lambda Function](./packages/alchemy/src/AWS/Lambda/Function.ts) and [Cloudflare Worker](./packages/alchemy/src/Cloudflare/Workers/Worker.ts).
- **Dependency** - Resources depend on other Resources through two mechanisms:
- Output Properties of one Resource passed as Input Properties to another Resource (non-circular, directed acyclic graph)
@@ -39,7 +38,7 @@ A Resource Provider implements the following Lifecycle Operations:
- **Physical Name** - a unique name for a Resource, e.g. `my-bucket-1234567890`. It is usually best to generate them using the built-in createPhysicalName utility function which generates
- **Logical ID** - the logical ID identifying a resource within a Stack, e.g. `my-bucket`. It is stable across creates, updates, deletes and replaces.
- **Instance ID** - a unique identifier for an instance of a Resource. It is stable across creates, updates and deletes. It changes when a resource is replaced. It is truncated and used as the suffix of the Physical Name.
- **Event Source** - a special kind of Binding between a Function and a Resource that produces events that invoke the Function, e.g. `SQS.QueueEventSource`. Event Sources are implemented as Binding.Service + Binding.Policy pairs, where the attach logic creates/updates the event source mapping via the cloud provider API.
- **Event Source** - a special kind of Binding between a Function and a Resource that produces events that invoke the Function, e.g. `SQS.QueueEventSource`. Implemented as a `Binding.Service` whose init Effect both registers the runtime event listener on the host and, at deploy time, yields the event-source mapping resource (or calls the cloud provider API to create/update it).
- **Replacement** - the process of replacing a Resource with a new one. A new one is created, downstream dependencies are updated with the new reference, and then the old one is deleted. Or, the old one is deleted first and then the new one is created.
- **Dependency Violation** - an error that some APIs call when an operation cannot be performed because a dependency is not met. E.g. you cannot delete an EIP until the NAT Gateway it is attached to is deleted. Lifecycle operations typically retry Dependency Violations.
- **Eventual Consistency** - create/update/delete operations can be eventually consistent leading to a variety of failure modes. For example, a Resource may be created but not yet available for use, or a Resource may be deleted but still appear in the console. Errors caused by eventual consistency should be retried, and lifecycle operations/tests should be carefully designed to wait for consistency before proceeding.
@@ -49,25 +48,42 @@ A Resource Provider implements the following Lifecycle Operations:
# File System Conventions
Each Service's Resources follow the same pattern. Resource contract and provider are co-located in the same file. Capabilities (Binding.Service + Binding.Policy) are in separate files named after the capability.
Each Service's Resources follow the same pattern. Resource contract and provider are co-located in the same file. Each Capability lives in its own file(s) named after the capability and access level (`Binding.Service` contract + the `*Binding` / `*Http` implementations).
```sh
# source files
packages/alchemy/src/{Cloud}/{Service}/index.ts # re-exports all resources and capabilities
packages/alchemy/src/{Cloud}/{Service}/index.ts # re-exports resources, capability contracts, and impl layers
packages/alchemy/src/{Cloud}/{Service}/{Resource}.ts # resource contract + resource provider
packages/alchemy/src/{Cloud}/{Service}/{Capability}.ts # Binding.Service + Binding.Policy for a capability
packages/alchemy/src/{Cloud}/{Service}/{Capability}.ts # Binding.Service contract + runtime client interface
# test files
packages/alchemy/test/{Cloud}/{Service}/{Resource}.test.ts
# docs (auto-generated from source-code JSDoc - DO NOT manually edit)
website/src/content/docs/providers/{Cloud}/{Resource}.md # API reference, generated by `bun generate:api-reference`
```
A capability that exposes distinct access levels is split into a contract per level plus interchangeable native-binding and HTTP implementations, with shared scaffolding kept in *un-exported* helper files (see the **Read/Write/ReadWrite binding convention** below). For example, the Cloudflare R2 bucket capability:
```sh
packages/alchemy/src/Cloudflare/R2/BucketTypes.ts # shared types + error (exported)
packages/alchemy/src/Cloudflare/R2/BucketRead.ts # BucketRead Binding.Service + ReadBucketClient (exported)
packages/alchemy/src/Cloudflare/R2/BucketWrite.ts # BucketWrite Binding.Service + WriteBucketClient (exported)
packages/alchemy/src/Cloudflare/R2/BucketReadWrite.ts # BucketReadWrite Binding.Service + ReadWriteBucketClient (exported)
packages/alchemy/src/Cloudflare/R2/BucketBinding.ts # shared worker-binding scaffolding (NOT exported from index)
packages/alchemy/src/Cloudflare/R2/BucketReadBinding.ts # ReadBucketBinding layer + makeRead (exported)
packages/alchemy/src/Cloudflare/R2/BucketWriteBinding.ts # WriteBucketBinding layer + makeWrite (exported)
packages/alchemy/src/Cloudflare/R2/BucketReadWriteBinding.ts # ReadWriteBucketBinding layer (exported)
packages/alchemy/src/Cloudflare/R2/BucketHttp.ts # shared HTTP/token scaffolding (NOT exported from index)
packages/alchemy/src/Cloudflare/R2/BucketReadHttp.ts # ReadBucketHttp layer (exported)
packages/alchemy/src/Cloudflare/R2/BucketWriteHttp.ts # WriteBucketHttp layer (exported)
packages/alchemy/src/Cloudflare/R2/BucketReadWriteHttp.ts # ReadWriteBucketHttp layer (exported)
```
Examples of actual paths:
```sh
packages/alchemy/src/AWS/S3/Bucket.ts # S3 Bucket resource + provider
packages/alchemy/src/AWS/S3/GetObject.ts # S3 GetObject Binding.Service + Binding.Policy
packages/alchemy/src/AWS/S3/PutObject.ts # S3 PutObject Binding.Service + Binding.Policy
packages/alchemy/src/AWS/S3/GetObject.ts # S3 GetObject capability (Binding.Service)
packages/alchemy/src/AWS/S3/PutObject.ts # S3 PutObject capability (Binding.Service)
packages/alchemy/src/AWS/SQS/Queue.ts # SQS Queue resource + provider
packages/alchemy/src/AWS/SQS/SendMessage.ts # SQS SendMessage capability
packages/alchemy/src/AWS/Kinesis/Stream.ts # Kinesis Stream resource + provider
@@ -79,6 +95,75 @@ packages/alchemy/src/AWS/EC2/Vpc.ts # VPC resource + provider
packages/alchemy/src/AWS/EC2/Subnet.ts # Subnet resource + provider
```
# The Resource Factory Process
Alchemy resource coverage is produced as a **software factory**: fleets of agents implement and live-test IaC resources in waves, and every API mismatch the tests surface is fed back as a patch to distilled. The factory was used to take Cloudflare from 36 to 239 cataloged resources (250 test files / 600+ test cases, 1000+ patched operations) and is the template for every future provider.
## The flywheel
```
catalog ──> implement ──> live test ──> unmatched error / wrong schema?
^ │
│ v
update statuses <── regenerate service <── patch distilled
```
1. **Catalog** — fan out research agents over the provider's distilled service modules (one batch per thematic group). Each agent reads the generated SDK (`distilled/packages/{cloud}/src/services/{service}.ts`), cross-references the vendor API docs, and writes a self-contained design spec to `processes/{Cloud}/catalog/{service}.md`: resources, namespaces, props/attrs with replacement rules, lifecycle-to-operation mapping, scope (account/zone), testability, priority. The coordinator aggregates a machine-readable `summary.json` + human `INDEX.md` that tracks `implemented | partial | missing` per resource — this is the factory's order book.
2. **Implement + test** in waves (below). Tests run against the real cloud (`bun run test --profile testing`); zone-scoped tests use the standing test zone (`alchemy-test-2.us` via `findZoneByName`).
3. **Patch the SDK, never the consumer** — every `UnknownCloudflareError`, out-of-union status error, or wrong request/response schema found by a test becomes a patch under `distilled/packages/{cloud}/patches/{service}/{op}.json` (see the Typed Error Doctrine section). Regenerate only that service. The typed union improves for every future consumer of the SDK — that is the flywheel's output.
4. **Update the catalog** statuses after each wave and pick the next batch from the order book. Repeat until everything left is documented as out of scope (deprecated APIs, billing/data-only endpoints, closed-beta, needs-external-systems).
## Orchestration rules (the coordinator)
- **One workflow at a time**, ~12 concurrent agents (cap ≈ CPU cores − 2). Two parallel workflows double throughput but also double crash blast-radius — only do it when the machine and budget clearly allow.
- **One agent per distilled service.** Service ownership is the unit of isolation: only the owner may touch `patches/{service}/` and regenerate `src/services/{service}.ts`, so generator runs never race. An agent may own several resources of its service; a very large same-service backlog (e.g. zero-trust) runs as a **sequential chain** of agents inside the workflow, in parallel with all other services.
- **Shared-file discipline.** `Providers.ts` and the provider barrel `index.ts` are edited by every agent: single minimal insertions only, re-read and retry on edit conflict, never rewrite wholesale.
- **`Layer.mergeAll` ceiling.** Keep `Providers.ts`'s provider layers in *nested* `Layer.mergeAll` groups (~90 entries each). A flat ~200-argument call exceeds tsc's variadic inference and **silently drops the tail layers** from the inferred union, producing baffling `Provider<X> is not assignable to StackServices` cascades across every test file.
- **Crash resilience.** Word every task as *assess-first*: "partial work may exist from an interrupted run — list your dirs, read existing files, check registration, FINISH rather than rewrite." Completed agent results are banked in the workflow journal even if the workflow dies; the coordinator recovers them from `journal.jsonl` and re-dispatches only the lost tasks.
- **The coordinator (not agents) does**: the authoritative type-check, distilled lib rebuilds, combined verification runs, catalog/index updates, cross-cutting fixes (shared-file restructures, Effect-version API migrations), and deterministic mass transforms (mechanical codemods are scripted centrally, not fanned out).
- **Monitor for stalls**: an agent transcript that hasn't been written for ~5 minutes with no child test process is stalled — kill and re-dispatch; don't wait.
## Resource budget: one type-checker for the whole factory
`tsc -b` over the workspace is expensive; dozens of agents running it concurrently thrashes the machine (and concurrent `tsbuildinfo` writes race). Instead:
- **Agents are banned** from running `tsc` or `bun run build` (root or distilled) in any form. The coordinator owns type-checking and runs a one-shot `bun tsc -b` at wave boundaries.
- **The test runner resolves distilled from `src/*.ts` directly, NOT the built `lib/`** (`alchemy-test` runs in plain bun, which resolves the `bun` export condition natively). So a regenerated service is **immediately test-visible** the moment `bun scripts/generate.ts --service {service}` (+ oxlint/oxfmt) finishes — there is nothing to rebuild and **nothing to wait for**. Do NOT sleep and do NOT gate a test re-run on a build after regenerating. This applies to response-schema patches as well as error-tag-only patches.
## Speed doctrine: never wait on a hang
- Run tests with `bun run test` (works from the repo root or `packages/alchemy`; suite paths are relative to `packages/alchemy`, e.g. `test/Cloudflare/...`). Wrap **every** test invocation in a hard kill: `timeout 240 bun run test <suite> --profile testing`. Hitting the wall **is** the failure — read the partial output (and the run's log under `.alchemy/log/test/`), find the hang (unbounded retry, infinite pagination, the engine deadlock below), fix the root cause. Never just re-run hoping. The runner also prints the currently-running tests whenever nothing finishes for 10s — use that list to identify the hang.
- Per-test timeout ≤ 90–120s (`{ timeout: ... }` on the test, or `--timeout` for the whole run). A suite needing more than ~3–5 minutes total is a bug.
- Every `Effect.retry`/`Effect.repeat` is bounded: `times ≤ 8–10`, total backoff under ~45–60s. Never poll for asynchronous provisioning slower than ~90s — skipIf-gate instead.
- **Known engine bug**: a deploy that *replaces* a resource while simultaneously *removing* its old dependency deadlocks. Keep both dependencies deployed across replacement steps in tests (see `test/Cloudflare/R2/BucketEventNotification.test.ts`).
- **Three-iteration budget**: if a suite is not green after ~3 fix iterations and the blocker is platform behavior (entitlement, slow async provisioning, beta API), implement fully, skipIf-gate with the typed tag and exact error, verify a skip-clean run, and report honestly. Do not burn an hour on one resource.
## Entitlement gating pattern
Most enterprise/plan-gated resources are still fully implementable; only the live lifecycle is gated:
1. **Probe once** against the real API to capture the exact rejection (code + message). If it surfaces as an untyped catch-all, patch distilled first so the entitlement error is a typed tag (e.g. `MagicTransitNotOnboarded` code 1012, `SaasQuotaNotAllocated` code 1404, `AdvancedCertificateManagerRequired` code 1450).
2. Keep an **ungated probe test** that asserts the typed tag is returned — this proves both the patch and the gating are correct, forever, at near-zero cost.
3. skipIf-gate the full lifecycle behind an env var (`CLOUDFLARE_TEST_MAGIC_TRANSIT=1`, `CLOUDFLARE_TEST_DLP=1`, …) so an entitled account can run it unchanged.
4. Record the testability verdict (`yes | limited | no`) and the exact error in the catalog notes.
Deprecated APIs (superseded by Rulesets etc.), billing/subscription objects, pure data-APIs, and closed-beta endpoints are *documented as out of scope* in `INDEX.md` rather than implemented.
## What every agent task prompt must include
A wave task prompt is a contract. Include, every time:
1. The **distilled service the agent owns** and the resources to build (with namespace + directory).
2. **Assess-first** instruction (finish partial work, don't rewrite).
3. The reading list: this file's Reconciler doctrine + Typed Error Doctrine, the catalog spec, the distilled service module + existing patches, current exemplar resources/tests (account-level CRUD, zone singleton capture-and-restore, observe-before-delete), and the registration files.
4. The **type-check/build ban** (above) — agents never run `tsc`/`bun run build`; the coordinator owns type-checking.
5. The **speed doctrine** (above) verbatim — agents rediscover unbounded waits otherwise.
6. The **Typed Error Doctrine** hard rule with the patch-regenerate command for *their* service only.
7. Registration discipline for the shared files, including the nested-mergeAll note.
8. Test requirements: `test.provider`, start **and** end with `stack.destroy()`, deterministic names (engine default or constant), out-of-band verification via distilled, typed wait-until-gone, replacement coverage where applicable.
9. Known footguns: `diff` receives `Input<Props>` — narrow with `isResolved(news)` before property access; never `Input<T>` in declared Props; Effect 4 APIs (`Effect.result` + `Result.isSuccess/isFailure`, not `Effect.either`/`effect/Either`); request-schema patch keys are camelCase, response keys are wire snake_case; fixtures (CSRs, PEMs, JWKS) are generated once and checked in as constants, never at test time.
10. A **structured result schema**: `{ service, resources, testsPassed, testCommand, files, patches (with reasons), skippedTests (with exact errors), notes }` — the coordinator aggregates these into the catalog.
# Documentation Generation
**Source of truth:** The source code is the single source of truth for all API documentation. JSDoc comments in `packages/alchemy/src/**/*.ts` are extracted and used to generate the public API reference markdown.
@@ -185,9 +270,11 @@ This generates:
- Show real-world patterns like error handling, combining with other resources
- Use descriptive titles that explain what the example demonstrates
# Workflow
# Workflow (per-service inner loop)
Development of Alchemy-Effect Resources is heavily pattern based. Each Service has many Resources that each have 0 oor more Capabilities and Event Sources. When working on a new Service, the following steps should be followed.
This is the inner loop that each factory agent (see **The Resource Factory Process** above) executes for the service it owns — it applies equally when a single engineer brings up one service by hand.
Development of Alchemy-Effect Resources is heavily pattern based. Each Service has many Resources that each have 0 or more Capabilities and Event Sources. When working on a new Service, the following steps should be followed.
1. Research the AWS Service and identify its Resources, Identifier Types, Structs, Capabilities, and Event Sources. Refer to the corresponding Terraform Provider, Pulumi Provider, and CloudFormation docs for that service (use the provided tools specifically for searching these docs for services and resources).
@@ -348,53 +435,92 @@ export interface Function extends Resource<
> {}
```
:::tip
Some Input Property types are wrapped in an `Input<T>`, but not all are. Only properties that may need to be references to another resource's Output Attribute. E.g. common use-cases are `Input<VpcId>`, `Input<QueueUrl>`, `Tags: Record<string, Input<string>>`.
:::
:::warning
For fields like `name: string`, `bucketName: string`, `bucketPrefix: string`, you should not use `Input<string>` because these properties need to be statically knowable in the `diff` function.
**Never use `Input<T>` in declared Props interfaces.** Declare plain types (`zoneId: string`, `ips?: string[]`, nested structs with plain fields). The `Resource` machinery applies `Input` automatically — and `Input<T>` is deep (it recursively distributes over arrays and object fields), so even nested references like `memberships: [{ identifier: zone.zoneId }]` accept `Output<string>` without any explicit annotation. Writing `Input<string>` in a Props interface produces a redundant double-wrap.
```ts
// ❌ wrong
export interface LoadBalancerProps {
zoneId: Input<string>;
}
// ✅ right — the engine wraps automatically and deeply
export interface LoadBalancerProps {
zoneId: string;
}
```
`Input<T>` in a *function signature* is still legitimate when the function genuinely receives unresolved values at runtime (e.g. helpers that resolve tag maps, or `DurableObjectNamespace.from(scriptName: Input<string>)`).
:::
7. Implement the Capabilities as `Binding.Service` + `Binding.Policy` pairs in `packages/alchemy/src/{Cloud}/{Service}/{Capability}.ts`.
7. Implement each Capability as a `Binding.Service` in `packages/alchemy/src/{Cloud}/{Service}/{Capability}.ts`.
Each capability has two parts:
A single `Binding.Service` does both halves of a capability in one Effect:
- **`Binding.Service`** — runtime SDK wrapper, provided on the Function Effect (bundled into Lambda/Worker)
- **`Binding.Policy`** — deploy-time IAM policy attachment, provided on the Stack via `AWS.providers()()` (never bundled)
- **Init (outer) Effect** — resolves the host Function/Worker and its environment, then registers the deploy-time binding by calling ``host.bind`${resource}`(data)`` (environment variables + IAM policy statements for AWS, native bindings for Cloudflare), guarded by `!globalThis.__ALCHEMY_RUNTIME__` so it becomes a no-op once running inside the deployed Function/Worker.
- **Runtime (inner) callable** — the typed client returned to the caller; its methods require `Alchemy.RuntimeContext` (see below).
There is no separate deploy-time policy object and nothing to register in `providers()` — the implementation layer is provided directly on the Function/Worker Effect.
Read through the established capabilities to understand the pattern:
- [S3 GetObject](./packages/alchemy/src/AWS/S3/GetObject.ts) — `Binding.Service` + `Binding.Policy`
- [S3 PutObject](./packages/alchemy/src/AWS/S3/PutObject.ts) — `Binding.Service` + `Binding.Policy`
- [SQS SendMessage](./packages/alchemy/src/AWS/SQS/SendMessage.ts) — `Binding.Service` + `Binding.Policy`
- [DynamoDB GetItem](./packages/alchemy/src/AWS/DynamoDB/GetItem.ts) — `Binding.Service` + `Binding.Policy`
- [Kinesis PutRecord](./packages/alchemy/src/AWS/Kinesis/PutRecord.ts) — `Binding.Service` + `Binding.Policy`
- [Lambda InvokeFunction](./packages/alchemy/src/AWS/Lambda/InvokeFunction.ts) — `Binding.Service` + `Binding.Policy`
- [S3 GetObject](./packages/alchemy/src/AWS/S3/GetObject.ts), [S3 PutObject](./packages/alchemy/src/AWS/S3/PutObject.ts)
- [SQS SendMessage](./packages/alchemy/src/AWS/SQS/SendMessage.ts), [DynamoDB GetItem](./packages/alchemy/src/AWS/DynamoDB/GetItem.ts)
- [Kinesis PutRecord](./packages/alchemy/src/AWS/Kinesis/PutRecord.ts), [Lambda InvokeFunction](./packages/alchemy/src/AWS/Lambda/InvokeFunction.ts)
- Access-split Cloudflare capabilities: [R2 Bucket](./packages/alchemy/src/Cloudflare/R2/), [KV Namespace](./packages/alchemy/src/Cloudflare/KV/), [Queue](./packages/alchemy/src/Cloudflare/Queue/)
For Event Sources, see:
- [SQS QueueEventSource](./packages/alchemy/src/AWS/SQS/QueueEventSource.ts)
- [S3 BucketEventSource](./packages/alchemy/src/AWS/S3/BucketEventSource.ts)
The `Binding.Policy` implementation calls `ctx.bind({ policyStatements: [...] })` on the target Function, which records binding data on the Stack. The `Binding.Service` implementation resolves the Policy via `yield* Policy(resource)`, then returns a typed callable that wraps the SDK client. At runtime, the Policy is not provided and becomes a no-op.
Each capability exports four things:
Each capability exports its contract plus one or more implementation layers:
```ts
// 1. The Binding.Service class
// 1. The Binding.Service class (the contract) + a bind alias for ergonomic use
export class PutRecord extends Binding.Service<...>()("AWS.Kinesis.PutRecord") {}
export const putRecord = PutRecord.bind;
// 2. The Binding.Service Live layer (provided on Function Effect)
export const PutRecordLive = Layer.effect(PutRecord, ...);
// 3. The Binding.Policy class
export class PutRecordPolicy extends Binding.Policy<...>()("AWS.Kinesis.PutRecord") {}
// 4. The Binding.Policy Live layer (provided on Stack via AWS.providers()())
export const PutRecordPolicyLive = Layer.effect(PutRecordPolicy, ...);
// 2. The implementation layer — resolves the host + environment, registers the
// binding inline (guarded by __ALCHEMY_RUNTIME__), and returns the runtime client.
export const PutRecordLive = Layer.effect(
PutRecord,
Effect.gen(function* () {
const host = yield* Worker; // or the AWS Function host
const env = yield* WorkerEnvironment; // or Lambda.FunctionEnvironment
return Effect.fn(function* (stream: Stream) {
if (!globalThis.__ALCHEMY_RUNTIME__) {
// AWS: { policyStatements: [...] } Cloudflare: { bindings: [...] }
yield* host.bind`${stream}`({ policyStatements: [...] });
}
return /* typed runtime client closing over `env` */;
});
}),
);
```
Provide the implementation layer on the **Function/Worker** Effect (`Effect.provide(PutRecordLive)`).
### Read/Write/ReadWrite binding convention
When a capability's API distinguishes access levels (R2 `head`/`get`/`list` vs `put`/`delete`; KV `get`/`getWithMetadata`/`list` vs `put`/`delete`), split it into three `Binding.Service`s so consumers can request least privilege, each with two interchangeable implementations:
- **`{Cap}Read.ts` / `{Cap}Write.ts` / `{Cap}ReadWrite.ts`** — the `Binding.Service` class + runtime client interface + a `bind` alias (e.g. `ReadBucket = BucketRead.bind`). `ReadWrite`'s client interface `extends` both the `Read` and `Write` client interfaces.
- **`{Cap}Binding.ts`** — *shared* worker-binding scaffolding: a `make{Cap}Binding({ makeClient })` that resolves `WorkerEnvironment` + host `Worker`, registers the native binding via ``host.bind`${resource}`(...)`` (guarded by `__ALCHEMY_RUNTIME__`), plus a `make{Cap}Helpers` returning the low-level `raw`/`use`/`tryPromise` primitives. **Do NOT export this file from `index.ts`.**
- **`{Cap}ReadBinding.ts` / `{Cap}WriteBinding.ts` / `{Cap}ReadWriteBinding.ts`** — `Layer.effect` implementations over the native binding (`ReadBucketBinding`, …) plus the `makeRead`/`makeWrite` client builders. `ReadWrite` composes the read + write builders.
- **`{Cap}Http.ts`** — *shared* HTTP/token scaffolding: a `makeHttp{Cap}Binding({ permissionGroups, makeClient })` that mints a scoped `AccountApiToken` with the right permission groups, binds the token's `value`/`accountId` into the Worker, and resolves the per-operation scope. **Do NOT export this file from `index.ts`.**
- **`{Cap}ReadHttp.ts` / `{Cap}WriteHttp.ts` / `{Cap}ReadWriteHttp.ts`** — `Layer.effect` implementations over the cloud's HTTP API (`ReadBucketHttp`, …). Operations the HTTP API can't support `Effect.die` with a typed error.
Rules:
- **Keep shared scaffolding internal.** Re-export only the contracts, the per-level layers, and the client builders from `index.ts`. Exporting `{Cap}Binding.ts`/`{Cap}Http.ts` leaks generic helper names into the flat `Cloudflare`/`AWS` namespace and collides across services.
- **Use service-unique helper names.** Avoid generic `makeHelpers`/`makeWrite`; prefix with the capability (`makeQueueHelpers`, `makeWriteQueueClient`) so re-exported builders never clash.
- **Namespace the public surface.** Export the service both flatly and as a namespace (`export * as KV from "./KV/index.ts"`) so callers write `Cloudflare.KV.ReadWriteNamespace(ns)`. The bind-alias callables drop the redundant service prefix (`ReadWriteNamespace`, not `ReadWriteKVNamespace`); the underlying classes/interfaces keep it (`KVNamespaceReadWrite`, `ReadWriteKVNamespaceClient`).
- **No resource-level `bind`.** The Resource is plain `Resource<T>("Cloud.Type")` with no `bind:` field; callers bind via the namespaced capability, not `resource.bind`.
- **Single-mode capabilities stay single.** A producer-only capability (e.g. Cloudflare Queue's send-only producer, which has no runtime read) ships just the `Write` service — don't invent a `Read` the runtime can't satisfy. The HTTP impl can still cover both directions where the API does.
Reference: [Cloudflare R2 Bucket](./packages/alchemy/src/Cloudflare/R2/), [KV Namespace](./packages/alchemy/src/Cloudflare/KV/), [Queue](./packages/alchemy/src/Cloudflare/Queue/).
### Runtime-only methods: color with `Alchemy.RuntimeContext`
The runtime callable returned by a `Binding.Service` (the inner Effect inside `.bind(resource)`'s return) **must** declare `Alchemy.RuntimeContext` as a requirement. This is how Alchemy models "this code can only run inside a deployed Function/Worker" at the type level — analogous to a colored function.
@@ -427,10 +553,14 @@ Rules:
Why this matters: consumers can build cloud-agnostic services on top of bindings using `Layer.effect(Tag, ...)` without polluting their service interface with `WorkerEnvironment`. See [Layers concept](./website/src/content/docs/concepts/layers.mdx).
After implementing, register the Policy in `AWS.providers()()`:
After implementing, re-export the contract and implementation layers from the service's `index.ts` (but keep the shared `{Cap}Binding.ts`/`{Cap}Http.ts` scaffolding un-exported).
- Add the `*PolicyLive` layer to `bindings()` in [Providers.ts](./packages/alchemy/src/AWS/Providers.ts)
- Re-export from the service's `index.ts`
### Isolate scope vs request scope (runtime bridges)
**Layer construction is isolate-scoped; the effects built services expose are request-scoped.**
- **At layer build / Worker init (instance scope)** a layer MAY resolve services and env/config, register listeners and `bind` declarations, assemble `Effect.fn` clients, and perform one-shot I/O that produces a plain cached value (e.g. fetch a secret and cache it for a client). It MUST NOT acquire **disposable** resources — connections, pools, streams, anything with a finalizer (`Layer.scoped` / `Effect.acquireRelease` / init-level `Effect.addFinalizer`) — or retain I/O-backed *objects* or promises across events (workerd pins them to the creating request's IoContext). The runtime bridges (Worker event, Durable Object call, Workflow run, Lambda invoke) build the layer stack **once per instance** on the first event. Instance finalizers run at instance shutdown at best: **never on workerd** (no teardown hook), and in a **best-effort 500 ms SIGTERM window on Lambda** (the generated entry registers an internal extension to obtain it and closes the instance scope on SIGTERM; not delivered on hard failures). Server processes (Containers, ECS Tasks) close their root scope on graceful exit.
- **At request scope**, anything needing I/O or cleanup is an effect requiring `Scope.Scope`, acquired lazily per call. Every bridge provides a fresh `Scope` per event; `Effect.addFinalizer` in a handler attaches to it and runs after the response (registered with `ctx.waitUntil` on workerd; settled inline on Lambda). Per-request memoization keys on the scope object (`yield* Effect.scope`) — see [Drizzle/Postgres.ts](./packages/alchemy/src/Drizzle/Postgres.ts) for the canonical WeakMap pattern. One pool/socket per event is the law on workerd (sockets are IoContext-pinned); Hyperdrive is the cross-request pooler.
:::tip
If you need to know what AWS region or account ID the resource is being created/updated in, you can use this inside any of the lifecycle operations.
@@ -447,8 +577,7 @@ You should favor getting the region/account INSIDE the lifecycle operations inst
```ts
reconcile: Effect.fn(function* ({ id, news, output, session }) {
const region = yield* Region;
const accountId = yield* Account;
const { accountId, region } = yield* AWSEnvironment.current;
});
```
@@ -541,6 +670,53 @@ See the [VPC Smoke Test](./test/AWS/EC2/Vpc.smoke.test.ts) for an example.
11. Add the resource-level JSDoc (`@section` + `@example` blocks) and field-level JSDoc on each prop/attribute on the source `.ts` file. Then run `bun generate:api-reference` to refresh `website/src/content/docs/providers/{Cloud}/{Resource}.md`. Do NOT manually edit the generated markdown.
# Typed Error Doctrine (distilled)
Every error a distilled operation can produce in practice MUST be a tagged error in that operation's **type-level** error union. The catch-all classes (`UnknownCloudflareError`, `CloudflareHttpError`, and the status-derived classes like `NotFound`/`BadRequest` that distilled leaves out of the typed union) exist only to *surface* gaps — they are never something alchemy code handles.
**When you hit an unmatched error** (an `UnknownCloudflareError`, or you find yourself wanting to check `CloudflareHttpError.status` or an out-of-union `NotFound`), the fix is ALWAYS a distilled patch, never a catch in alchemy:
1. Note the error's code / status / message from the failure output.
2. Add or extend `distilled/packages/cloudflare/patches/{service}/{operation}.json` with a **meaningful, resource-specific tag** (e.g. `WidgetNotFound`, not a bare `NotFound`):
```json
{ "errors": { "WidgetNotFound": [{ "code": 1234 }] } }
```
Matchers may combine `code`, `status`, and `message` (`{ "includes": "..." }` / `{ "matches": "..." }`) — e.g. `[{ "status": 400, "message": { "includes": "snippet not found" } }]` when Cloudflare misuses 400 for a missing resource. Prefer matching the Cloudflare error `code` when one exists; fall back to `status` + `message` otherwise.
3. Regenerate ONLY that service: `cd distilled/packages/cloudflare && bun scripts/generate.ts --service {service}` (then `bun oxlint --fix src/services/{service}.ts && bun oxfmt --write src/services/{service}.ts`).
4. Handle the now-typed tag in alchemy code and re-run the tests.
**Forbidden patterns** — these defeat the type system and must never appear in alchemy code or tests:
```ts
// ❌ unknown-typed structural predicates
const isNotFoundError = (e: unknown): boolean =>
Predicate.hasProperty(e, "_tag") && (e as { _tag: unknown })._tag === "NotFound";
// ❌ widening casts to duck-typed tags
Effect.retry({ while: (e) => (e as { _tag?: string })._tag === "Forbidden" })
// ❌ catching the catch-all HTTP error by status
Effect.catchIf((e) => e._tag === "CloudflareHttpError" && e.status === 404, ...)
```
**Required patterns** — fully inferred, no casts, no `unknown`:
```ts
// ✅ catch a typed tag
.pipe(Effect.catchTag("WidgetNotFound", () => Effect.void))
// ✅ retry while a typed tag is observed (e is the op's inferred error union)
Effect.retry({ while: (e) => e._tag === "WidgetNotFound", schedule, times })
// ✅ multiple tags
Effect.catchTag(["WidgetNotFound", "Gone"], () => Effect.succeed(undefined))
```
If `Effect.catchTag("SomeTag", ...)` fails to typecheck, that is the signal that distilled's union is missing the error — patch distilled (step 2 above); do not loosen the alchemy-side types.
# Test Fixtures for Effect-Native Workers / Functions
To test runtime behavior of an Effect-native Worker, Workflow, Lambda, etc., write a **fixture** that defines the Worker/Function with the bindings under test and exposes one HTTP route per behavior, then write a **test** that deploys the fixture once via `beforeAll` and drives it over HTTP.
@@ -569,10 +745,10 @@ import { Gateway } from "./gateway.ts";
export default class TestWorker extends Cloudflare.Worker<TestWorker>()(
"TestWorker",
{
main: import.meta.filename,
main: import.meta.url,
},
Effect.gen(function* () {
const aiGateway = yield* Cloudflare.AiGateway.bind(Gateway);
const aiGateway = yield* Cloudflare.AI.QueryGateway(Gateway);
return {
fetch: Effect.gen(function* () {
@@ -584,7 +760,7 @@ export default class TestWorker extends Cloudflare.Worker<TestWorker>()(
return HttpServerResponse.text("ok");
}),
};
}).pipe(Effect.provide(Cloudflare.AiGatewayBindingLive)),
}).pipe(Effect.provide(Cloudflare.AI.QueryGatewayBinding)),
) {}
```
@@ -596,8 +772,8 @@ Compose a `Stack` that deploys the fixture, share one deploy across the file wit
// Service.test.ts
import * as Alchemy from "@/index.ts";
import * as Cloudflare from "@/Cloudflare";
import * as Test from "@/Test/Vitest";
import { expect } from "@effect/vitest";
import * as Test from "@/Test/Alchemy";
import { expect } from "alchemy-test";
import * as Effect from "effect/Effect";
import * as Schedule from "effect/Schedule";
import * as HttpClient from "effect/unstable/http/HttpClient";
@@ -643,7 +819,7 @@ Notes:
- `afterAll.skipIf(!!process.env.NO_DESTROY)(destroy(Stack))` is the standard cleanup — set `NO_DESTROY=1` locally to keep the deployment around between runs while iterating.
- Always retry the first request (`Schedule.exponential("500 millis")`) — fresh workers.dev URLs and Lambda function URLs take a few seconds to start serving 200s.
- For POST: use `client.post(url)` for empty bodies, or `HttpClient.execute(HttpClientRequest.post(url).pipe(HttpClientRequest.bodyJsonUnsafe(body)))` for typed bodies.
- **Never use `while (Date.now() < deadline)` loops to poll** for an async side effect (a workflow status, a cron fire, a queue drain, eventual-consistency read, etc.). Use `Effect.repeat` with a `Schedule` and an `until` predicate so the polling participates in the Effect runtime — tracing, interruption, and error propagation work correctly, and the intent is declarative. Cap iterations with `times: N` (or a bounded schedule) so the test fails fast instead of running until the vitest timeout:
- **Never use `while (Date.now() < deadline)` loops to poll** for an async side effect (a workflow status, a cron fire, a queue drain, eventual-consistency read, etc.). Use `Effect.repeat` with a `Schedule` and an `until` predicate so the polling participates in the Effect runtime — tracing, interruption, and error propagation work correctly, and the intent is declarative. Cap iterations with `times: N` (or a bounded schedule) so the test fails fast instead of running until the test timeout:
```ts
// good — declarative, bounded, interruption-safe
@@ -655,7 +831,7 @@ Notes:
}),
);
// bad — opaque loop, ignores interruption, leaks into vitest timeout
// bad — opaque loop, ignores interruption, leaks into the test timeout
let value: Value | undefined;
const deadline = Date.now() + 180_000;
while (Date.now() < deadline) {
@@ -669,7 +845,7 @@ Notes:
## Reference implementations
- Cloudflare AiGateway — [worker fixture](./packages/alchemy/test/Cloudflare/AiGateway/worker.ts) + [test](./packages/alchemy/test/Cloudflare/AiGateway/AiGateway.test.ts) (the deploy+fetch case lives at the bottom of the file)
- Cloudflare.AI.Gateway — [worker fixture](./packages/alchemy/test/Cloudflare/AI/fixtures/TestWorker.ts) + [test](./packages/alchemy/test/Cloudflare/AI/Gateway.test.ts) (the deploy+fetch case lives at the bottom of the file)
- Cloudflare D1Connection — [worker fixture](./packages/alchemy/test/Cloudflare/D1/d1-worker.ts) + [test](./packages/alchemy/test/Cloudflare/D1/D1Binding.test.ts)
- Cloudflare Workflow — [workflow fixture](./packages/alchemy/test/Cloudflare/Workers/fixtures/test-workflow.ts) + [worker fixture](./packages/alchemy/test/Cloudflare/Workers/fixtures/workflow-worker.ts) + [test](./packages/alchemy/test/Cloudflare/Workers/Workflow.test.ts)
- Cloudflare Cron Trigger — [worker + DO fixture](./packages/alchemy/test/Cloudflare/Workers/fixtures/cron-worker.ts) + [test](./packages/alchemy/test/Cloudflare/Workers/CronEventSource.test.ts) (cron handler writes to a DO; test polls a fetch route with `Effect.repeat` until the scheduled handler fires)
@@ -700,7 +876,92 @@ Always run type checking before committing changes:
bun tsc -b
```
This runs the TypeScript compiler in build mode, which checks all projects in the workspace. This is critical because CI will fail if there are type errors.
This runs the TypeScript compiler in build mode, which checks all projects in the workspace (including the distilled packages, which are project references). This is critical because CI will fail if there are type errors.
## Running tests
`packages/alchemy/test` runs on **alchemy-test** (`packages/alchemy-test`), our own single-process, Effect-native test runner. The CLI is vitest/bun-test compatible: positional paths (files or directories) and `-t` work the same way.
There is exactly ONE entry point: `bun run test <options>`. It works identically from the repo root and from `packages/alchemy` (the root script just cds into `packages/alchemy`); suite paths are always relative to `packages/alchemy`. Compose the flags you need — there are no per-variant package scripts. NOTE: `bun run test`, not `bun test` — the latter invokes bun's own built-in test runner.
```bash
# a suite, against the real cloud
bun run test test/Cloudflare/{Service}/{Resource}.test.ts --profile testing
# a directory, filtered by test name
bun run test test/Cloudflare/Workers -t "cron" --profile testing
# positional args that aren't real paths are file-name substring filters
bun run test Bucket --profile testing # every *Bucket* test file
# skip the slow tests (replaces the old FAST=1 env prefix)
bun run test --fast --profile testing
# interactive TUI (humans only — never in an agent shell)
bun run test --tui
```
(`examples/` still use plain `bun test`.)
### Cleaning leaked test resources
If an interrupted live-cloud test leaves resources behind, do **not** add
test-specific API cleanup helpers, adoption workarounds, or alternate names to
make the test pass. Clean the testing account with the account-wide teardown
command, then rerun the failing test:
```bash
bun nuke
bun clear:state --profile testing
```
Lifecycle tests should continue to validate normal stack ownership and cleanup;
they must not silently adopt or directly delete leaked resources from earlier
runs.
Additional flags beyond vitest:
| Flag | Default | Purpose |
| ----------------- | ------- | ------------------------------------------------------------- |
| `-t <regex>` | — | Test-name pattern (regex, like bun/vitest) tested against the full nested title (`file > describes > name`), so any fragment matches regardless of nesting. An invalid regex degrades to a literal substring instead of erroring. Remember to escape regex metacharacters when filtering literally: `-t "create \(default\)"` |
| `--profile <name>` | — | Sets `ALCHEMY_PROFILE` before any test module is imported. Use `--profile testing` for live-cloud suites instead of an `ALCHEMY_PROFILE=testing` env prefix |
| `--fast` | off | Sets `FAST=1` before imports — suites `skipIf(process.env.FAST)` their slow tests (long-provisioning resources, smoke tests). Replaces the `FAST=1` env prefix |
| `--timeout <ms>` | 120000 | Default per-test timeout |
| `--retry <n>` | 2 | Re-runs of a failing test body (use `--retry 0` when debugging) |
| `--concurrency <n\|unbounded>` | 32 | Files running concurrently (one bun process, no forks). Bounded by default — unbounded saturates the event loop on large suites and produces spurious 0ms `beforeAll` timeouts |
| `--sequential` | off | Run tests within each file sequentially |
| `--tui` | off | Opt-in interactive TUI (default is line-per-test output) |
Output behavior (plain mode, the default):
- The collection phase (importing every test file, ~45s for the full suite) reports `collecting N/TOTAL test files (elapsed) <current file>` — repainted in place on a TTY, printed every 5s otherwise. A run that appears stuck before any test starts is almost always just collecting; if it really is stuck, the line names the file whose import hangs.
- One line per test as it finishes, prefixed with a `[done/total]` progress counter so the remaining count is visible; a **failing test prints its error and captured output inline** immediately.
- Passing tests' output is swallowed on the console — but **every** test's output (passes included) is streamed to a per-run log at **`.alchemy/log/test/{timestamp}-pid{pid}.log`** (relative to the cwd), so concurrent runs in different terminals never trample each other. The absolute path (with line/KB counts) is printed at the end of every run (`Full log: …`) — read that file when you need the complete record, e.g. a passing test's deploy output or a hang's partial log. The file is appended live, so it's readable mid-run; logs older than a week are pruned automatically (by stat mtime).
- If nothing finishes for 10s, the runner prints the list of currently-running tests with elapsed times — the first place to look when a run seems hung.
- Exit code is non-zero if any test failed.
Runner semantics to know:
- Everything runs in ONE bun process: files run concurrently (respecting `describe.sequential`), imports of all test files happen up-front (they must be lazy and pure — registration only, no top-level side effects beyond `Test.make`/`describe`/`test`).
- Tests that mutate process-global state (e.g. `process.env.PATH`) must pass `{ exclusive: true }` in the test options to take the whole-process write lock.
- The harness (`alchemy-test` package) provides `describe`, `it`/`test` (incl. `it.effect`/`it.live`), hooks, `layer`, `expect`, and `assert` — the codemod `scripts/codemod-alchemy-test.ts` migrates vitest imports and is idempotent.
- The runner runs in plain bun, so distilled resolves from `src/*.ts` via the `bun` export condition — a regenerated service is test-visible immediately, no `lib/` rebuild required.
## The convergence loop: nuke → test → census → fix-fleet
Ironing out the AWS suite is an iterative loop, driven by a coordinator, that terminates only when the suite is green AND the account is clean for **two consecutive rounds**. "Green" alone is not the bar — a passing test that leaves cloud resources behind is a provider bug by definition.
Each iteration:
0. **Clean slate** — first run `aws sso login` (the alchemy `testing` profile and the raw `aws` CLI ride the same SSO session; an expired token mid-round breaks the pipeline with auth errors — only escalate to a human if the login doesn't complete automatically). Then `bun nuke --yes` (deletes every alchemy-tagged cloud resource; `scripts/nuke.sh` already spares state buckets, SSO roles, and AWS-managed singletons) then `bun alchemy state clear ./stacks/nuke.ts --profile testing --yes`. Never overlap nuke with a running suite. Plain `bun clear:state` lacks the profile and dies on expired Cloudflare OAuth; nuke without `--yes` hangs on an interactive confirm in non-interactive shells.
1. **Full suite, bounded** — `bun run test test/AWS --profile testing`. The runner defaults to `--concurrency 32`; NEVER override it to `unbounded` on a full-suite run: all ~775 files' `beforeAll` deploys start at once, the event loop saturates, and hundreds of fake 0ms `beforeAll TimeoutError` failures drown the real signal (heap is ~8.5 GB regardless of N — the constraint is CPU, not memory). Target ≤10 min wall-clock, hard cap 128; measured 32 → ~21 min clean. The saturation tell is `beforeAll` failures at 0ms; real failures fail slow. If the cap can't reach 10 min, the residual is individual slow files — skipIf-gate them per the speed doctrine.
2. **Leak census** — `bun nuke --dry-run` after the suite; diff against the pre-suite baseline. Worklist = **failed services ∪ leaking services** (a service can pass green and still leak). Leave the leaked resources LIVE as forensic evidence for the fix agents; carry-over holdouts that survive repeated nuke passes (stuck deletes) go on the worklist too — their delete path is the bug.
3. **Fix-fleet workflow** — one agent per service on the worklist (account-singleton services — CloudTrail, Config, SecurityHub, GuardDuty, ControlTower, IdentityCenter — run as a sequential chain; everything else fans out). Each agent gets its exact failures, its leak inventory, and this root-cause priority: **provider bug > distilled patch > test fix** — never paper over a provider leak in the test. Each agent runs ONLY its own suite (`timeout 240 bun run test test/AWS/{Service} --profile testing`), audits its tests for non-deterministic names (rely on PhysicalName auto-naming; random data in message payloads/idempotency tokens is fine), verifies zero orphans from its service via out-of-band distilled list/describe calls, and reports a structured result. Agents never run tsc/build and never run the account-wide nuke.
4. **Gate** — the coordinator runs the one-shot `bun tsc -b`, fixes cross-cutting fallout, commits the iteration (+ distilled submodule bump when patches were made), and loops back to 0. Terminate on two consecutive iterations of green-suite + census reduced to documented-undeletable residue (e.g. BackupSearch terminal records, Contributor-Insights rules with no delete API, keys in scheduled deletion).
## Multi-agent sessions: the coordinator owns type-checking
When many agents work concurrently (see **The Resource Factory Process**), do NOT let each agent run `bun tsc -b` — concurrent runs thrash the machine and race on `tsbuildinfo`. Agents never invoke the compiler; the coordinator runs a one-shot `bun tsc -b` at wave boundaries as the authoritative type check.
## Build Commands
@@ -852,3 +1113,31 @@ Example PR description (BAD — do not do this):
### Summary ← no, summary needs no heading
Persist the user's theme...
```
# Blog / Release Notes Conventions
Release blog posts live in `website/src/content/docs/blog/` named
`YYYY-MM-DD-beta-NN.md` (date = the release date).
**Frontmatter `title` format:** `<version> - <short title>`, e.g.
`2.0.0-beta.45 - Config & RPC Workers`. The title renders in the
blog TOC sidebar, so the descriptive suffix must be short — a few
words that fit neatly on one line. Lead with the version so the
list stays sorted and scannable.
Writing style (match the existing beta posts, e.g.
[beta.41](./website/src/content/docs/blog/2026-05-20-beta-41.md),
[beta.44](./website/src/content/docs/blog/2026-05-22-beta-44.md)):
- **Lean, concise, zero-fluff.** Illustrate each new
feature/fix and link to the relevant docs/tutorials/guides.
- Read each PR in the release's changelog to understand what
actually changed before writing.
- Lead with the headline features (one `##` heading each, with a
short code snippet or `diff`), then fold the long tail into an
`## Also in this release` bullet list.
- Put breaking changes in a `:::caution` callout at the top.
- Cite PRs inline as `([#NNN](…/pull/NNN))` and credit external
contributors by name.
- End with a `## Where to go next` list of doc links plus the
CHANGELOG and compare links.
File diff suppressed because it is too large. Load diff
+29 -14
View File
@@ -1,6 +1,6 @@
<div align="center">
<a href="https://v2.alchemy.run">
<a href="https://alchemy.run">
<img src="./images/readme-hero.png" alt="Alchemy — Infrastructure as Effects" width="360" />
</a>
@@ -12,7 +12,7 @@
**Infrastructure-as-Effects** — cloud infrastructure and application logic as a single, type-safe [Effect](https://effect.website) program.
[Docs](https://v2.alchemy.run) · [Tutorial](https://v2.alchemy.run/tutorial/part-1) · [Examples](./examples) · [Discord](https://discord.gg/jwKw8dBJdN)
[Docs](https://alchemy.run) · [Tutorial](https://alchemy.run/tutorial/part-1) · [Examples](./examples) · [Discord](https://discord.gg/jwKw8dBJdN)
</div>
@@ -21,13 +21,13 @@
A Worker bound to a R2 bucket and serving objects from it:
```typescript
const Bucket = Cloudflare.R2Bucket("bucket");
const Bucket = Cloudflare.R2.Bucket("bucket");
export default Cloudflare.Worker(
"api",
{ main: import.meta.path },
{ main: import.meta.url },
Effect.gen(function* () {
const bucket = yield* Cloudflare.R2Bucket.bind(Bucket);
const bucket = yield* Cloudflare.R2.ReadWriteBucket(Bucket);
return {
fetch: Effect.gen(function* () {
const request = yield* HttpServerRequest;
@@ -35,30 +35,45 @@ export default Cloudflare.Worker(
return HttpServerResponse.stream(object!.body);
})
};
}),
}).pipe(Effect.provide(Cloudflare.R2.ReadWriteBucketBinding)),
);
```
One `bind()` wires the binding, env var, and typed connection — at deploy time and at runtime.
One `ReadWriteBucket(Bucket)` call wires the binding, env var, and typed client — at deploy time and at runtime.
---
- **One program, one language.** Resources, Lambdas/Workers, IAM, and SDKs live in the same Effect program — no YAML, no second runtime.
- **Bindings, not glue code.** `S3.GetObject.bind(bucket)` wires the IAM policy, env var, and a typed SDK call in a single line.
- **Bindings, not glue code.** `S3.GetObject(bucket)` wires the IAM policy, env var, and a typed SDK call in a single line.
- **Errors in the type system.** Every cloud API failure is a tagged Effect error you handle — or don't — on purpose.
- **AWS + Cloudflare today.** S3, SQS, DynamoDB, Kinesis, Lambda, EC2 / Workers, R2, D1, Durable Objects, Containers.
- **Same code, every stage.** Local dev, `plan` / `deploy`, smoke tests, and CI all share one mental model.
```sh
bun add alchemy effect
bun add alchemy@next effect@next
```
## GitHub Action
Use the root action to deploy `prod` from `main`, deploy PR previews as
`staging-{number}`, and destroy PR previews when the PR closes:
```yaml
- uses: alchemy-run/alchemy@v1
env:
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
The workflow must install the `alchemy` CLI before this action runs.
## Bootstrap with an AI coding agent
Paste this into Claude Code, Cursor, or any agent that can fetch a URL:
```
You are an Alchemy expert. Read https://v2.alchemy.run/llms.txt to load the
You are an Alchemy expert. Read https://alchemy.run/llms.txt to load the
full documentation index, then act as my pair on this project.
Goal: help me set up, build, test, and deploy a cloud application with
@@ -72,11 +87,11 @@ dependencies or breaking conventions.
## Learn more
- [What is Alchemy?](https://v2.alchemy.run/what-is-alchemy) — the framework in 2 minutes
- [Getting Started](https://v2.alchemy.run/getting-started) — your first Stack
- [Tutorial](https://v2.alchemy.run/tutorial/part-1) — five-part walkthrough to a tested, CI-deployed app
- [What is Alchemy?](https://alchemy.run/what-is-alchemy) — the framework in 2 minutes
- [Getting Started](https://alchemy.run/getting-started) — your first Stack
- [Tutorial](https://alchemy.run/tutorial/part-1) — five-part walkthrough to a tested, CI-deployed app
- [Examples](./examples) — runnable projects on AWS and Cloudflare
- [llms.txt](https://v2.alchemy.run/llms.txt) — agent-ready documentation index
- [llms.txt](https://alchemy.run/llms.txt) — agent-ready documentation index
> **alchemy** is in alpha. Expect breaking changes. Come hang in our [Discord](https://discord.gg/jwKw8dBJdN).
+83
View File
@@ -0,0 +1,83 @@
name: Alchemy
description: Deploy Alchemy stages for pull requests and the main branch, and destroy pull request stages when closed.
author: alchemy-run
branding:
icon: upload-cloud
color: green
inputs:
working-directory:
description: Directory where the Alchemy project should be run.
required: false
default: .
main-branch:
description: Branch that deploys as the persistent prod stage and is never destroyed.
required: false
default: main
outputs:
action:
description: "The lifecycle action that ran: deploy, destroy, or skip."
value: ${{ steps.resolve.outputs.action }}
stage:
description: The Alchemy stage name.
value: ${{ steps.resolve.outputs.stage }}
pull-request:
description: The pull request number for PR stages.
value: ${{ steps.resolve.outputs.pull-request }}
runs:
using: composite
steps:
- id: resolve
shell: bash
env:
MAIN_BRANCH: ${{ inputs.main-branch }}
EVENT_NAME: ${{ github.event_name }}
EVENT_ACTION: ${{ github.event.action }}
REF_NAME: ${{ github.ref_name }}
PR_NUMBER: ${{ github.event.number }}
run: |
if [ "$EVENT_NAME" = "pull_request" ]; then
echo "stage=staging-$PR_NUMBER" >> "$GITHUB_OUTPUT"
echo "pull-request=$PR_NUMBER" >> "$GITHUB_OUTPUT"
if [ "$EVENT_ACTION" = "closed" ]; then
echo "action=destroy" >> "$GITHUB_OUTPUT"
else
echo "action=deploy" >> "$GITHUB_OUTPUT"
fi
exit 0
fi
if [ "$REF_NAME" = "$MAIN_BRANCH" ]; then
echo "stage=prod" >> "$GITHUB_OUTPUT"
echo "pull-request=" >> "$GITHUB_OUTPUT"
echo "action=deploy" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "stage=" >> "$GITHUB_OUTPUT"
echo "pull-request=" >> "$GITHUB_OUTPUT"
echo "action=skip" >> "$GITHUB_OUTPUT"
- if: ${{ steps.resolve.outputs.action == 'deploy' }}
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
STAGE: ${{ steps.resolve.outputs.stage }}
PULL_REQUEST_VALUE: ${{ steps.resolve.outputs.pull-request }}
run: |
if [ -n "$PULL_REQUEST_VALUE" ]; then
export PULL_REQUEST="$PULL_REQUEST_VALUE"
fi
alchemy deploy --stage "$STAGE" --yes
- if: ${{ steps.resolve.outputs.action == 'destroy' }}
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
STAGE: ${{ steps.resolve.outputs.stage }}
PULL_REQUEST_VALUE: ${{ steps.resolve.outputs.pull-request }}
run: |
if [ -n "$PULL_REQUEST_VALUE" ]; then
export PULL_REQUEST="$PULL_REQUEST_VALUE"
fi
alchemy destroy --stage "$STAGE" --yes
@@ -0,0 +1,4 @@
# Per-run raw samples (regenerated every run; keep out of git).
data/
.alchemy/
!contexts/*/*.js
@@ -0,0 +1,74 @@
import * as AWS from "alchemy/AWS";
import * as Alchemy from "alchemy";
import * as Cloudflare from "alchemy/Cloudflare";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import BunMicrovmLive from "./src/bun-image.ts";
import ContainerWorker from "./src/container-worker.ts";
import EffectfulBunLive from "./src/effectful-bun.ts";
import EffectfulContainerLive from "./src/effectful-container.ts";
import EffectfulNodeLive from "./src/effectful-node.ts";
import ExternalMicrovmLive from "./src/external-image.ts";
import MicrovmWorker from "./src/microvm-worker.ts";
import NodeMicrovmLive from "./src/node-image.ts";
import OpencodeMicrovmLive from "./src/opencode-image.ts";
import Orchestrator from "./src/orchestrator.ts";
/**
* MicroVM is a gated AWS Lambda preview. The container benchmark runs against
* Cloudflare alone; set `BENCH_MICROVM=1` (on an onboarded account) to also
* deploy the two MicroVM images and the Lambda + Worker hosts that boot them.
*/
export const benchMicrovm = !!process.env.BENCH_MICROVM;
/**
* Combined cold-start benchmark stack.
*
* - Cloudflare: a {@link ContainerWorker} fronting three container variants
* (effectful bundled-Effect image, bun-baseline Dockerfile, remote pre-built
* image), each behind its own Durable Object.
* - AWS (optional, `BENCH_MICROVM=1`): six MicroVM images (effectful Effect
* bundle on bun + node, raw bun + node baselines, an external Python
* Dockerfile, and an eagerly-started opencode server) booted by both a
* Lambda {@link Orchestrator} and a cross-cloud Cloudflare
* {@link MicrovmWorker}.
*
* Exposes each host's URL so the driver can fire boot/shutdown loads and record
* the time-to-usable-service for every variant.
*/
export default Alchemy.Stack(
"ContainerBenchmark",
{
providers: Layer.mergeAll(AWS.providers(), Cloudflare.providers()),
state: Alchemy.localState(),
},
Effect.gen(function* () {
const containerWorker = yield* ContainerWorker;
if (!benchMicrovm) {
return { containerWorkerUrl: containerWorker.url.as<string>() };
}
const orchestrator = yield* Orchestrator;
const microvmWorker = yield* MicrovmWorker;
return {
containerWorkerUrl: containerWorker.url.as<string>(),
lambdaUrl: orchestrator.functionUrl.as<string>(),
microvmWorkerUrl: microvmWorker.url.as<string>(),
};
}).pipe(
Effect.provide(
benchMicrovm
? Layer.mergeAll(
EffectfulContainerLive,
EffectfulBunLive,
EffectfulNodeLive,
BunMicrovmLive,
NodeMicrovmLive,
ExternalMicrovmLive,
OpencodeMicrovmLive,
)
: EffectfulContainerLive,
),
),
);
@@ -0,0 +1,11 @@
# Same base image as the effectful container (`oven/bun:latest`), but with NO
# Effect program bundled in — just a one-line Bun HTTP server. This isolates
# the Effect-runtime/bundle cost from the base-image pull/boot cost: any
# time-to-usable-service gap between this and the effectful variant is
# attributable to the bundled Effect runtime, not the image.
FROM oven/bun:latest
RUN printf 'Bun.serve({ port: 8080, hostname: "0.0.0.0", fetch: () => new Response("ok") });\n' > /server.ts
EXPOSE 8080
CMD ["bun", "/server.ts"]
@@ -0,0 +1,17 @@
# Bun baseline MicroVM — the dumbest possible Bun HTTP server, built the EXACT
# same way alchemy's effectful image is built (same MicroVM base, same bun
# install via the official installer). The ONLY difference from the effectful
# `EffectfulBun` image is the server code: a raw `Bun.serve({ fetch })` with no
# Effect runtime, no alchemy bootstrap, no RPC protocol. Any time-to-usable
# gap between this and the effectful variant is the alchemy/Effect cold-start
# tax, with runtime (bun) and CPU arch (ARM_64) held constant.
FROM public.ecr.aws/lambda/microvms:al2023-minimal
RUN dnf install -y unzip tar && curl -fsSL https://bun.sh/install | bash && ln -s /root/.bun/bin/bun /usr/local/bin/bun && dnf clean all
WORKDIR /app
COPY server.js .
EXPOSE 8080
ENV PORT=8080
ENTRYPOINT ["bun", "/app/server.js"]
@@ -0,0 +1,19 @@
// Dumbest possible bun HTTP server — the cold-start baseline. Mirrors the
// effectful Sandbox's two routes (`/echo` and a default text response) so the
// in-VM workload is identical; everything that differs in time-to-usable is
// the alchemy/Effect abstraction, not the work the server does.
const port = Number(process.env.PORT ?? 8080);
Bun.serve({
port,
hostname: "0.0.0.0",
fetch(req) {
const url = new URL(req.url);
if (url.pathname === "/echo") {
return Response.json({ message: url.searchParams.get("message") ?? "" });
}
return new Response("hello from bun microvm");
},
});
console.log(`bun microvm baseline listening on :${port}`);
@@ -0,0 +1,15 @@
# Node baseline MicroVM — the dumbest possible node HTTP server, built the EXACT
# same way alchemy's effectful node image is built (`dnf install -y nodejs` on
# the MicroVM base — the runtime the Lambda VMs already ship). The only
# difference from the effectful node `EffectfulNode` image is the server code: a
# raw `http.createServer` with no Effect runtime, no alchemy bootstrap, no RPC.
FROM public.ecr.aws/lambda/microvms:al2023-minimal
RUN dnf install -y nodejs && dnf clean all
WORKDIR /app
COPY server.js .
EXPOSE 8080
ENV PORT=8080
ENTRYPOINT ["node", "/app/server.js"]
@@ -0,0 +1,22 @@
// Dumbest possible node HTTP server — the node cold-start baseline. Mirrors the
// effectful Sandbox's two routes (`/echo` and a default text response) so the
// in-VM workload is identical; everything that differs in time-to-usable is the
// alchemy/Effect abstraction, not the work the server does.
const http = require("node:http");
const port = Number(process.env.PORT ?? 8080);
http
.createServer((req, res) => {
const url = new URL(req.url, "http://microvm");
if (url.pathname === "/echo") {
res.writeHead(200, { "content-type": "application/json" });
res.end(JSON.stringify({ message: url.searchParams.get("message") ?? "" }));
return;
}
res.writeHead(200, { "content-type": "text/plain" });
res.end("hello from node microvm");
})
.listen(port, "0.0.0.0", () => {
console.log(`node microvm baseline listening on :${port}`);
});
@@ -0,0 +1,19 @@
# opencode (a real coding-agent server, ~100MB binary on a Bun runtime) started
# EAGERLY as the entrypoint. The MicroVM image build runs this entrypoint,
# waits for it to initialize, and snapshots the running memory+disk — so every
# `RunMicrovm` resumes with the opencode server already listening instead of
# paying its process startup on each boot.
FROM public.ecr.aws/lambda/microvms:al2023-minimal
RUN dnf install -y unzip tar gzip git && dnf clean all
RUN curl -fsSL https://opencode.ai/install | bash \
&& ln -s /root/.opencode/bin/opencode /usr/local/bin/opencode
WORKDIR /workspace
# The server binds 0.0.0.0, so require basic auth (username defaults to
# `opencode`). The benchmark's readiness probe presents these credentials.
ENV OPENCODE_SERVER_PASSWORD=bench
EXPOSE 8080
ENTRYPOINT ["opencode", "serve", "--hostname", "0.0.0.0", "--port", "8080"]
@@ -0,0 +1,9 @@
FROM public.ecr.aws/lambda/microvms:al2023-minimal
RUN dnf install -y python3 && dnf clean all
WORKDIR /app
COPY app.py .
EXPOSE 8080
CMD ["python3", "app.py"]
@@ -0,0 +1,16 @@
from http.server import BaseHTTPRequestHandler, HTTPServer
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-Type", "text/plain")
self.end_headers()
self.wfile.write(b"hello from external microvm")
def log_message(self, *args):
pass
if __name__ == "__main__":
HTTPServer(("0.0.0.0", 8080), Handler).serve_forever()
@@ -0,0 +1,21 @@
# The Cloudflare-container twin of `../microvm-opencode/Dockerfile`: the same
# opencode server started eagerly as the entrypoint. Cloudflare containers boot
# the image from scratch on each cold start (no memory snapshot), so this
# variant pays opencode's process startup inside every boot — the comparison
# the MicroVM snapshot variant is designed to isolate.
#
# Cloudflare builds containers for linux/amd64 and the AWS MicroVM base image
# is ARM64-only, so use plain Amazon Linux 2023 (same OS family, multi-arch).
# The base OS barely matters — opencode ships its own runtime.
FROM amazonlinux:2023
RUN dnf install -y unzip tar gzip git && dnf clean all
RUN curl -fsSL https://opencode.ai/install | bash \
&& ln -s /root/.opencode/bin/opencode /usr/local/bin/opencode
WORKDIR /workspace
ENV OPENCODE_SERVER_PASSWORD=bench
EXPOSE 8080
ENTRYPOINT ["opencode", "serve", "--hostname", "0.0.0.0", "--port", "8080"]
@@ -0,0 +1,31 @@
{
"name": "@alchemy.run/benchmark-container",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/alchemy-run/alchemy.git",
"directory": "benchmark/container"
},
"type": "module",
"scripts": {
"deploy": "alchemy deploy",
"destroy": "alchemy destroy",
"logs": "alchemy logs",
"tail": "alchemy tail",
"bench": "bun test test/bench.test.ts"
},
"dependencies": {
"@distilled.cloud/aws": "workspace:*",
"@effect/platform-bun": "catalog:",
"@effect/platform-node": "catalog:",
"alchemy": "workspace:*",
"effect": "catalog:"
},
"devDependencies": {
"@cloudflare/containers": "catalog:",
"@cloudflare/workers-types": "catalog:",
"@types/bun": "catalog:"
}
}
@@ -0,0 +1,26 @@
# Cold-start benchmark
Run `2026-07-02T01-28-09-381Z` — 700 samples. Metric: **time to usable service** (host start → first successful request).
Methodology: targets run sequentially so they never contend for shared quotas. Containers are measured under concurrent load (10 rounds × 10 simultaneous boots). MicroVMs are measured **independently** — 25 serial boots at concurrency 1 — because the Lambda MicroVM API is throttled per account/Region (RunMicrovm 5 TPS/burst 5, TerminateMicrovm 10 TPS), so concurrent boots would measure API admission rather than VM cold start. Each boot launches, waits until the service is usable, then terminates before the next; the image is pre-warmed once (untimed) so we measure cold start, not first-pull distribution.
| environment | variant | ok | ready p50 | ready p95 | ready mean | ready max | first → last round (mean) |
| --- | --- | --- | --- | --- | --- | --- | --- |
| container | effectful | 100/100 | 2.3s | 24.0s | 4.7s | 46.7s | 15.3s → 2.1s |
| container | bun | 100/100 | 1.7s | 23.9s | 3.9s | 47.3s | 17.4s → 1.7s |
| container | remote | 100/100 | 2.6s | 24.4s | 4.5s | 26.1s | 11.5s → 2.4s |
| container | opencode | 100/100 | 10.5s | 15.6s | 12.0s | 58.6s | 25.4s → 10.6s |
| lambda→microvm | effectful-bun | 25/25 | 2.9s | 4.4s | 2.8s | 4.8s | 4.8s → 2.0s |
| lambda→microvm | effectful-node | 25/25 | 3.2s | 3.7s | 3.6s | 16.6s | 3.4s → 2.5s |
| lambda→microvm | bun | 25/25 | 2.7s | 3.2s | 2.7s | 3.7s | 3.2s → 2.3s |
| lambda→microvm | node | 25/25 | 3.3s | 3.8s | 3.2s | 4.2s | 3.5s → 3.3s |
| lambda→microvm | external | 25/25 | 2.2s | 2.8s | 2.2s | 2.8s | 2.4s → 2.2s |
| lambda→microvm | opencode | 25/25 | 3.4s | 4.1s | 3.4s | 4.5s | 3.8s → 4.1s |
| worker→microvm | effectful-bun | 25/25 | 2.7s | 3.7s | 2.8s | 4.1s | 3.7s → 3.2s |
| worker→microvm | effectful-node | 25/25 | 3.6s | 9.4s | 4.0s | 9.6s | 6.0s → 2.8s |
| worker→microvm | bun | 25/25 | 3.1s | 3.8s | 2.9s | 5.4s | 3.8s → 3.2s |
| worker→microvm | node | 25/25 | 3.2s | 4.3s | 3.4s | 6.9s | 3.2s → 3.0s |
| worker→microvm | external | 25/25 | 2.4s | 2.9s | 2.3s | 3.0s | 3.0s → 2.9s |
| worker→microvm | opencode | 24/25 | 3.6s | 4.0s | 3.5s | 4.2s | 1.9s → 3.1s |
Raw per-boot samples: `data/samples-2026-07-02T01-28-09-381Z.csv`. Aggregates: `report/summary.csv`.
@@ -0,0 +1,17 @@
env,variant,ok,total,ready_min_ms,ready_p50_ms,ready_p95_ms,ready_mean_ms,ready_max_ms,round_means_ms
container,effectful,100,100,993,2321,23999,4743,46726,15258;10798;2069;2153;2442;2002;4540;3020;3050;2095
container,bun,100,100,608,1710,23903,3905,47294,17436;6231;1747;3987;1372;2107;1586;1564;1370;1651
container,remote,100,100,1127,2565,24405,4484,26064,11452;9197;2396;2759;2423;6993;2335;2192;2669;2428
container,opencode,100,100,4363,10492,15614,12043,58621,25400;10537;9987;9869;10632;11032;11265;11090;10013;10611
lambda→microvm,effectful-bun,25,25,1550,2860,4417,2790,4792,4792;3584;2516;1854;2860;3087;2888;2784;1550;2866;4417;3019;2323;2896;2167;2883;2582;2914;3394;2430;2529;2105;2976;2284;2040
lambda→microvm,effectful-node,25,25,2098,3190,3701,3647,16627,3413;3221;3482;3218;3459;3287;3190;16627;3427;2098;3110;3201;3056;3084;2462;3701;3115;3158;3165;3261;3112;2517;3245;3123;2455
lambda→microvm,bun,25,25,1705,2747,3160,2680,3721,3160;2689;2770;3091;3721;1705;2273;2799;2742;2152;2747;2872;2705;3039;3008;2226;2873;2706;2060;2757;2733;2061;2785;3039;2293
lambda→microvm,node,25,25,1970,3329,3816,3205,4193,3516;3192;3342;3573;3383;3438;2709;3329;3816;3578;4193;3196;1970;3372;3557;3243;2263;3235;3395;3476;2458;3093;2909;2575;3303
lambda→microvm,external,25,25,1495,2193,2759,2167,2786,2416;2274;2137;2187;2262;1578;2242;1495;2244;2160;1588;1955;2193;2183;1581;2145;2717;2215;2193;2220;2315;2786;2132;2759;2189
lambda→microvm,opencode,25,25,1901,3409,4107,3350,4506,3829;3406;4506;3501;3409;3612;2943;2636;3518;3797;3427;3209;3811;3367;2674;2558;3299;3188;1901;3494;2648;3232;3851;3830;4107
worker→microvm,effectful-bun,25,25,1951,2686,3653,2797,4137,3653;3031;1951;3251;3526;4137;2429;2986;2922;2686;2977;2245;2487;2359;2412;2743;2935;2638;2619;2405;2762;2652;2489;2425;3207
worker→microvm,effectful-node,25,25,2346,3561,9393,4003,9617,6029;4248;2802;3788;3409;3636;3774;4250;2789;9617;3663;3150;2346;3561;3587;2740;3494;3228;3698;3334;3423;9393;3809;3519;2800
worker→microvm,bun,25,25,1779,3053,3797,2932,5405,3797;1928;5405;3315;3053;3311;2370;3177;3432;3039;3401;2447;3298;3263;2499;1984;2146;2192;2505;3012;3073;2566;3122;1779;3174
worker→microvm,node,25,25,2611,3247,4328,3410,6890,3175;2884;3556;3271;2616;3906;2725;4328;2829;4212;3351;3176;3525;3281;3533;2611;3789;3446;2726;3001;6890;2972;3247;3161;3029
worker→microvm,external,25,25,1760,2404,2925,2292,2977,2977;2497;2424;1760;2404;1868;2630;2020;1982;2420;2650;2043;2324;2441;1855;2469;1913;2478;1942;2425;2280;1877;2268;2424;2925
worker→microvm,opencode,24,25,1903,3606,4027,3513,4188,1903;3796;3705;;3381;3439;3786;3393;2603;3606;3730;3338;3800;3567;4188;3298;4027;3985;3502;3449;3796;3717;3731;3502;3074
1 env variant ok total ready_min_ms ready_p50_ms ready_p95_ms ready_mean_ms ready_max_ms round_means_ms
2 container effectful 100 100 993 2321 23999 4743 46726 15258;10798;2069;2153;2442;2002;4540;3020;3050;2095
3 container bun 100 100 608 1710 23903 3905 47294 17436;6231;1747;3987;1372;2107;1586;1564;1370;1651
4 container remote 100 100 1127 2565 24405 4484 26064 11452;9197;2396;2759;2423;6993;2335;2192;2669;2428
5 container opencode 100 100 4363 10492 15614 12043 58621 25400;10537;9987;9869;10632;11032;11265;11090;10013;10611
6 lambda→microvm effectful-bun 25 25 1550 2860 4417 2790 4792 4792;3584;2516;1854;2860;3087;2888;2784;1550;2866;4417;3019;2323;2896;2167;2883;2582;2914;3394;2430;2529;2105;2976;2284;2040
7 lambda→microvm effectful-node 25 25 2098 3190 3701 3647 16627 3413;3221;3482;3218;3459;3287;3190;16627;3427;2098;3110;3201;3056;3084;2462;3701;3115;3158;3165;3261;3112;2517;3245;3123;2455
8 lambda→microvm bun 25 25 1705 2747 3160 2680 3721 3160;2689;2770;3091;3721;1705;2273;2799;2742;2152;2747;2872;2705;3039;3008;2226;2873;2706;2060;2757;2733;2061;2785;3039;2293
9 lambda→microvm node 25 25 1970 3329 3816 3205 4193 3516;3192;3342;3573;3383;3438;2709;3329;3816;3578;4193;3196;1970;3372;3557;3243;2263;3235;3395;3476;2458;3093;2909;2575;3303
10 lambda→microvm external 25 25 1495 2193 2759 2167 2786 2416;2274;2137;2187;2262;1578;2242;1495;2244;2160;1588;1955;2193;2183;1581;2145;2717;2215;2193;2220;2315;2786;2132;2759;2189
11 lambda→microvm opencode 25 25 1901 3409 4107 3350 4506 3829;3406;4506;3501;3409;3612;2943;2636;3518;3797;3427;3209;3811;3367;2674;2558;3299;3188;1901;3494;2648;3232;3851;3830;4107
12 worker→microvm effectful-bun 25 25 1951 2686 3653 2797 4137 3653;3031;1951;3251;3526;4137;2429;2986;2922;2686;2977;2245;2487;2359;2412;2743;2935;2638;2619;2405;2762;2652;2489;2425;3207
13 worker→microvm effectful-node 25 25 2346 3561 9393 4003 9617 6029;4248;2802;3788;3409;3636;3774;4250;2789;9617;3663;3150;2346;3561;3587;2740;3494;3228;3698;3334;3423;9393;3809;3519;2800
14 worker→microvm bun 25 25 1779 3053 3797 2932 5405 3797;1928;5405;3315;3053;3311;2370;3177;3432;3039;3401;2447;3298;3263;2499;1984;2146;2192;2505;3012;3073;2566;3122;1779;3174
15 worker→microvm node 25 25 2611 3247 4328 3410 6890 3175;2884;3556;3271;2616;3906;2725;4328;2829;4212;3351;3176;3525;3281;3533;2611;3789;3446;2726;3001;6890;2972;3247;3161;3029
16 worker→microvm external 25 25 1760 2404 2925 2292 2977 2977;2497;2424;1760;2404;1868;2630;2020;1982;2420;2650;2043;2324;2441;1855;2469;1913;2478;1942;2425;2280;1877;2268;2424;2925
17 worker→microvm opencode 24 25 1903 3606 4027 3513 4188 1903;3796;3705;;3381;3439;3786;3393;2603;3606;3730;3338;3800;3567;4188;3298;4027;3985;3502;3449;3796;3717;3731;3502;3074
@@ -0,0 +1,168 @@
# Generates the blog plots for the MicroVM vs Container cold-start post from a
# benchmark samples CSV (see test/bench.test.ts). Usage:
# uv run --with matplotlib --with scipy scripts/plot-blog.py data/samples-<run>.csv <outdir>
import csv
import sys
from collections import defaultdict
import matplotlib
import numpy as np
from scipy.stats import gaussian_kde
matplotlib.use("Agg")
import matplotlib.pyplot as plt
samples_csv, outdir = sys.argv[1], sys.argv[2]
rows = []
with open(samples_csv) as f:
for r in csv.DictReader(f):
if r["ok"] == "true" and r["readyMs"]:
rows.append((r["env"], r["variant"], int(r["readyMs"]) / 1000.0))
by_key = defaultdict(list)
for env, variant, s in rows:
by_key[(env, variant)].append(s)
# Colors readable on both light and dark backgrounds.
FG = "#8b8b94"
CF = "#f6821f" # Cloudflare orange
CF2 = "#fbb673"
VM = "#4f8ff7" # MicroVM blue
VM2 = "#8fb8fa"
VM3 = "#2fbf9b"
plt.rcParams.update(
{
"figure.facecolor": "none",
"axes.facecolor": "none",
"savefig.facecolor": "none",
"text.color": FG,
"axes.edgecolor": FG,
"axes.labelcolor": FG,
"xtick.color": FG,
"ytick.color": FG,
"grid.color": FG,
"grid.alpha": 0.15,
"font.size": 12,
"font.family": "sans-serif",
}
)
def style(ax):
ax.spines["top"].set_visible(False)
ax.spines["right"].set_visible(False)
ax.grid(True, axis="x", linewidth=0.6)
ax.set_axisbelow(True)
# ---------------------------------------------------------------- strip plot
series = [
("Cloudflare container — Effect image", ("container", "effectful"), CF),
("Cloudflare container — plain Bun image", ("container", "bun"), CF2),
("AWS MicroVM — Effect image (Bun)", ("lambda\u2192microvm", "effectful-bun"), VM),
("AWS MicroVM — plain Bun image", ("lambda\u2192microvm", "bun"), VM2),
("AWS MicroVM — from a Cloudflare Worker", ("worker\u2192microvm", "effectful-bun"), VM3),
]
import random
def strip_plot(rows, fname, xmax=None, logx=False):
fig, ax = plt.subplots(figsize=(9.5, 0.75 + 0.78 * len(rows)))
random.seed(7)
for i, (label, key, color) in enumerate(reversed(rows)):
xs = by_key[key]
ys = [i + random.uniform(-0.16, 0.16) for _ in xs]
ax.scatter(xs, ys, s=26, color=color, alpha=0.75, linewidths=0)
ax.set_yticks(range(len(rows)))
ax.set_yticklabels([label for label, _, _ in reversed(rows)])
ax.set_xlabel("time to usable service (seconds) — every boot in the run")
if logx:
ax.set_xscale("log")
ax.set_xticks([1, 2, 3, 5, 10, 20, 40, 60])
ax.set_xticklabels(["1s", "2s", "3s", "5s", "10s", "20s", "40s", "60s"])
elif xmax:
ax.set_xlim(0, xmax)
style(ax)
fig.tight_layout()
fig.savefig(f"{outdir}/{fname}", dpi=200)
plt.close(fig)
all_max = max(max(by_key[k]) for _, k, _ in series)
strip_plot(series, "every-boot.png", xmax=all_max * 1.04)
# ------------------------------------------------------- opencode strip plot
# Solid hues = opencode, lighter tints of the same hue = hello world.
VM_L = "#8fb8fa"
VM3_L = "#93e2cc"
oc_series = [
("Cloudflare container — opencode (via Worker)", ("container", "opencode"), CF),
("AWS MicroVM — opencode (via Lambda)", ("lambda\u2192microvm", "opencode"), VM),
("AWS MicroVM — opencode (via Worker)", ("worker\u2192microvm", "opencode"), VM3),
("Cloudflare container — hello world (via Worker)", ("container", "bun"), CF2),
("AWS MicroVM — hello world (via Lambda)", ("lambda\u2192microvm", "bun"), VM_L),
("AWS MicroVM — hello world (via Worker)", ("worker\u2192microvm", "bun"), VM3_L),
]
strip_plot(oc_series, "opencode.png", logx=True)
# --------------------------------------------------- opencode density (KDE)
# Density in log-space: the MicroVM variants show as tall narrow spikes
# (consistency), the container as a wide hump at ~10s. NB: the container's
# 20-60s tail is nearly invisible at this scale — the strip plot and the
# table's max column carry that part of the story.
fig, ax = plt.subplots(figsize=(9.5, 4.8))
grid = np.logspace(np.log10(0.3), np.log10(70), 500)
for label, key, color in oc_series:
xs = np.log10(np.array(by_key[key]))
density = gaussian_kde(xs, bw_method=0.25)(np.log10(grid))
ax.plot(grid, density, color=color, linewidth=2.2, label=label)
ax.fill_between(grid, density, color=color, alpha=0.15)
ax.set_xscale("log")
ax.set_xticks([1, 2, 3, 5, 10, 20, 40, 60])
ax.set_xticklabels(["1s", "2s", "3s", "5s", "10s", "20s", "40s", "60s"])
ax.set_xlabel("time to usable service (seconds)")
ax.set_ylabel("density")
ax.legend(frameon=False, fontsize=10.5)
ax.spines["top"].set_visible(False)
ax.spines["right"].set_visible(False)
ax.grid(True, linewidth=0.6)
ax.set_axisbelow(True)
fig.tight_layout()
fig.savefig(f"{outdir}/opencode-density.png", dpi=200)
plt.close(fig)
# ----------------------------------------------------------------------- CDF
fig, ax = plt.subplots(figsize=(9.5, 4.8))
for label, key, color in series:
xs = sorted(by_key[key])
ys = [(i + 1) / len(xs) * 100 for i in range(len(xs))]
ax.plot(xs, ys, color=color, linewidth=2.2, label=label)
ax.set_xlabel("time to usable service (seconds)")
ax.set_ylabel("% of boots at or below")
ax.set_xscale("log")
ax.set_xticks([1, 2, 3, 5, 10, 20])
ax.set_xticklabels(["1s", "2s", "3s", "5s", "10s", "20s"])
ax.set_ylim(0, 102)
ax.legend(frameon=False, loc="lower right", fontsize=10.5)
ax.spines["top"].set_visible(False)
ax.spines["right"].set_visible(False)
ax.grid(True, linewidth=0.6)
ax.set_axisbelow(True)
fig.tight_layout()
fig.savefig(f"{outdir}/cdf.png", dpi=200)
plt.close(fig)
def pct(xs, p):
xs = sorted(xs)
return xs[min(len(xs) - 1, int(p / 100 * len(xs)))]
for label, key, _ in series + oc_series:
xs = by_key[key]
print(
f"{label:45s} n={len(xs):3d} p50={pct(xs,50):.1f}s p95={pct(xs,95):.1f}s max={max(xs):.1f}s"
)
@@ -0,0 +1,8 @@
import * as AWS from "alchemy/AWS";
/**
* Build role shared by every MicroVM image (effectful bun/node, bun/node
* baselines, external Python). Kept in its own module so the effectful image
* entrypoints can import it without pulling each other's server bundle in.
*/
export const MicrovmBuildRole = AWS.IAM.Role("MicrovmBuildRole");
@@ -0,0 +1,18 @@
import * as Cloudflare from "alchemy/Cloudflare";
/**
* Non-Effect container built from a Dockerfile whose base image is the *same*
* `oven/bun:latest` the effectful variant uses — but with no Effect program
* bundled, just a raw `Bun.serve`. Comparing this against the effectful variant
* rules out base-image pull/boot time as the cause of any gap: the remaining
* difference is the bundled Effect runtime.
*/
export class BunContainer extends Cloudflare.Container<BunContainer>()(
"BenchBunContainer",
{
context: `${import.meta.dirname}/../contexts/bun`,
maxInstances: 100,
instanceType: "lite",
instances: 0,
},
) {}
@@ -0,0 +1,33 @@
import * as AWS from "alchemy/AWS";
import * as Effect from "effect/Effect";
import { MicrovmBuildRole } from "./build-role.ts";
/**
* Bun baseline MicroVM image — the dumbest possible `Bun.serve` HTTP server,
* built from `contexts/microvm-bun/` the same way alchemy builds the effectful
* {@link import("./effectful-bun.ts").EffectfulBun} image (same MicroVM base, same bun install, same ARM_64 arch,
* same 512 MiB). The only difference is the absence of the Effect runtime and
* the alchemy bootstrap, so `effectful.readyMs − bun.readyMs` isolates the
* cold-start cost of alchemy's Effect abstraction with the runtime and CPU
* architecture held constant.
*/
export class BunMicrovm extends AWS.Lambda.MicrovmImage<BunMicrovm>()(
"MicrovmBenchBun",
) {}
export default BunMicrovm.make(
MicrovmBuildRole.pipe(
Effect.map((buildRole) => ({
// External (Dockerfile) mode: the runtime is NOT chosen by alchemy's
// `runtime` prop (that only applies to effectful `main:` images). It is
// decided entirely by this context's Dockerfile, which installs and runs
// bun. Match the effectful EffectfulBun's image config: ARM_64, 512 MiB.
context: new URL("../contexts/microvm-bun/", import.meta.url).pathname,
buildRole,
resources: [{ minimumMemoryInMiB: 512 }],
cpuConfigurations: [{ architecture: "ARM_64" }],
})),
),
// External (Dockerfile) mode — no Effect runtime to bundle.
Effect.succeed({}),
);
@@ -0,0 +1,46 @@
import * as Cloudflare from "alchemy/Cloudflare";
import * as Effect from "effect/Effect";
import * as Schedule from "effect/Schedule";
import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest";
import { BunContainer } from "./bun-container.ts";
/**
* Durable Object backing one bun-baseline container instance. `boot()` blocks
* until the `Bun.serve` HTTP server answers on its TCP port. NOTE: the
* authoritative cold-start clock runs in the Worker AROUND the whole DO call —
* the container layer eagerly starts the container during DO construction, so
* a clock started here would miss part of the start.
*/
export class BunObject extends Cloudflare.DurableObject<BunObject>()(
"BenchBunObject",
Effect.gen(function* () {
const container = yield* BunContainer;
return Effect.gen(function* () {
const { fetch } = yield* container.getTcpPort(8080);
return {
boot: () =>
Effect.gen(function* () {
const start = yield* Effect.sync(() => Date.now());
yield* fetch(HttpClientRequest.get("http://container/")).pipe(
Effect.flatMap((r) => r.text),
Effect.retry({
schedule: Schedule.min([Schedule.exponential("1 second"), Schedule.spaced("5 seconds")]),
times: 40,
}),
);
const readyMs = (yield* Effect.sync(() => Date.now())) - start;
return { readyMs };
}),
shutdown: () => container.destroy().pipe(Effect.ignore),
};
});
}).pipe(
Effect.provide(
Cloudflare.Containers.layer(BunContainer, {
enableInternet: true,
}),
),
),
) {}
@@ -0,0 +1,75 @@
import * as Cloudflare from "alchemy/Cloudflare";
import * as Effect from "effect/Effect";
import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest";
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
import { BunObject } from "./bun-object.ts";
import { EffectfulObject } from "./effectful-object.ts";
import { OpencodeObject } from "./opencode-object.ts";
import { RemoteObject } from "./remote-object.ts";
/**
* Cloudflare Worker host for the container cold-start benchmark. Each request
* names a fresh DO instance (`?name=`), which boots its own container.
*
* - `GET /boot?variant=effectful|bun|remote|opencode&name=K` boots one
* container and returns `{ readyMs }`. It does NOT shut down.
* - `GET /shutdown?variant=…&name=K` tears the container down so the next boot
* is an independent cold start and the account's container cap isn't exhausted.
*
* TIMING: the clock runs HERE in the Worker, around the entire DO call — not
* inside the DO. The container layer eagerly calls `container.start()` during
* DO construction, so a clock started inside `boot()` would miss instance
* allocation and start entirely, undercounting the cold start. Wrapping the
* `getByName(name).boot()` call captures DO creation + container start +
* readiness probe, while staying inside Cloudflare (no client network in the
* number) — symmetric with the MicroVM hosts, which start the clock before
* `RunMicrovm`.
*/
export default class ContainerWorker extends Cloudflare.Worker<ContainerWorker>()(
"BenchContainerWorker",
{
main: import.meta.filename,
},
Effect.gen(function* () {
const effectful = yield* EffectfulObject;
const remote = yield* RemoteObject;
const bun = yield* BunObject;
const opencode = yield* OpencodeObject;
const objectFor = (variant: string) =>
variant === "remote"
? remote
: variant === "bun"
? bun
: variant === "opencode"
? opencode
: effectful;
return {
fetch: Effect.gen(function* () {
const request = yield* HttpServerRequest;
const url = new URL(request.url, "http://x");
const name = url.searchParams.get("name") ?? "default";
const variant = url.searchParams.get("variant") ?? "effectful";
if (url.pathname === "/boot") {
// Time the WHOLE thing: DO creation, eager container start during
// layer construction, and the readiness probe inside boot().
const start = yield* Effect.sync(() => Date.now());
yield* objectFor(variant).getByName(name).boot();
const readyMs = (yield* Effect.sync(() => Date.now())) - start;
return yield* HttpServerResponse.json({ readyMs });
}
if (url.pathname === "/shutdown") {
yield* objectFor(variant).getByName(name).shutdown();
return yield* HttpServerResponse.json({ ok: true });
}
return HttpServerResponse.text("ok");
}).pipe(
Effect.catch((err) =>
Effect.succeed(HttpServerResponse.text(String(err), { status: 500 })),
),
),
};
}),
) {}
@@ -0,0 +1,31 @@
import * as AWS from "alchemy/AWS";
import * as Effect from "effect/Effect";
import { MicrovmBuildRole } from "./build-role.ts";
import { effectfulImpl } from "./effectful-impl.ts";
/**
* Effectful MicroVM image on **bun** — a bundled Effect program exposing a raw
* `fetch` handler and a typed RPC `hello` method. Pairs with the bun baseline
* ({@link import("./bun-image.ts")}): same runtime + ARM_64 arch, the only
* difference being the bundled Effect runtime / alchemy bootstrap. Compare to
* {@link import("./effectful-node.ts").EffectfulNode} for the node-vs-bun delta.
*/
export class EffectfulBun extends AWS.Lambda.MicrovmImage<
EffectfulBun,
{
hello: (message: string) => Effect.Effect<string>;
}
>()("MicrovmEffectfulBun") {}
export default EffectfulBun.make(
MicrovmBuildRole.pipe(
Effect.map((buildRole) => ({
main: import.meta.filename,
buildRole,
runtime: "bun" as const,
resources: [{ minimumMemoryInMiB: 512 }],
cpuConfigurations: [{ architecture: "ARM_64" }],
})),
),
effectfulImpl,
);
@@ -0,0 +1,35 @@
import * as Cloudflare from "alchemy/Cloudflare";
import * as Effect from "effect/Effect";
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
/**
* Minimal Effect-native container for the cold-start benchmark. Alchemy bundles
* this file's Effect program into a generated image; the DO proxies a trivial
* `ping()` RPC into it, which is enough to prove the container is up and
* accepting connections on its RPC port.
*/
export class EffectfulContainer extends Cloudflare.Container<
EffectfulContainer,
{
ping: () => Effect.Effect<string>;
}
>()("BenchEffectfulContainer") {}
export default EffectfulContainer.make(
{
main: import.meta.filename,
image: "oven/bun:latest",
// Match wrangler's container config so the comparison isolates the
// framework, not the tier: max_instances 100 (Alchemy defaults to 1),
// instance_type "lite", and instances 0 (pure scale-from-zero).
maxInstances: 100,
instanceType: "lite",
instances: 0,
},
Effect.gen(function* () {
return {
ping: () => Effect.succeed("pong"),
fetch: Effect.succeed(HttpServerResponse.text("ok")),
};
}),
);
@@ -0,0 +1,24 @@
import * as Effect from "effect/Effect";
import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest";
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
/**
* The effectful MicroVM server, shared verbatim by the bun and node effectful
* images so the only thing that differs between them is the JS runtime. Exposes
* a raw `fetch` handler (with an `/echo` route) and a typed RPC `hello` method.
*/
export const effectfulImpl = Effect.gen(function* () {
return {
fetch: Effect.gen(function* () {
const request = yield* HttpServerRequest;
const url = new URL(request.url, "http://microvm");
if (url.pathname === "/echo") {
return yield* HttpServerResponse.json({
message: url.searchParams.get("message") ?? "",
});
}
return HttpServerResponse.text("hello from effectful microvm");
}),
hello: (message: string) => Effect.succeed(`hello, ${message}!`),
};
});
@@ -0,0 +1,31 @@
import * as AWS from "alchemy/AWS";
import * as Effect from "effect/Effect";
import { MicrovmBuildRole } from "./build-role.ts";
import { effectfulImpl } from "./effectful-impl.ts";
/**
* Effectful MicroVM image on **node** — identical server to the bun effectful
* {@link import("./effectful-bun.ts").EffectfulBun}, but bundled for the node
* runtime (`dnf install -y nodejs`, no bun install). Since the Lambda MicroVM
* base ships node, this avoids the bun installer step entirely; comparing it to
* the bun effectful isolates the runtime's contribution to cold start.
*/
export class EffectfulNode extends AWS.Lambda.MicrovmImage<
EffectfulNode,
{
hello: (message: string) => Effect.Effect<string>;
}
>()("MicrovmEffectfulNode") {}
export default EffectfulNode.make(
MicrovmBuildRole.pipe(
Effect.map((buildRole) => ({
main: import.meta.filename,
buildRole,
runtime: "node" as const,
resources: [{ minimumMemoryInMiB: 512 }],
cpuConfigurations: [{ architecture: "ARM_64" }],
})),
),
effectfulImpl,
);
@@ -0,0 +1,50 @@
import * as Cloudflare from "alchemy/Cloudflare";
import * as Effect from "effect/Effect";
import * as Schedule from "effect/Schedule";
import { EffectfulContainer } from "./effectful-container.ts";
/**
* Durable Object backing one effectful container instance. `boot()` blocks
* until the container is accepting RPC (`ping()` answers). NOTE: the
* authoritative cold-start clock runs in the Worker AROUND the whole DO call —
* the container layer eagerly starts the container during DO construction, so
* a clock started here would miss part of the start.
*
* Each distinct `getByName(name)` is a distinct DO instance and therefore a
* distinct container instance, which is how the benchmark spins up N of them.
*/
export class EffectfulObject extends Cloudflare.DurableObject<EffectfulObject>()(
"BenchEffectfulObject",
Effect.gen(function* () {
const container = yield* EffectfulContainer;
return Effect.gen(function* () {
return {
// Time container cold-start → reachable (RPC answers). Leaves the
// container running so the benchmark can `shutdown()` it separately —
// the timing must not include teardown. A freshly-built image is still
// distributing to the edge metal on the first boots, so retry until the
// RPC port answers.
boot: () =>
Effect.gen(function* () {
const start = yield* Effect.sync(() => Date.now());
yield* container.ping().pipe(
Effect.retry({
schedule: Schedule.min([Schedule.exponential("1 second"), Schedule.spaced("5 seconds")]),
times: 40,
}),
);
const readyMs = (yield* Effect.sync(() => Date.now())) - start;
return { readyMs };
}),
shutdown: () => container.destroy().pipe(Effect.ignore),
};
});
}).pipe(
Effect.provide(
Cloudflare.Containers.layer(EffectfulContainer, {
enableInternet: true,
}),
),
),
) {}
@@ -0,0 +1,29 @@
import * as AWS from "alchemy/AWS";
import * as Effect from "effect/Effect";
import { MicrovmBuildRole } from "./build-role.ts";
/**
* Non-Effect ("external") MicroVM image — built server-side from a plain
* Dockerfile (a tiny Python HTTP server on :8080). No Effect program is
* bundled and no in-VM runtime is injected; it is the AWS analog of the
* Cloudflare `bun`/`remote` container variants.
*/
export class ExternalMicrovm extends AWS.Lambda.MicrovmImage<ExternalMicrovm>()(
"MicrovmBenchExternal",
) {}
export default ExternalMicrovm.make(
MicrovmBuildRole.pipe(
Effect.map((buildRole) => ({
context: new URL("../contexts/microvm-python/", import.meta.url).pathname,
buildRole,
// Pin memory to match the effectful image so both fit the per-account
// MicroVM memory quota at the benchmark's concurrency. Keep the default
// x86_64 arch — forcing ARM_64 breaks the Python image build.
resources: [{ minimumMemoryInMiB: 512 }],
})),
),
// External mode builds from the Dockerfile; there is no Effect runtime to
// bundle, so the impl shape is empty.
Effect.succeed({}),
);
@@ -0,0 +1,247 @@
import * as AWS from "alchemy/AWS";
import * as Cloudflare from "alchemy/Cloudflare";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import type * as Redacted from "effect/Redacted";
import * as Schedule from "effect/Schedule";
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
import * as HttpBody from "effect/unstable/http/HttpBody";
import * as HttpClient from "effect/unstable/http/HttpClient";
import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest";
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
import { BunMicrovm } from "./bun-image.ts";
import { ExternalMicrovm } from "./external-image.ts";
import { EffectfulBun } from "./effectful-bun.ts";
import { EffectfulNode } from "./effectful-node.ts";
import { NodeMicrovm } from "./node-image.ts";
import { OpencodeMicrovm } from "./opencode-image.ts";
/**
* Cloudflare Worker host for the MicroVM cold-start benchmark — the cross-cloud
* analog of the Lambda {@link import("./orchestrator.ts")}. Same boot/shutdown
* lifecycle and `readyMs` (time to usable service), but driven from a Worker:
* binding the AWS MicroVM ops provisions an IAM User + AccessKey + assume-role
* Role once per worker (see `MicrovmBinding.ts`), measuring the Worker → MicroVM
* cold-start path.
*/
type Variant = {
readonly run: (
req: AWS.Lambda.RunMicrovmRequest,
) => Effect.Effect<{ microvmId: string; endpoint: string }, any>;
readonly get: (req: {
microvmIdentifier: string;
}) => Effect.Effect<{ state: string }, any>;
readonly auth: (req: {
microvmIdentifier: string;
expirationInMinutes: number;
allowedPorts: { port: number }[];
}) => Effect.Effect<
{
authToken: Record<string, string | Redacted.Redacted<string> | undefined>;
},
any
>;
readonly term: (req: {
microvmIdentifier: string;
}) => Effect.Effect<unknown, any>;
readonly reachable: (
endpoint: string,
authToken: Record<string, string | Redacted.Redacted<string> | undefined>,
) => Effect.Effect<unknown, any, any>;
};
export default Cloudflare.Worker(
"MicrovmBenchWorker",
{ main: import.meta.filename },
Effect.gen(function* () {
const rawReachable = (
endpoint: string,
authToken: Record<
string,
string | Redacted.Redacted<string> | undefined
>,
) =>
Effect.gen(function* () {
const client = yield* HttpClient.HttpClient;
const res = yield* client.get(`https://${endpoint}/`, {
headers: AWS.Lambda.microvmAuthHeaders(authToken),
});
return yield* res.text;
});
const effectfulBun: Variant = {
run: yield* AWS.Lambda.RunMicrovm(EffectfulBun),
get: yield* AWS.Lambda.GetMicrovm(EffectfulBun),
auth: yield* AWS.Lambda.CreateAuthToken(EffectfulBun),
term: yield* AWS.Lambda.TerminateMicrovm(EffectfulBun),
reachable: (endpoint, authToken) =>
Effect.gen(function* () {
const sandbox = yield* AWS.Lambda.connectMicrovm(EffectfulBun, {
endpoint,
authToken,
});
return yield* sandbox.hello("bench");
}),
};
const effectfulNode: Variant = {
run: yield* AWS.Lambda.RunMicrovm(EffectfulNode),
get: yield* AWS.Lambda.GetMicrovm(EffectfulNode),
auth: yield* AWS.Lambda.CreateAuthToken(EffectfulNode),
term: yield* AWS.Lambda.TerminateMicrovm(EffectfulNode),
reachable: (endpoint, authToken) =>
Effect.gen(function* () {
const sandbox = yield* AWS.Lambda.connectMicrovm(EffectfulNode, {
endpoint,
authToken,
});
return yield* sandbox.hello("bench");
}),
};
const bun: Variant = {
run: yield* AWS.Lambda.RunMicrovm(BunMicrovm),
get: yield* AWS.Lambda.GetMicrovm(BunMicrovm),
auth: yield* AWS.Lambda.CreateAuthToken(BunMicrovm),
term: yield* AWS.Lambda.TerminateMicrovm(BunMicrovm),
reachable: rawReachable,
};
const node: Variant = {
run: yield* AWS.Lambda.RunMicrovm(NodeMicrovm),
get: yield* AWS.Lambda.GetMicrovm(NodeMicrovm),
auth: yield* AWS.Lambda.CreateAuthToken(NodeMicrovm),
term: yield* AWS.Lambda.TerminateMicrovm(NodeMicrovm),
reachable: rawReachable,
};
const external: Variant = {
run: yield* AWS.Lambda.RunMicrovm(ExternalMicrovm),
get: yield* AWS.Lambda.GetMicrovm(ExternalMicrovm),
auth: yield* AWS.Lambda.CreateAuthToken(ExternalMicrovm),
term: yield* AWS.Lambda.TerminateMicrovm(ExternalMicrovm),
reachable: rawReachable,
};
// opencode is "usable" when its health endpoint answers healthy AND a
// session can actually be created — a real write through the app, which
// proves the server is functional after the snapshot resume, not merely
// listening. The server requires basic auth (see
// contexts/microvm-opencode/Dockerfile), stacked on the MicroVM proxy
// auth headers.
const opencode: Variant = {
run: yield* AWS.Lambda.RunMicrovm(OpencodeMicrovm),
get: yield* AWS.Lambda.GetMicrovm(OpencodeMicrovm),
auth: yield* AWS.Lambda.CreateAuthToken(OpencodeMicrovm),
term: yield* AWS.Lambda.TerminateMicrovm(OpencodeMicrovm),
reachable: (endpoint, authToken) =>
Effect.gen(function* () {
const client = yield* HttpClient.HttpClient;
const headers = {
...AWS.Lambda.microvmAuthHeaders(authToken),
// base64("opencode:bench")
authorization: "Basic b3BlbmNvZGU6YmVuY2g=",
};
const health = yield* client.get(
`https://${endpoint}/global/health`,
{ headers },
);
const healthBody = yield* health.text;
if (health.status !== 200 || !healthBody.includes('"healthy":true')) {
return yield* Effect.fail(
new Error(
`opencode health ${health.status}: ${healthBody.slice(0, 120)}`,
),
);
}
const session = yield* client.post(`https://${endpoint}/session`, {
headers,
body: HttpBody.text("{}", "application/json"),
});
const sessionBody = yield* session.text;
if (session.status !== 200 || !sessionBody.includes('"id"')) {
return yield* Effect.fail(
new Error(
`opencode session ${session.status}: ${sessionBody.slice(0, 120)}`,
),
);
}
return sessionBody;
}),
};
const variants: Record<string, Variant> = {
"effectful-bun": effectfulBun,
"effectful-node": effectfulNode,
bun,
node,
external,
opencode,
};
const pick = (v: string | null): Variant => variants[v ?? ""] ?? effectfulBun;
const boot = (v: Variant) =>
Effect.gen(function* () {
const start = yield* Effect.sync(() => Date.now());
const vm = yield* v.run({
idlePolicy: {
maxIdleDurationSeconds: 900,
suspendedDurationSeconds: 300,
autoResumeEnabled: true,
},
});
return yield* Effect.gen(function* () {
yield* v.get({ microvmIdentifier: vm.microvmId }).pipe(
Effect.flatMap((m) =>
m.state === "RUNNING"
? Effect.void
: Effect.fail(new Error(`microvm ${m.state}`)),
),
Effect.retry({
schedule: Schedule.spaced("500 millis"),
times: 180,
}),
);
const { authToken } = yield* v.auth({
microvmIdentifier: vm.microvmId,
expirationInMinutes: 5,
allowedPorts: [{ port: 8080 }],
});
yield* v.reachable(vm.endpoint, authToken).pipe(
Effect.retry({
schedule: Schedule.exponential("250 millis"),
times: 14,
}),
);
const readyMs = (yield* Effect.sync(() => Date.now())) - start;
return yield* HttpServerResponse.json({ id: vm.microvmId, readyMs });
}).pipe(
Effect.onError(() =>
v.term({ microvmIdentifier: vm.microvmId }).pipe(Effect.ignore),
),
Effect.provide(FetchHttpClient.layer),
);
});
return {
fetch: Effect.gen(function* () {
const request = yield* HttpServerRequest;
const url = new URL(request.url, "http://microvm");
const v = pick(url.searchParams.get("variant"));
if (url.pathname === "/boot") {
return yield* boot(v);
}
if (url.pathname === "/shutdown") {
const id = url.searchParams.get("id")!;
yield* v.term({ microvmIdentifier: id }).pipe(Effect.ignore);
return yield* HttpServerResponse.json({ ok: true });
}
return HttpServerResponse.text("ok");
}).pipe(Effect.orDie),
};
}).pipe(
Effect.provide(
Layer.mergeAll(
AWS.Lambda.RunMicrovmHttp,
AWS.Lambda.GetMicrovmHttp,
AWS.Lambda.CreateAuthTokenHttp,
AWS.Lambda.TerminateMicrovmHttp,
),
),
),
);
@@ -0,0 +1,32 @@
import * as AWS from "alchemy/AWS";
import * as Effect from "effect/Effect";
import { MicrovmBuildRole } from "./build-role.ts";
/**
* Node baseline MicroVM image — the dumbest possible `http.createServer`
* server, built from `contexts/microvm-node/` the same way alchemy builds the
* effectful node {@link import("./effectful-node.ts").EffectfulNode} image (same
* MicroVM base, same `dnf install -y nodejs`, same ARM_64 arch, same 512 MiB).
* `effectfulNode.readyMs − node.readyMs` isolates the alchemy/Effect cold-start
* tax on the runtime the Lambda VMs already ship.
*/
export class NodeMicrovm extends AWS.Lambda.MicrovmImage<NodeMicrovm>()(
"MicrovmBenchNode",
) {}
export default NodeMicrovm.make(
MicrovmBuildRole.pipe(
Effect.map((buildRole) => ({
// External (Dockerfile) mode: the runtime is decided by this context's
// Dockerfile (installs + runs node), NOT by alchemy's `runtime` prop —
// that only applies to effectful `main:` images. Match the effectful
// EffectfulNode's image config: ARM_64, 512 MiB.
context: new URL("../contexts/microvm-node/", import.meta.url).pathname,
buildRole,
resources: [{ minimumMemoryInMiB: 512 }],
cpuConfigurations: [{ architecture: "ARM_64" }],
})),
),
// External (Dockerfile) mode — no Effect runtime to bundle.
Effect.succeed({}),
);
@@ -0,0 +1,22 @@
import * as Cloudflare from "alchemy/Cloudflare";
/**
* Cloudflare-container twin of
* {@link import("./opencode-image.ts").OpencodeMicrovm}: the same Dockerfile
* shape (opencode server as the entrypoint), but Cloudflare boots the image
* from scratch on each cold start — there is no build-time memory snapshot —
* so opencode's process startup is inside every measured boot.
*
* Sized `standard-1` (1/2 vCPU, 4 GiB) — deliberately generous next to the
* MicroVM's 1 GiB, so a slower container boot can't be blamed on CPU/memory
* starvation at the `lite` tier.
*/
export class OpencodeContainer extends Cloudflare.Container<OpencodeContainer>()(
"BenchOpencodeContainer",
{
context: `${import.meta.dirname}/../contexts/opencode`,
maxInstances: 100,
instanceType: "standard-1",
instances: 0,
},
) {}
@@ -0,0 +1,34 @@
import * as AWS from "alchemy/AWS";
import * as Effect from "effect/Effect";
import { MicrovmBuildRole } from "./build-role.ts";
/**
* MicroVM image running an eagerly-started opencode server (a real coding
* agent, ~100 MB binary on a Bun runtime). The Dockerfile's ENTRYPOINT is
* `opencode serve`; the MicroVM image build runs it and snapshots the running
* memory+disk, so every `RunMicrovm` resumes from a snapshot where the server
* is ALREADY listening — the process startup cost is paid once at build time,
* not on each boot. Compare with the Cloudflare
* {@link import("./opencode-container.ts").OpencodeContainer}, which starts
* the same image's entrypoint from scratch on every cold start.
*/
export class OpencodeMicrovm extends AWS.Lambda.MicrovmImage<OpencodeMicrovm>()(
"MicrovmBenchOpencode",
) {}
export default OpencodeMicrovm.make(
MicrovmBuildRole.pipe(
Effect.map((buildRole) => ({
context: new URL("../contexts/microvm-opencode/", import.meta.url)
.pathname,
buildRole,
// opencode is heavier than the hello-world servers; give it 1 GiB
// (matching the Cloudflare variant's tier as closely as the two
// platforms' sizing knobs allow).
resources: [{ minimumMemoryInMiB: 1024 }],
cpuConfigurations: [{ architecture: "ARM_64" }],
})),
),
// Built from the Dockerfile; no Effect program is bundled.
Effect.succeed({}),
);
@@ -0,0 +1,84 @@
import * as Cloudflare from "alchemy/Cloudflare";
import * as Effect from "effect/Effect";
import * as Schedule from "effect/Schedule";
import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest";
import { OpencodeContainer } from "./opencode-container.ts";
// Matches OPENCODE_SERVER_PASSWORD=bench in contexts/opencode/Dockerfile
// (username defaults to `opencode`): base64("opencode:bench").
const AUTH = "Basic b3BlbmNvZGU6YmVuY2g=";
/**
* Durable Object backing one opencode container instance. `boot()` blocks
* until opencode's `/global/health` endpoint answers `{"healthy":true}` AND a
* session can be created — the same two-request readiness probe the MicroVM
* hosts use, so the platforms share one definition of "usable coding agent".
* NOTE: the authoritative cold-start clock runs in the Worker AROUND the whole
* DO call — the container layer eagerly starts the container during DO
* construction, so a clock started here would miss part of the start.
*/
export class OpencodeObject extends Cloudflare.DurableObject<OpencodeObject>()(
"BenchOpencodeObject",
Effect.gen(function* () {
const container = yield* OpencodeContainer;
return Effect.gen(function* () {
const { fetch } = yield* container.getTcpPort(8080);
return {
boot: () =>
Effect.gen(function* () {
const start = yield* Effect.sync(() => Date.now());
yield* Effect.gen(function* () {
const health = yield* fetch(
HttpClientRequest.get("http://container/global/health").pipe(
HttpClientRequest.setHeader("authorization", AUTH),
),
);
const healthBody = yield* health.text;
if (
health.status !== 200 ||
!healthBody.includes('"healthy":true')
) {
return yield* Effect.fail(
new Error(
`opencode health ${health.status}: ${healthBody.slice(0, 120)}`,
),
);
}
// A real write through the app — proves the server is
// functional, not merely listening.
const session = yield* fetch(
HttpClientRequest.post("http://container/session").pipe(
HttpClientRequest.setHeader("authorization", AUTH),
HttpClientRequest.bodyJsonUnsafe({}),
),
);
const sessionBody = yield* session.text;
if (session.status !== 200 || !sessionBody.includes('"id"')) {
return yield* Effect.fail(
new Error(
`opencode session ${session.status}: ${sessionBody.slice(0, 120)}`,
),
);
}
}).pipe(
Effect.retry({
schedule: Schedule.min([Schedule.exponential("1 second"), Schedule.spaced("5 seconds")]),
times: 40,
}),
);
const readyMs = (yield* Effect.sync(() => Date.now())) - start;
return { readyMs };
}),
shutdown: () => container.destroy().pipe(Effect.ignore),
};
});
}).pipe(
Effect.provide(
Cloudflare.Containers.layer(OpencodeContainer, {
enableInternet: true,
}),
),
),
) {}
@@ -0,0 +1,259 @@
import * as AWS from "alchemy/AWS";
import type * as microvms from "@distilled.cloud/aws/lambda-microvms";
import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Schedule from "effect/Schedule";
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
import * as HttpBody from "effect/unstable/http/HttpBody";
import * as HttpClient from "effect/unstable/http/HttpClient";
import type * as HttpClientError from "effect/unstable/http/HttpClientError";
import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest";
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
import { BunMicrovm } from "./bun-image.ts";
import { ExternalMicrovm } from "./external-image.ts";
import { EffectfulBun } from "./effectful-bun.ts";
import { EffectfulNode } from "./effectful-node.ts";
import { NodeMicrovm } from "./node-image.ts";
import { OpencodeMicrovm } from "./opencode-image.ts";
/**
* Lambda host for the MicroVM cold-start benchmark. Exposes a boot/shutdown
* lifecycle so the driver can time each cold start from the OUTSIDE:
*
* - `GET /boot?variant=effectful|external&key=K` launches ONE fresh MicroVM and
* blocks until its in-VM service answers, returning `{ id, readyMs }` where
* `readyMs` = `RunMicrovm` → service-available (time to usable service). It
* does NOT terminate.
* - `GET /shutdown?variant=…&id=ID` terminates the MicroVM.
*/
type Variant = {
readonly run: (
req: AWS.Lambda.RunMicrovmRequest,
) => Effect.Effect<microvms.RunMicrovmResponse, microvms.RunMicrovmError>;
readonly get: (
req: AWS.Lambda.GetMicrovmRequest,
) => Effect.Effect<microvms.GetMicrovmResponse, microvms.GetMicrovmError>;
readonly auth: (
req: AWS.Lambda.CreateAuthTokenRequest,
) => Effect.Effect<
microvms.CreateMicrovmAuthTokenResponse,
microvms.CreateMicrovmAuthTokenError
>;
readonly term: (
req: AWS.Lambda.TerminateMicrovmRequest,
) => Effect.Effect<
microvms.TerminateMicrovmResponse,
microvms.TerminateMicrovmError
>;
readonly reachable: (
endpoint: string,
authToken: AWS.Lambda.MicrovmConnection["authToken"],
) => Effect.Effect<
unknown,
HttpClientError.HttpClientError | Error,
HttpClient.HttpClient
>;
};
export default class Orchestrator extends AWS.Lambda.Function<Orchestrator>()(
"MicrovmBenchOrchestrator",
{
main: import.meta.filename,
url: true,
timeout: Duration.seconds(120),
},
Effect.gen(function* () {
// Plain-HTTP reachable check shared by every non-effectful (raw) image:
// hit `GET /` with the MicroVM auth headers and read the body.
const rawReachable =
(endpoint: string, authToken: AWS.Lambda.MicrovmConnection["authToken"]) =>
Effect.gen(function* () {
const client = yield* HttpClient.HttpClient;
const res = yield* client.get(`https://${endpoint}/`, {
headers: AWS.Lambda.microvmAuthHeaders(authToken),
});
return yield* res.text;
});
const effectfulBun: Variant = {
run: yield* AWS.Lambda.RunMicrovm(EffectfulBun),
get: yield* AWS.Lambda.GetMicrovm(EffectfulBun),
auth: yield* AWS.Lambda.CreateAuthToken(EffectfulBun),
term: yield* AWS.Lambda.TerminateMicrovm(EffectfulBun),
reachable: (endpoint, authToken) =>
Effect.gen(function* () {
const sandbox = yield* AWS.Lambda.connectMicrovm(EffectfulBun, {
endpoint,
authToken,
});
return yield* sandbox.hello("bench");
}),
};
const effectfulNode: Variant = {
run: yield* AWS.Lambda.RunMicrovm(EffectfulNode),
get: yield* AWS.Lambda.GetMicrovm(EffectfulNode),
auth: yield* AWS.Lambda.CreateAuthToken(EffectfulNode),
term: yield* AWS.Lambda.TerminateMicrovm(EffectfulNode),
reachable: (endpoint, authToken) =>
Effect.gen(function* () {
const sandbox = yield* AWS.Lambda.connectMicrovm(EffectfulNode, {
endpoint,
authToken,
});
return yield* sandbox.hello("bench");
}),
};
// Raw baselines: same image-build path + `GET /` reachable as each other,
// differing only by runtime (bun / node) or language (Python external).
const bun: Variant = {
run: yield* AWS.Lambda.RunMicrovm(BunMicrovm),
get: yield* AWS.Lambda.GetMicrovm(BunMicrovm),
auth: yield* AWS.Lambda.CreateAuthToken(BunMicrovm),
term: yield* AWS.Lambda.TerminateMicrovm(BunMicrovm),
reachable: rawReachable,
};
const node: Variant = {
run: yield* AWS.Lambda.RunMicrovm(NodeMicrovm),
get: yield* AWS.Lambda.GetMicrovm(NodeMicrovm),
auth: yield* AWS.Lambda.CreateAuthToken(NodeMicrovm),
term: yield* AWS.Lambda.TerminateMicrovm(NodeMicrovm),
reachable: rawReachable,
};
const external: Variant = {
run: yield* AWS.Lambda.RunMicrovm(ExternalMicrovm),
get: yield* AWS.Lambda.GetMicrovm(ExternalMicrovm),
auth: yield* AWS.Lambda.CreateAuthToken(ExternalMicrovm),
term: yield* AWS.Lambda.TerminateMicrovm(ExternalMicrovm),
reachable: rawReachable,
};
// opencode is "usable" when its health endpoint answers healthy AND a
// session can actually be created — a real write through the app, which
// proves the server is functional after the snapshot resume, not merely
// listening. The server requires basic auth (see
// contexts/microvm-opencode/Dockerfile), stacked on the MicroVM proxy
// auth headers.
const opencode: Variant = {
run: yield* AWS.Lambda.RunMicrovm(OpencodeMicrovm),
get: yield* AWS.Lambda.GetMicrovm(OpencodeMicrovm),
auth: yield* AWS.Lambda.CreateAuthToken(OpencodeMicrovm),
term: yield* AWS.Lambda.TerminateMicrovm(OpencodeMicrovm),
reachable: (endpoint, authToken) =>
Effect.gen(function* () {
const client = yield* HttpClient.HttpClient;
const headers = {
...AWS.Lambda.microvmAuthHeaders(authToken),
// base64("opencode:bench")
authorization: "Basic b3BlbmNvZGU6YmVuY2g=",
};
const health = yield* client.get(
`https://${endpoint}/global/health`,
{ headers },
);
const healthBody = yield* health.text;
if (health.status !== 200 || !healthBody.includes('"healthy":true')) {
return yield* Effect.fail(
new Error(
`opencode health ${health.status}: ${healthBody.slice(0, 120)}`,
),
);
}
const session = yield* client.post(`https://${endpoint}/session`, {
headers,
body: HttpBody.text("{}", "application/json"),
});
const sessionBody = yield* session.text;
if (session.status !== 200 || !sessionBody.includes('"id"')) {
return yield* Effect.fail(
new Error(
`opencode session ${session.status}: ${sessionBody.slice(0, 120)}`,
),
);
}
return sessionBody;
}),
};
const variants: Record<string, Variant> = {
"effectful-bun": effectfulBun,
"effectful-node": effectfulNode,
bun,
node,
external,
opencode,
};
const pick = (v: string | null): Variant => variants[v ?? ""] ?? effectfulBun;
// Run one fresh MicroVM and time RunMicrovm → service-reachable (readyMs).
// Leaves it running for an explicit /shutdown; self-terminates only if boot
// itself fails.
const boot = (v: Variant) =>
Effect.gen(function* () {
const start = yield* Effect.sync(() => Date.now());
const vm = yield* v.run({
idlePolicy: {
maxIdleDurationSeconds: 900,
suspendedDurationSeconds: 300,
autoResumeEnabled: true,
},
});
return yield* Effect.gen(function* () {
yield* v.get({ microvmIdentifier: vm.microvmId }).pipe(
Effect.flatMap((m) =>
m.state === "RUNNING"
? Effect.void
: Effect.fail(new Error(`microvm ${m.state}`)),
),
Effect.retry({
schedule: Schedule.spaced("500 millis"),
times: 180,
}),
);
const { authToken } = yield* v.auth({
microvmIdentifier: vm.microvmId,
expirationInMinutes: 5,
allowedPorts: [{ port: 8080 }],
});
yield* v.reachable(vm.endpoint, authToken).pipe(
Effect.retry({
schedule: Schedule.exponential("250 millis"),
times: 14,
}),
);
const readyMs = (yield* Effect.sync(() => Date.now())) - start;
return yield* HttpServerResponse.json({ id: vm.microvmId, readyMs });
}).pipe(
Effect.onError(() =>
v.term({ microvmIdentifier: vm.microvmId }).pipe(Effect.ignore),
),
Effect.provide(FetchHttpClient.layer),
);
});
return {
fetch: Effect.gen(function* () {
const request = yield* HttpServerRequest;
const url = new URL(request.originalUrl);
const v = pick(url.searchParams.get("variant"));
if (request.method === "GET" && url.pathname === "/boot") {
return yield* boot(v);
}
if (request.method === "GET" && url.pathname === "/shutdown") {
const id = url.searchParams.get("id")!;
yield* v.term({ microvmIdentifier: id }).pipe(Effect.ignore);
return yield* HttpServerResponse.json({ ok: true });
}
return HttpServerResponse.text("ok");
}).pipe(Effect.orDie),
};
}).pipe(
Effect.provide(
Layer.mergeAll(
AWS.Lambda.RunMicrovmHttp,
AWS.Lambda.GetMicrovmHttp,
AWS.Lambda.CreateAuthTokenHttp,
AWS.Lambda.TerminateMicrovmHttp,
),
),
),
) {}
Loaded 100 of 13663 files, more files were not shown because too many files have changed in this diff. Show more