mirror of
https://github.com/morluto/rea.git
synced 2026-10-27 01:45:32 +00:00
* fix(windows): report missing native launch controls as unavailable capabilities An admitted Windows native artifact may predate the optional protocol stdin or Job Object memory limit controls. WindowsOwnedProcess correctly refused such launches, but threw a plain Error, so providers projected the refusal as execution_failure with generic `rea doctor` advice and left the package remedy in nested diagnostics. Introduce RuntimeControlUnavailableError as the shared owner of expected host-control refusals. PrivateRuntimeRootUnavailableError and the new WindowsNativeControlUnavailableError (which records the missing control) extend it, and the six provider adapters that hand-built the same AnalysisCapabilityUnavailableError now project any subtype through one helper. The refusal still precedes every native launch. Fixes #6050 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(errors): drop capability imports superseded by the shared helper Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import { AnalysisCapabilityUnavailableError } from "../domain/analysisErrorCore.js";
|
|
|
|
/**
|
|
* Expected refusal when a host control required before launch is unavailable.
|
|
*
|
|
* Process-layer owners raise one subtype per control; provider adapters
|
|
* project every subtype through {@link runtimeControlCapabilityError}.
|
|
*/
|
|
export abstract class RuntimeControlUnavailableError extends Error {
|
|
abstract readonly code: string;
|
|
readonly retryable: boolean;
|
|
/** Caller-facing recovery, when the owner knows a specific one. */
|
|
readonly remediationAction: string | undefined;
|
|
|
|
constructor(
|
|
message: string,
|
|
options?: ErrorOptions & {
|
|
readonly retryable?: boolean;
|
|
readonly remediationAction?: string;
|
|
},
|
|
) {
|
|
super(message, options);
|
|
this.retryable = options?.retryable ?? false;
|
|
this.remediationAction = options?.remediationAction;
|
|
}
|
|
}
|
|
|
|
/** Project a host-control refusal as the provider's unavailable capability. */
|
|
export const runtimeControlCapabilityError = (
|
|
providerId: string,
|
|
operation: string,
|
|
cause: RuntimeControlUnavailableError,
|
|
): AnalysisCapabilityUnavailableError =>
|
|
new AnalysisCapabilityUnavailableError(providerId, operation, cause.message, {
|
|
cause,
|
|
retryable: cause.retryable,
|
|
...(cause.remediationAction === undefined
|
|
? {}
|
|
: {
|
|
userMessage: cause.message,
|
|
remediationAction: cause.remediationAction,
|
|
}),
|
|
});
|