Skip to content

Verify 0.9.2 / Python 0.7.2 / Go v0.8.2: print a failure as CODE: message after close() in finally - #84

Merged
anamhira47 merged 5 commits into
mainfrom
capy/verify-092-failure-line
Dec 4, 2026
Merged

anamhira47 merged 5 commits into
mainfrom
capy/verify-092-failure-line

Conversation

@anamhira47

@anamhira47 anamhira47 commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes how a failed run prints in the pattern every example and skill uses, open() … try … finally { await session.close() }. The docs (agents.md, errors.md, the revyl-verify skill) promise a CODE: message line. What actually printed was Node's default uncaught-error dump: the throwing source line, a stack, the error's fields and Node.js v24…, with the code buried as code: 'VALIDATION_FAILED'.

Cause: cleanup.ts removed its uncaughtException/unhandledRejection listeners in untrackSession(), along with the last session. In the try/finally pattern, close() runs before the error escapes, so by then nothing printed it. A rejected top-level await reaches uncaughtException, so a listener that stays installed is enough.

Fix (TypeScript only):

  • The uncaughtException listener stays installed after the last session closes. As before, it's added only when nothing else listens. The unhandledRejection listener still comes and goes with sessions, so after the last close Node promotes a stray rejection to uncaughtException, and an app's own handler sees it first.
  • When no session is open and another handler has been added since, Verify steps aside, so an app's or test runner's own handler still decides.
  • SIGINT, SIGTERM and beforeExit still come and go with sessions.

Python and Go don't have this gap. An uncaught Python VerifyError already ends its traceback with VerifyError: CODE: message, open or closed, and a Go *verify.Error prints as CODE: message from log.Fatal(err).

Checked with a script on the built cleanup.js:

Case Before (live staging run) After
VerifyError thrown in try, close() in finally Node's dump, exit 1 VALIDATION_FAILED: Validation failed: "…". <reason> See <link>, exit 1
App adds its own uncaughtException handler after closing — the app's handler runs (exit 5 in the repro)
Plain Error from the script's own check Node's dump stack printed, exit 1
Clean run exit 0 exit 0, timers still run
Stray rejection after close, app has only an uncaughtException handler app handler app handler (exit 5)
Stray VerifyError rejection after close, no app handler Node's dump STEP_FAILED: …, exit 1
Error while a session is still open CODE: message, then [verify] Closing … unchanged

Release prep: the version moves to 0.9.2 / Python 0.7.2 / Go v0.8.2 everywhere RELEASING.md lists: both npm packages, every example pin, the version maps and links in the READMEs, the skill and the docs, go/client.go, pyproject.toml, __version__, the User-Agent, both lockfiles, and the release test fixtures. CHANGELOG has 0.9.2, Go 0.8.2 and Python 0.7.2 sections. The plugin goes to 1.3.1, since the skill's links changed; verify#83 sets 1.3.0, so merge #83 first and this one takes the next number.

Everything that merged to main after the v0.9.1 tag (verify#82 and verify#86–#92) was listed under the published 0.9.1 / Go 0.8.1 / Python 0.7.1 sections, but it isn't in those releases. Those bullets move to 0.9.2 / 0.8.2 / 0.7.2, and the 0.9.1-family sections now match the tag exactly. verify#87's 9-minute persistent minimum replaces #82's 390 s bullet.

Not tagged. The maintainer tags v0.9.2, py/v0.7.2 and go/v0.8.2 after merge. The revyl-verify skill, which ships in this package, now says a failure prints CODE: message. The plugin-only verify skill gets the same change in draft #85 after publish.

Checks

  • npm run build, typecheck, test (284 passed), check:package, and check:links: 41 links answer 200 and pin only 0.9.2 / 0.7.2 / v0.8.2.
  • Python: ruff, format, mypy, pytest (772 passed).
  • Go: gofmt, go vet, go test ./....
  • No tests were added (org rule). The before row comes from a live staging run; the after rows from the repro above.

Open in Capy


Note

Low Risk
Risk is low: the behavioral change is limited to Node process cleanup and error printing, with explicit deferral when other uncaughtException handlers exist; the rest is versioning and documentation.

Overview
Bumps Verify 0.9.2, Python 0.7.2, Go v0.8.2, and the revyl-verify plugin to 1.3.1, with version pins and doc links updated across examples, READMEs, and the agent skill.

The notable runtime fix is in TypeScript cleanup.ts: the uncaughtException listener is no longer torn down when the last session untracks, so failures in the usual try / finally { await session.close() } pattern print a single CODE: message line (as documented) instead of Node’s full VerifyError dump. Verify still installs that handler only when nothing else listens, and onFatal steps aside once the app adds its own handler.

CHANGELOG adds 0.9.2-family sections and moves features that landed on main after the 0.9.1 tag out of the 0.9.1 bullets (computer close/release, queued timeouts, file transfer limits, persistent start retry, etc.), so the changelog matches what this release actually ships.

Reviewed by Cursor Bugbot for commit 762aede. Bugbot is set up for automated code reviews on this repo. Configure here.

…sage after close() in finally

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 1 potential issue (1 medium).

View 1 other finding in Capy.

Open in Capy

Comment thread packages/verify/src/cleanup.ts Resolved
…ctions still reach an app's handler; plugin 1.3.1

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

…re-line

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

anamhira47 and others added 2 commits December 3, 2026 21:11
…re-line

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	.claude-plugin/plugin.json
#	plugin.json
… the 0.9.2 package

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 2 other findings in Capy.

Open in Capy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant