Repository navigation
fix(cli): open Remix/Expo/Vite previews without the agent, unblock project .codeam/ - #1026
Merged
Merged
Conversation
…oject .codeam/ - Preview detection: after .codeam/preview.json and BEFORE the agent one-shot (and before the generateOneShot availability check), detectKnownProject answers projects whose start command is certain: a Remix export (root remix.json; MOBILE -> the Expo detection, WEB -> Vite), a plain single-package Expo app or a Vite app whose dev script is `vite`. Monorepos keep the agent. The debug log names the path (preview.json | deterministic | agent) and a timed-out one-shot now logs the agent's stderr tail. The prewarm no longer bills a one-shot for these projects. (2026-11-23: a Remix Expo export on a Box with Antigravity never got an answer from `agy -p` in 120 s.) - Antigravity one-shot: --print-timeout ends 10 s before the caller's budget so agy's own timeout (partial answer + reason) lands before the Preview deadline. - ACP internals guard: a `.codeam` mention is resolved against the session cwd and blocked only under the HOME ~/.codeam; a repo cloned AT home still gets .codeam/preview.json and .codeam/provision/. Writing the project's own .codeam/preview.json was auto-blocked as "CodeAgent's own runtime files". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
2026-11-23, prod: a Remix export (Pasito — Expo SDK 54 +
server/+ rootremix.json) opened on a Box with Antigravity. The agent'sstart_previewfailed with "Project detection timed out after 120 s — the agent did not answer" (theagy -pdetect one-shot never answered), so the agent rannpx expo start --webin its own bash, outside our Preview pane. In the same flow, the agent's attempt to write the project's documented.codeam/preview.jsonoverride was auto-blocked as "CodeAgent's own runtime files (~/.codeam)".What
services/preview/known-project.tsdetectKnownProject), tried after.codeam/preview.jsonand before the agent one-shot and its availability check:remix.json): MOBILE /expo-app/expodep /registerRootComponententry -> the Expo detection the agent returns (npx expo start, 8081, no--tunnel; the Expo bring-up installs the web packages and serves the web build in the pane + Expo Go link). WEB -> Vite (npm run dev -- --host 0.0.0.0for avitedev script, elsenpx vite --host 0.0.0.0 --port 5173, since Remix web templates only declarebuild).server/(Hono on Cloudflare Workers + D1, reached through__REMIX_SERVER_BASE__) can't run locally: the client comes up andnotessays so.expo+app.json/app.config.*) or Vite (dev: vite …). Monorepos keep the agent.detect: path=preview.json|deterministic kind=…|agent. A timed-out one-shot now logs the agent's stderr tail. The prewarm skips its one-shot for these projects.--print-timeoutnow ends 10 s before the caller's budget (it was equal to the Preview's 120 s deadline, so agy's own timeout and partial answer could never arrive first)..codeammention is resolved against the session cwd and blocked only under HOME~/.codeam. When the repo is cloned AT home, only.codeam/preview.jsonand.codeam/provision/are allowed.Tests
New
__tests__/preview/known-project.test.ts(Remix mobile/web, plain Expo/Vite, monorepos, the no-one-shot runtime) and new guard cases ininternal-paths.test.ts(project.codeam/, a repo at home).tsc --noEmitis clean. Suites in the touched areas pass. On this machine the full-suite failures differ from run to run: timer and subprocess tests that pass when run alone.acp.adapterModuleGraph.intalso fails on main locally.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.