Install frontend deps on agent session start#623
Conversation
Agent sessions often need Vite+ and the workspace frontend packages before they can run checks or dev commands. Installing the Bun workspace dependencies at session start makes Codex and Claude worktrees start from the expected local tool state instead of failing later on missing node_modules. Validation: parsed both hook JSON files, checked the shell script with bash -n, and ran the session-start script successfully with Bun. Generated with Codex (GPT-5) Co-authored-by: Codex <codex@openai.com>
The session-start hook runs from a middleman worktree, matching the existing Stop hook convention. Keeping the command form consistent makes the hook configuration easier to read while the shared script remains responsible for running from the repository root. Validation: parsed both hook JSON files and checked the shared shell script with bash -n. Generated with Codex (GPT-5) Co-authored-by: Codex <codex@openai.com>
roborev: Combined Review (
|
Agent session startup should not rerun package installation when the local Vite+ binary is already present. When dependencies are missing, using Vite+'s frozen-lockfile installer keeps the session path aligned with the node-deps environment while preserving a Bun fallback for hosts without a global vp command. Validation: checked script syntax with bash -n; ran the existing-local-vp fast path; exercised missing-local-vp with a stubbed vp and verified it calls `vp install --frozen-lockfile`; exercised the no-vp fallback with a stubbed bun and verified it calls `bun install --frozen-lockfile`. Generated with Codex (GPT-5) Co-authored-by: Codex <codex@openai.com>
roborev: Combined Review (
|
The session-start setup still needs to prepare frontend tooling automatically, but routing through a branch-controlled helper script and package lifecycle hooks gives untrusted PRs more execution surface than needed. Keep the automatic install while limiting it to the hook definition itself and package-manager installs with lifecycle scripts disabled. Validation: parsed both hook JSON files; ran the existing-node_modules fast path from the hook command; exercised missing-node_modules with stubbed vp and verified `vp install --frozen-lockfile --ignore-scripts`; exercised the fallback path with stubbed bun and verified `bun install --frozen-lockfile --ignore-scripts`. Generated with Codex (GPT-5) Co-authored-by: Codex <codex@openai.com>
The frontend dependency bootstrap hook is intentionally automatic, but future edits need to preserve the trust boundary: avoid branch-controlled helper scripts or Make targets and disable package lifecycle scripts when installing. Recording that convention keeps the review decision from living only in this PR conversation. Validation: ran git diff --check. Generated with Codex (GPT-5) Co-authored-by: Codex <codex@openai.com>
Installing with lifecycle scripts disabled is safer but needs a cheap readiness check so SessionStart does not report success without the local Vite+ entrypoint. The project guidance now also states the real trust boundary: this reduces execution surface, but changed hook config still depends on the runner's hook-trust model. Validation: parsed both hook JSON files; ran the existing-node_modules fast path; exercised stubbed vp and Bun install paths and verified they include --ignore-scripts and satisfy the post-install Vite+ entrypoint check; ran git diff --check. Generated with Codex (GPT-5) Co-authored-by: Codex <codex@openai.com>
roborev: Combined Review (
|
Agent sessions can fail immediately on frontend checks when
node_modulesis missing. This adds a shared session-start hook for Codex and Claude that runs the existing Bun workspace dependency target before work begins.This keeps both agent entrypoints aligned with the repo's Bun-only frontend tooling and avoids each workflow rediscovering missing Vite+ deps later.
generated by a clanker