Open History to see the last commit
AGENTS.md#
Task Completion Requirements#
- Keep local verification focused on the files and packages changed. Run the smallest relevant test set; do not run the full workspace test suite as a routine completion step.
- Use
vp test run <test-files>for focused built-in Vite+ tests. Usevp run testonly when the affected package specifically requires itstestscript. - Backend changes must include and run focused tests for the changed behavior.
- Run targeted formatting, lint, and type checks for the affected scope when available.
- Use
- Do not run repo-wide
vp check,vp run typecheck,vp run test, or equivalent full-suite commands locally unless the user explicitly requests them. CI is responsible for the full verification suite. - After frontend feature development or any user-visible frontend behavior change, the primary agent must run one integrated verification pass for each affected client surface after integrating the work:
- Web: use the
test-t3-appskill. Launch one isolated environment, authenticate through the printed pairing URL, and verify the affected flow in the controlled browser. - Mobile: use the
test-t3-mobileskill. Connect one representative iOS Simulator or Android Emulator available on the host to one isolated environment and verify the affected flow. On compatible macOS hosts, prefer iOS for cross-platform changes and stream it through serve-sim in the T3 Code in-app browser or another available agent browser; use Android when it is the affected or viable platform. - Subagents must not independently launch dev servers or repeat integrated client verification unless their delegated task explicitly requires it.
- Stop dev servers, watchers, and other long-running verification processes when the focused verification is complete.
- Web: use the
Package Roles#
apps/server: Node.js WebSocket server. Wraps Codex app-server (JSON-RPC over stdio), serves the React web app, and manages provider sessions.apps/web: React/Vite UI. Owns session UX, conversation/event rendering, and client-side state. Connects to the server via WebSocket.packages/contracts: Shared effect/Schema schemas and TypeScript contracts for provider events, WebSocket protocol, and model/session types. Keep this package schema-only — no runtime logic.packages/shared: Shared runtime utilities consumed by both server and client applications. Uses explicit subpath exports (e.g.@t3tools/shared/git) — no barrel index.packages/client-runtime: Shared runtime package for sharing client code across web and mobile.
Antigravity provider#
The antigravity driver wraps the Antigravity CLI (agy), which has no native agent
protocol. apps/server/src/provider/acp/antigravity/agyBridge.ts presents the ACP surface
AcpSessionRuntime needs and runs each turn through agy --print, shipping as hidden
subcommands of the server binary (t3 agy-acp, t3 agy-hook).
A live event stream is reconstructed from two documented Antigravity sources that correlate on
step index (stepIdx in a hook == step_index in the transcript):
- Hooks (
PreToolUse/PostToolUse/Stop) give tool name, arguments, and status. The bridge registers them via a throwaway--add-dirworkspace so nothing is written into the user's repo. Both the session cwd and that hook workspace must be passed —--add-dirreplaces the workspace rather than adding to cwd, so passing only the hook dir hides the project from the agent. - The trajectory transcript (
transcript.jsonl) gives assistant text and real tool output as the turn runs. Its record format is undocumented, so parsing degrades to emitting nothing.
Known constraints, all inherent to print mode:
agyalways runs with--dangerously-skip-permissionsbecause print mode cannot prompt. Approvals instead come from thePreToolUsehook, which blocks the tool until T3 Code answers — adenydecision genuinely stops it and is reported back to the model. Controlled by therequireToolApprovalsetting, on by default; it fails closed on timeout, a lost bridge, or any hook failure. Turn it off to let tools run unattended.- What the approval gate does and does not defend against. Decisions travel as files in a
per-turn temp directory, signed with an HMAC over the hook, the verdict, and a digest of the
hook's own payload; the key is generated per turn and reaches the hook through the
environment
agypasses down. That stops an unrelated process forging a decision, stops a decision being replayed onto a different request, and stops a tool approved in one turn signing for any later turn. It does not contain a tool within the turn that approved it: that tool inherits the same environment, so it can sign decisions for other tools in that turn. Closing that needs an OS-level boundary — a broker socket or sandbox whose credentials are not inheritable — which is outside what this provider can do whileagyruns unsandboxed. The gate's purpose is to stop the model acting unilaterally, not to contain code the user has already approved. - Attachments are passed by path, not inline: the adapter sends
resource_linkblocks for files the attachment store already wrote to disk, and the bridge names those paths in the prompt and adds their directory to the workspace.agyhas no attachment flag, so inline image capability stays off. - No session modes, and no provider-side rollback — a resumed conversation keeps its full
trajectory, so
rollbackThreadfails rather than silently truncating local state only. --modelis a per-spawn flag that composes with--conversation, so a model switch keeps the trajectory and applies from the next turn (sessionModelSwitch: "in-session").- Cancelling a turn kills
agy's whole process group, not justagy: tools it started otherwise keep writing to the workspace after Stop. Every signal is guarded on the leader still being alive, because a group id belongs to us only while it holds one — once the leader is reaped the number is free, and a signal sent afterwards can land on whatever inherited it. Nothing signals a group after itsexit. The cost is that a tool which deliberately outlivesagyis not reaped. That is the same boundary the approval gate draws: code the user has already approved can do as it likes, including backgrounding itself. Reaping those would need a supervisor process that stays in the group, or a Windows Job Object — neither reachable in plain Node. The bridge also kills its child group on SIGTERM, SIGINT and normal exit, but a SIGKILL of the bridge itself runs no handler, andagyis then reparented to init. POSIX offers no portable parent-death signal (PR_SET_PDEATHSIGis Linux-only and not exposed by Node), so a force-killed bridge can leave oneagybehind until its--print-timeoutelapses. - Any
agysubcommand spawned for a probe must setstdin: "ignore".agystarts a language server and will not emit output while stdin stays open, so the default"pipe"hangs it. - Runtime events are buffered without a cap, so a subscriber that stops consuming grows memory
until it resumes. This is the shape every adapter uses — Claude, Codex, Cursor, Grok and
OpenCode all publish through an unbounded queue or pub/sub, as does
ProviderServiceitself — so this provider follows it rather than diverging. Bounding it is a decision for the shared runtime, not for one provider. What the bridge does bound is its own side:writeMessagehonours stdout backpressure and pauses polling while the pipe is behind, so a slow reader cannot inflate the bridge process. - A transcript record carrying no
step_indexis ordered by where it was read, inheriting the preceding entry's key. Every record observed in practice carries one. If a planner response without an index were read in the same poll as thePreToolUsehook of the step after it, the tool call would be announced first. Hooks have to be ingested before transcript records — a record has nothing to attach to otherwise — so ordering the two exactly would need a shared sequence number Antigravity does not emit.
Reference Repos#
- Open-source Codex repo: https://github.com/openai/codex
Use these as implementation references when designing protocol handling, UX flows, and operational safeguards.
Vendored Repositories#
This project vendors external repositories under .repos/ as read-only reference material for coding
agents.
- Prefer examples and patterns from the vendored source code over generated guesses or web search results.
- Do not edit files under
.repos/unless explicitly asked. - Do not import from
.repos/; application code must continue importing from normal package dependencies. - Manage vendored subtrees with
vpr sync:repos; usevpr sync:repos --repo <id>to sync one configured repository. - When updating a dependency with a configured vendored subtree, sync that subtree in the same change so
.repos/matches the installed dependency version. - When writing Effect code, read
.repos/effect-smol/LLMS.mdfirst and inspect.repos/effect-smol/for examples of idiomatic usage, tests, module structure, and API design. - When writing relay infrastructure code with Alchemy, inspect
.repos/alchemy-effect/for examples of idiomatic usage, tests, module structure, and API design.