Commit Graph
4 Commits
Author SHA1 Message Date
sjw1231 82c195c0f4 fix(plan-mode): report an unready plan reader as PlanModeError
planState() serves the /plan command, prompt assembly, the tool
admission predicate, and the service methods, so its readiness failure
is PlanModeError PLAN_STATE_UNAVAILABLE instead of the tool-only
ToolContextUnavailableError. The code set is a literal union documented
in place rather than a link to a module-local array.

Refs #7869
2026-11-09 13:25:28 +08:00
sjw1231 d212c0629a refactor(plan-mode,user-questions): import HarnessError from dsh-error
PlanModeError is the only base-class use this stack adds to plan-mode,
so the package depends on the dependency-free dsh-error instead of
reaching the base through dsh-llm; the user-questions test that builds
a foreign HarnessError imports it from dsh-error as a dev dependency.

Refs #7869
2026-11-06 16:46:33 +08:00
sjw1231 80c3a3fe09 refactor(plan-mode): keep the code list off the plugin entry
The plugin entry exports only the PlanModeError class and its code type;
the code list stays module-local in src/error.ts, so the entry adds no
value export that verify-plugin-entry-exports would reject.

Refs #7869
2026-11-06 16:46:32 +08:00
sjw1231 fdd2dcc7e8 feat(plan-mode): add PlanModeError for exit_plan_mode failures
exit_plan_mode threw plain Errors, so its most common failure, the user
choosing to keep planning, reached tool/result without an error.code.
PlanModeError carries PLAN_NOT_ACTIVE, PLAN_REVIEW_INTERRUPTED, and
PLAN_REVISION_REQUESTED. A plan without a leading heading is a
ToolArgsError, and a missing caller, user-questions channel, or
projection reader is a ToolContextUnavailableError.

Refs #7869
2026-11-06 16:46:32 +08:00