can1357/oh-my-pi · error · Error

This extension host does not support service-tier actions

Error message

This extension host does not support service-tier actions

What it means

Extension host capability gating: throwUnsupportedServiceTierAction is the shared 'never' thrower used when a host implementation does not provide service-tier actions. An extension calling service-tier APIs on such a host gets this Error, since the host cannot fulfill the request.

Source

Thrown at packages/coding-agent/src/extensibility/extensions/runner.ts:90

	UserBashEvent,
	UserBashEventResult,
	UserPythonEvent,
	UserPythonEventResult,
} from "./types";

/** Combined result from all before_agent_start handlers */
interface BeforeAgentStartCombinedResult {
	messages?: NonNullable<BeforeAgentStartEventResult["message"]>[];
	systemPrompt?: string[];
}

export type ExtensionErrorListener = (error: ExtensionError) => void;

export const EXTENSION_HANDLER_TIMEOUT_MS = 30_000;
let extensionHandlerTimeoutMs = EXTENSION_HANDLER_TIMEOUT_MS;

function throwUnsupportedServiceTierAction(): never {
	throw new Error("This extension host does not support service-tier actions");
}

export function testSetExtensionHandlerTimeoutMs(timeoutMs: number): void {
	extensionHandlerTimeoutMs = timeoutMs;
}

function normalizeHandlerTimeout(timeoutMs: number): number {
	return Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : EXTENSION_HANDLER_TIMEOUT_MS;
}

/**
 * Dedicated cap for `session_shutdown` handlers. The generic 30s budget is
 * appropriate for events extensions can observe (e.g. `session_start`,
 * `before_provider_request`), but `session_shutdown` is fire-and-forget
 * teardown — extensions receive no result and the user has already asked to
 * leave. A hung handler (e.g. an extension waiting on a stuck IPC pipe to a
 * companion app) MUST NOT hold Ctrl+C / `/exit` hostage for the full window.
 * See issue #2600.

View on GitHub (pinned to 9690622007)

Solutions

  1. Feature-detect before calling: check the host's supported capabilities/hasServiceTier flag if exposed, and skip tier logic otherwise.
  2. Wrap service-tier calls in try-catch and degrade gracefully when the host lacks support.
  3. Run the extension only in hosts that implement service-tier actions, or update the host to provide them.

Example fix

// before
runtime.setServiceTier(family, tier);
// after
try {
  runtime.setServiceTier(family, tier);
} catch (err) {
  if (err.message.includes('service-tier actions')) return; // host unsupported
  throw err;
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (hostCapabilities?.serviceTier === true) {
  runtime.setServiceTier(family, tier);
}

Type guard

function supportsServiceTiers(rt: IExtensionRuntime): boolean {
  return typeof rt.setServiceTier === 'function' && rt.serviceTierSupported === true;
}

Try / catch

try {
  runtime.setServiceTier(family, tier);
} catch (err) {
  if (err.message.includes('service-tier actions')) {
    logger.debug('host lacks service-tier support, skipping');
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: An extension calls getServiceTiers()/setServiceTier() through an IExtensionRuntime whose concrete host (e.g. a minimal runner, RPC host, or embedded host) wires service-tier methods to throwUnsupportedServiceTierAction.

Common situations: Extension written for the full CLI host is loaded into a lightweight/embedded host that lacks service-tier support; capability matrix changed between versions and code assumes service tiers exist everywhere.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/881facfebdb56683. Report an issue: GitHub.