Commit Graph

1 Commits

Author SHA1 Message Date
roboomp 70e4cfcbf2 fix(coding-agent): convert createSessionManager throws into friendly CLI errors
`omp --resume <id>` and `omp --fork <id>` previously crashed with
`[Uncaught Exception] Error: Session "..." not found.` followed by a
stack trace whenever the id did not match an existing session. The
throws in `createSessionManager` were never caught by `runRootCommand`,
so they fell through to the global `unhandledRejection` handler in
`postmortem.ts` and printed the raw stack instead of a clean message.

Add `SessionResolutionError` (a dedicated subclass of `Error` with an
optional usage `hint`) and use it for every user-facing resolution
failure: unknown `--resume`/`--fork` id, `--fork` combined with
`--no-session`, and the non-interactive cross-project / moved-cwd
prompts. `runRootCommand` catches it around the `createSessionManager`
call, writes `Error: <msg>` (and the hint when present) to stderr, and
exits with code 1. Other (unexpected) errors still propagate so they
remain visible to the postmortem handler.

Fixes #2084
2026-06-08 03:15:50 +00:00