Skip to content

Successful pm subcommands can emit unsettled top-level await warning and exit 13 #209

Closed

Description

@unbraind

Summary

During a 2026-06-12 3d-bots PM audit, some pm subcommands appeared to perform their mutation successfully, then emitted Node's unsettled top-level await warning from dist/cli.js and exited with code 13. This interrupted chained audit commands and forced reruns of subsequent subcommands.

No exact upstream duplicate was found from unsettled top-level await cli.js runPmCli.

Evidence

One example occurred while linking game unit test docs/files after a successful pm test pm-oc14 --add:

ok: true
id: "pm-oc14"
tests:
  - command: "PM_PATH=/tmp/pm-3d-bots-game-tests PM_GLOBAL_PATH=/tmp/pm-3d-bots-game-tests-global pnpm --filter game test"
    path: "apps/game/src/game"
    scope: "project"
    timeout_seconds: 600
    pm_context_mode: "tracker"
...
changed: true
count: 1
Warning: Detected unsettled top-level await at file:///home/steve/GITHUB_RELEASE/pm-cli/dist/cli.js:62
    await runPmCli(process.argv.slice(2));
    ^

The shell reported exit code 13, so chained && pm docs ... && pm files ... commands did not run even though the first mutation succeeded.

A similar warning appeared during an audit comment/file-link command sequence for pm-xpdu.

Expected

If the mutation succeeds, the process should exit 0 without an unsettled-await warning. If there is background work that cannot settle, the CLI should either await/close it cleanly or fail before applying the mutation.

Why it matters

Agents frequently chain pm commands while recording audit evidence. A successful mutation followed by exit 13 causes partial update sequences, makes command outcomes ambiguous, and can require manual inspection to avoid duplicate reruns.

Activity

  1. added a commit that references this issue on Jun 14, 2026
  2. unbraind commented on Jul 11, 2026

    @unbraind
    OwnerAuthor

    pm tracker items:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions