{"record":{"id":"881facfebdb56683","repo":"can1357/oh-my-pi","slug":"this-extension-host-does-not-support-service-tier","errorCode":null,"errorMessage":"This extension host does not support service-tier actions","messagePattern":"This extension host does not support service-tier actions","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/extensibility/extensions/runner.ts","lineNumber":90,"sourceCode":"\tUserBashEvent,\n\tUserBashEventResult,\n\tUserPythonEvent,\n\tUserPythonEventResult,\n} from \"./types\";\n\n/** Combined result from all before_agent_start handlers */\ninterface BeforeAgentStartCombinedResult {\n\tmessages?: NonNullable<BeforeAgentStartEventResult[\"message\"]>[];\n\tsystemPrompt?: string[];\n}\n\nexport type ExtensionErrorListener = (error: ExtensionError) => void;\n\nexport const EXTENSION_HANDLER_TIMEOUT_MS = 30_000;\nlet extensionHandlerTimeoutMs = EXTENSION_HANDLER_TIMEOUT_MS;\n\nfunction throwUnsupportedServiceTierAction(): never {\n\tthrow new Error(\"This extension host does not support service-tier actions\");\n}\n\nexport function testSetExtensionHandlerTimeoutMs(timeoutMs: number): void {\n\textensionHandlerTimeoutMs = timeoutMs;\n}\n\nfunction normalizeHandlerTimeout(timeoutMs: number): number {\n\treturn Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : EXTENSION_HANDLER_TIMEOUT_MS;\n}\n\n/**\n * Dedicated cap for `session_shutdown` handlers. The generic 30s budget is\n * appropriate for events extensions can observe (e.g. `session_start`,\n * `before_provider_request`), but `session_shutdown` is fire-and-forget\n * teardown — extensions receive no result and the user has already asked to\n * leave. A hung handler (e.g. an extension waiting on a stuck IPC pipe to a\n * companion app) MUST NOT hold Ctrl+C / `/exit` hostage for the full window.\n * See issue #2600.","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/extensibility/extensions/runner.ts#L72-L108","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Feature-detect before calling: check the host's supported capabilities/hasServiceTier flag if exposed, and skip tier logic otherwise.","Wrap service-tier calls in try-catch and degrade gracefully when the host lacks support.","Run the extension only in hosts that implement service-tier actions, or update the host to provide them."],"exampleFix":"// before\nruntime.setServiceTier(family, tier);\n// after\ntry {\n  runtime.setServiceTier(family, tier);\n} catch (err) {\n  if (err.message.includes('service-tier actions')) return; // host unsupported\n  throw err;\n}","handlingStrategy":"try-catch","validationCode":"if (hostCapabilities?.serviceTier === true) {\n  runtime.setServiceTier(family, tier);\n}","typeGuard":"function supportsServiceTiers(rt: IExtensionRuntime): boolean {\n  return typeof rt.setServiceTier === 'function' && rt.serviceTierSupported === true;\n}","tryCatchPattern":"try {\n  runtime.setServiceTier(family, tier);\n} catch (err) {\n  if (err.message.includes('service-tier actions')) {\n    logger.debug('host lacks service-tier support, skipping');\n    return;\n  }\n  throw err;\n}","preventionTips":["Treat service tiers as an optional capability; always wrap calls.","Document which hosts your extension requires and fail fast at load otherwise.","Feature-detect via a capabilities API where available instead of hardcoding host assumptions.","Re-check capability assumptions when embedding the runtime in new hosts or after version upgrades."],"tags":["capability","extensions","service-tier"],"backgroundTag":"unsupported-operation","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}