Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

fix(scripts): rename status var in :agent scripts so they work under zsh - #842

Merged
wmadden merged 1 commit into
mainfrom
fix/agent-scripts-zsh-status-var
Jun 23, 2026
Merged

wmadden merged 1 commit into
mainfrom
fix/agent-scripts-zsh-status-var

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

The root package.json *:agent capture scripts (build:agent, typecheck:agent, test:packages:agent, test:integration:agent, test:e2e:agent, lint:agent, lint:deps:agent, fixtures:check:agent) recorded the exit code with:

... 2>&1; status=$?; echo $status > wip/<name>.$ts.exit; exit $status

status is a read-only special variable in zsh (a synonym for $?). Under zsh the assignment fails with read-only variable: status, and the following echo $status / exit $status then read zshs builtin $status — which is the $? of the failed assignment, i.e. 1. So a passing run records exit code 1 in the .exit file and the wrapper exits 1. A green run looks red.

These scripts work today only because pnpm runs package scripts under /bin/sh (where ZSH_VERSION is empty). The pattern breaks the moment the wrapper body is copied into a zsh prompt or the Claude Code Bash tool — which is exactly what agents and humans on zsh machines do. A subagent already hit this with a hand-written ad-hoc wrapper.

Fix

Rename status → rc in every *:agent script. Behavior is otherwise identical.

Verification

Wrapper body run directly under zsh -c:

form passing cmd failing cmd
old (status=) read-only variable: status, exits 1, no .exit file —
new (rc=) exits 0, .exit = 0 exits 1, .exit = 1

Also ran pnpm lint:deps:agent end-to-end: prints the log path, writes 0 to the .exit sibling, exits 0.

No rule/skill/doc shows the raw wrapper body (running-tests.mdc only documents the :agent scripts and the .exit file), so this change is confined to package.json.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated internal build, test, and validation scripts to improve exit code handling and reporting in automated processes.

The `*:agent` capture scripts used `status=$?`, but `status` is a
read-only special variable in zsh (a synonym for $?). Under zsh the
assignment fails with "read-only variable: status" and the subsequent
`echo $status` / `exit $status` fall back to zsh's builtin $status (the
$? of the failed assignment, i.e. 1) — so a passing run records exit
code 1 and the wrapper exits 1. A green run looks red.

The scripts only worked because pnpm runs package scripts under /bin/sh.
They break the moment an agent or human copies the wrapper body into a
zsh prompt (as already happened with a hand-written ad-hoc wrapper).

Rename `status` to `rc` in every `*:agent` script. Verified under zsh:
passing command exits 0 and writes 0 to the .exit file; failing command
exits 1 and writes 1.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric requested a review from a team as a code owner June 16, 2026 15:02
@wmadden
wmadden enabled auto-merge June 16, 2026 15:04
@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 2156a7f1-5fac-40b0-9c63-2258ad349c54

📥 Commits

Reviewing files that changed from the base of the PR and between 088813b and d1527ac.

📒 Files selected for processing (1)
  • package.json

📝 Walkthrough

Walkthrough

All eight :agent npm script variants in package.json rename the shell variable used to capture, log, and propagate the exit code from status to rc. The pattern status=$?; echo $status > .exit; exit $status is replaced with rc=$?; echo $rc > .exit; exit $rc uniformly across all affected scripts.

Changes

Agent Script Exit Code Variable Rename

Layer / File(s) Summary
Rename status to rc in all agent scripts
package.json
All eight :agent script variants (build, test:packages, test:e2e, test:integration, lint, lint:deps, fixtures:check, typecheck) replace status=$?/echo $status/exit $status with rc=$?/echo $rc/exit $rc.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • prisma/prisma-next#832: Modifies the same *:agent scripts in package.json, also touching the exit-code capture variable for the same set of agent command variants.

Suggested reviewers

  • aqrln

Poem

🐇 A variable named status once hopped through the shell,
Now rc takes its place — it does just as well!
Eight scripts in a row, all renamed with care,
The exit code travels on rc's short flair.
Small change, big consistency — the warren approves! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: renaming a shell variable in agent scripts for zsh compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/agent-scripts-zsh-status-var

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
postgres / no-emit 153.31 KB (0%)
postgres / emit 140.92 KB (0%)
mongo / no-emit 78 KB (0%)
mongo / emit 72.09 KB (0%)
cf-worker / no-emit 181.74 KB (0%)
cf-worker / emit 167.76 KB (0%)

@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

@prisma-next/extension-author-tools

npm i https://pkg.pr.new/@prisma-next/extension-author-tools@842

@prisma-next/mongo-runtime

npm i https://pkg.pr.new/@prisma-next/mongo-runtime@842

@prisma-next/family-mongo

npm i https://pkg.pr.new/@prisma-next/family-mongo@842

@prisma-next/sql-runtime

npm i https://pkg.pr.new/@prisma-next/sql-runtime@842

@prisma-next/family-sql

npm i https://pkg.pr.new/@prisma-next/family-sql@842

@prisma-next/extension-arktype-json

npm i https://pkg.pr.new/@prisma-next/extension-arktype-json@842

@prisma-next/middleware-cache

npm i https://pkg.pr.new/@prisma-next/middleware-cache@842

@prisma-next/mongo

npm i https://pkg.pr.new/@prisma-next/mongo@842

@prisma-next/extension-paradedb

npm i https://pkg.pr.new/@prisma-next/extension-paradedb@842

@prisma-next/extension-pgvector

npm i https://pkg.pr.new/@prisma-next/extension-pgvector@842

@prisma-next/extension-postgis

npm i https://pkg.pr.new/@prisma-next/extension-postgis@842

@prisma-next/postgres

npm i https://pkg.pr.new/@prisma-next/postgres@842

@prisma-next/sql-orm-client

npm i https://pkg.pr.new/@prisma-next/sql-orm-client@842

@prisma-next/sqlite

npm i https://pkg.pr.new/@prisma-next/sqlite@842

@prisma-next/extension-supabase

npm i https://pkg.pr.new/@prisma-next/extension-supabase@842

@prisma-next/target-mongo

npm i https://pkg.pr.new/@prisma-next/target-mongo@842

@prisma-next/adapter-mongo

npm i https://pkg.pr.new/@prisma-next/adapter-mongo@842

@prisma-next/driver-mongo

npm i https://pkg.pr.new/@prisma-next/driver-mongo@842

@prisma-next/contract

npm i https://pkg.pr.new/@prisma-next/contract@842

@prisma-next/utils

npm i https://pkg.pr.new/@prisma-next/utils@842

@prisma-next/config

npm i https://pkg.pr.new/@prisma-next/config@842

@prisma-next/errors

npm i https://pkg.pr.new/@prisma-next/errors@842

@prisma-next/framework-components

npm i https://pkg.pr.new/@prisma-next/framework-components@842

@prisma-next/operations

npm i https://pkg.pr.new/@prisma-next/operations@842

@prisma-next/ts-render

npm i https://pkg.pr.new/@prisma-next/ts-render@842

@prisma-next/contract-authoring

npm i https://pkg.pr.new/@prisma-next/contract-authoring@842

@prisma-next/ids

npm i https://pkg.pr.new/@prisma-next/ids@842

@prisma-next/psl-parser

npm i https://pkg.pr.new/@prisma-next/psl-parser@842

@prisma-next/psl-printer

npm i https://pkg.pr.new/@prisma-next/psl-printer@842

@prisma-next/cli

npm i https://pkg.pr.new/@prisma-next/cli@842

@prisma-next/cli-telemetry

npm i https://pkg.pr.new/@prisma-next/cli-telemetry@842

@prisma-next/emitter

npm i https://pkg.pr.new/@prisma-next/emitter@842

@prisma-next/migration-tools

npm i https://pkg.pr.new/@prisma-next/migration-tools@842

prisma-next

npm i https://pkg.pr.new/prisma-next@842

@prisma-next/vite-plugin-contract-emit

npm i https://pkg.pr.new/@prisma-next/vite-plugin-contract-emit@842

@prisma-next/mongo-codec

npm i https://pkg.pr.new/@prisma-next/mongo-codec@842

@prisma-next/mongo-contract

npm i https://pkg.pr.new/@prisma-next/mongo-contract@842

@prisma-next/mongo-value

npm i https://pkg.pr.new/@prisma-next/mongo-value@842

@prisma-next/mongo-contract-psl

npm i https://pkg.pr.new/@prisma-next/mongo-contract-psl@842

@prisma-next/mongo-contract-ts

npm i https://pkg.pr.new/@prisma-next/mongo-contract-ts@842

@prisma-next/mongo-emitter

npm i https://pkg.pr.new/@prisma-next/mongo-emitter@842

@prisma-next/mongo-schema-ir

npm i https://pkg.pr.new/@prisma-next/mongo-schema-ir@842

@prisma-next/mongo-query-ast

npm i https://pkg.pr.new/@prisma-next/mongo-query-ast@842

@prisma-next/mongo-orm

npm i https://pkg.pr.new/@prisma-next/mongo-orm@842

@prisma-next/mongo-query-builder

npm i https://pkg.pr.new/@prisma-next/mongo-query-builder@842

@prisma-next/mongo-lowering

npm i https://pkg.pr.new/@prisma-next/mongo-lowering@842

@prisma-next/mongo-wire

npm i https://pkg.pr.new/@prisma-next/mongo-wire@842

@prisma-next/sql-contract

npm i https://pkg.pr.new/@prisma-next/sql-contract@842

@prisma-next/sql-errors

npm i https://pkg.pr.new/@prisma-next/sql-errors@842

@prisma-next/sql-operations

npm i https://pkg.pr.new/@prisma-next/sql-operations@842

@prisma-next/sql-schema-ir

npm i https://pkg.pr.new/@prisma-next/sql-schema-ir@842

@prisma-next/sql-contract-psl

npm i https://pkg.pr.new/@prisma-next/sql-contract-psl@842

@prisma-next/sql-contract-ts

npm i https://pkg.pr.new/@prisma-next/sql-contract-ts@842

@prisma-next/sql-contract-emitter

npm i https://pkg.pr.new/@prisma-next/sql-contract-emitter@842

@prisma-next/sql-lane-query-builder

npm i https://pkg.pr.new/@prisma-next/sql-lane-query-builder@842

@prisma-next/sql-relational-core

npm i https://pkg.pr.new/@prisma-next/sql-relational-core@842

@prisma-next/sql-builder

npm i https://pkg.pr.new/@prisma-next/sql-builder@842

@prisma-next/target-postgres

npm i https://pkg.pr.new/@prisma-next/target-postgres@842

@prisma-next/target-sqlite

npm i https://pkg.pr.new/@prisma-next/target-sqlite@842

@prisma-next/adapter-postgres

npm i https://pkg.pr.new/@prisma-next/adapter-postgres@842

@prisma-next/adapter-sqlite

npm i https://pkg.pr.new/@prisma-next/adapter-sqlite@842

@prisma-next/driver-postgres

npm i https://pkg.pr.new/@prisma-next/driver-postgres@842

@prisma-next/driver-sqlite

npm i https://pkg.pr.new/@prisma-next/driver-sqlite@842

commit: d1527ac

@wmadden-electric

Copy link
Copy Markdown
Contributor Author

Superseded by #853, which replaces the inline-shell :agent wrappers with a portable Node wrapper (scripts/run-logged.mjs). That removes the status=$? idiom entirely (no shell variable), so it fixes the zsh read-only-status bug this PR targets and adds a hard timeout so a hung suite fails with .exit = 124 instead of blocking forever. Suggest closing this in favour of #853.

@wmadden
wmadden added this pull request to the merge queue Jun 23, 2026
Merged via the queue into main with commit 5b4e665 Jun 23, 2026
20 checks passed
@wmadden
wmadden deleted the fix/agent-scripts-zsh-status-var branch June 23, 2026 12:27
wmadden-electric added a commit that referenced this pull request Jun 24, 2026
Main moved 2 commits ahead (language-server PSL symbol-table
diagnostics #862, a zsh :agent-script fix #842). Neither touches the
slice's postgres target/adapter source. Clean auto-merge, no conflicts,
no src/ conflicts. Lockfile matches main; pnpm install reconciles.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
wmadden-electric added a commit that referenced this pull request Jun 24, 2026
…te fails loudly

The :agent wrappers redirect a slow command to a log file and write the exit
code to a sibling .exit marker. When vitest intermittently freezes after
printing its summary (an unresolved PGlite/WASM teardown abort on Linux), the
inner `pnpm <cmd>` never returns, the .exit marker is never written, and the
wrapper blocks forever.

Replace the inline-shell wrappers with a portable Node wrapper, scripts/
run-logged.mjs, that runs the command under a hard timeout (default 60 min,
override via AGENT_CMD_TIMEOUT_SECONDS). On timeout it kills the child process
group, records 124 in the .exit file, and returns — so a hang now fails loudly
instead of hanging. `timeout`/`gtimeout` are not portable (absent on macOS), so
the bound is enforced in Node.

This also removes the `status=$?` shell idiom, which is a read-only variable in
zsh and broke the wrappers there (supersedes the standalone rename in #842).

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
wmadden-electric added a commit that referenced this pull request Jun 24, 2026
…te fails loudly

The :agent wrappers redirect a slow command to a log file and write the exit
code to a sibling .exit marker. When vitest intermittently freezes after
printing its summary (an unresolved PGlite/WASM teardown abort on Linux), the
inner `pnpm <cmd>` never returns, the .exit marker is never written, and the
wrapper blocks forever.

Replace the inline-shell wrappers with a portable Node wrapper, scripts/
run-logged.mjs, that runs the command under a hard timeout (default 60 min,
override via AGENT_CMD_TIMEOUT_SECONDS). On timeout it kills the child process
group, records 124 in the .exit file, and returns — so a hang now fails loudly
instead of hanging. `timeout`/`gtimeout` are not portable (absent on macOS), so
the bound is enforced in Node.

This also removes the `status=$?` shell idiom, which is a read-only variable in
zsh and broke the wrappers there (supersedes the standalone rename in #842).

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
wmadden-electric added a commit that referenced this pull request Jun 24, 2026
…te fails loudly

The :agent wrappers redirect a slow command to a log file and write the exit
code to a sibling .exit marker. When vitest intermittently freezes after
printing its summary (an unresolved PGlite/WASM teardown abort on Linux), the
inner `pnpm <cmd>` never returns, the .exit marker is never written, and the
wrapper blocks forever.

Replace the inline-shell wrappers with a portable Node wrapper, scripts/
run-logged.mjs, that runs the command under a hard timeout (default 60 min,
override via AGENT_CMD_TIMEOUT_SECONDS). On timeout it kills the child process
group, records 124 in the .exit file, and returns — so a hang now fails loudly
instead of hanging. `timeout`/`gtimeout` are not portable (absent on macOS), so
the bound is enforced in Node.

This also removes the `status=$?` shell idiom, which is a read-only variable in
zsh and broke the wrappers there (supersedes the standalone rename in #842).

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
paulwer pushed a commit to paulwer/prisma-next that referenced this pull request Jul 12, 2026
…te fails loudly (prisma#853)

## Problem

The root `:agent` script wrappers (`test:integration:agent`,
`test:packages:agent`, …) redirect a slow command to a timestamped log
under `wip/` and write its exit code to a sibling `.exit` marker, so an
agent can fire-and-check rather than stream output. The inline shell
was:

```
ts=…; log=wip/<name>.$ts.log; echo "log: $log"; pnpm <cmd> > "$log" 2>&1; status=$?; echo $status > wip/<name>.$ts.exit; exit $status
```

On an intermittent vitest hang **after** it prints its full passing
summary (`Test Files … passed`, `Duration …s`), the inner `pnpm <cmd>`
never returns. The `status=$?; echo … > …exit; exit` tail never runs,
the `.exit` marker is never written, and the wrapper **blocks forever**
until something external kills it.

## Diagnosis

I could not reproduce the post-summary hang on macOS in 10 full
integration runs — the process always exits after the summary (cleanly,
or non-zero on a test failure, in which case the `.exit` is written
correctly). The hang is intermittent and matches the documented
**Linux-only PGlite (WASM) teardown abort**
(`jit_page_->allocations_.erase`) that
`test/integration/vitest.config.ts` already tries to mitigate with
`--no-memory-protection-keys` and that still "intermittently aborts on
Linux" per that config's own comment. It lives in the `@prisma/dev`
dependency's WASM teardown, not in this repo's test teardown: I traced
every suspected leak (the `pg.Pool`/`pg.Client` in the postgres driver
tests and integration runtime helper, every `MongoMemoryReplSet`) and
each is closed — `driver.close()` ends the pool/client, and every
replset has a matching `stop()`. So there is no missing `afterAll` to
fix here.

## Fix

Replace the eight inline-shell `:agent` wrappers with one portable Node
wrapper, `scripts/run-logged.mjs`, that runs the command under a **hard
timeout** (default 60 min, override with `AGENT_CMD_TIMEOUT_SECONDS`).
On timeout it kills the child **process group** (so turbo/vitest
grandchildren die too), records `124` in the `.exit` file, and returns.
A hang now fails loudly with a non-zero `.exit` instead of blocking
forever — the reliable backstop the root-cause (a dependency's
intermittent WASM teardown) doesn't give us.

`timeout`/`gtimeout` are not portable (absent on macOS, where agents
run), so the bound is enforced in Node rather than via the `timeout`
binary.

Bonus: this drops the `status=$?` idiom, which is a **read-only variable
in zsh** and broke the wrappers there. That makes it a superset of prisma#842
(the standalone `status`→`rc` rename) — **prisma#842 can be closed in favour
of this.**

## Verification

- `scripts/run-logged.test.mjs` (wired into `test:scripts`) covers all
four exit paths: success → `.exit` 0; failure → `.exit` is the child
code; timeout → `.exit` 124 + `TIMEOUT` marker; and idempotency (the
SIGKILL-triggered `close` can't overwrite `124`).
- End-to-end on the real wrappers: `build:agent` returns rc 0 and writes
`.exit` 0; `test:integration:agent` returns rc 1 on a failing run and
writes `.exit` 1 (faithful pass-through). Both print the `log:` line and
capture full output.

## Out of scope / follow-up

The package-level vitest configs (run by `test:packages`) lack the
`--no-memory-protection-keys` flag that integration/e2e set, which is
the most likely contributor to the Linux `test:packages` hang.
Propagating it is a separate, low-risk change tracked as a follow-up; it
only *reduces* the abort, so the timeout wrapper here is the actual
backstop.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Updated agent command execution to run through a logging wrapper that
records stdout/stderr to timestamped logs and prints the log path.
* Added hard timeouts for `:agent` runs (default **5 minutes**;
configurable); on timeout the process is terminated and the run exits
with **124**.
* **Documentation**
* Refreshed running-tests guidance to clarify timeout and
timeout-termination behavior.
* **Tests**
* Added tests covering successful runs, exit-code propagation, and
timeout behavior (including ensuring the `.exit` file isn’t
overwritten).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants