can1357/oh-my-pi · error
Unknown ACP thinking level: ${value}
Error message
Unknown ACP thinking level: ${value} What it means
AcpAgent.#setThinkingLevelById validates an incoming ACP session/thinking-level value through parseConfiguredThinkingLevel before applying it to the session. When the string does not map to any configured thinking level, the agent refuses to set it and throws this error so the ACP client learns the request was rejected. It exists to keep unknown or misspelled level identifiers from silently degrading or corrupting session state.
Source
Thrown at packages/coding-agent/src/modes/acp/acp-agent.ts:1818
: session.thinkingLevel;
}
#toThinkingConfigValue(value: string | undefined): string {
return value && value !== "inherit" ? value : THINKING_OFF;
}
async #setModelById(session: AgentSession, modelId: string): Promise<void> {
const model = session.getAvailableModels().find(candidate => this.#toModelId(candidate) === modelId);
if (!model) {
throw new Error(`Unknown ACP model: ${modelId}`);
}
await session.setModel(model);
}
#setThinkingLevelById(session: AgentSession, value: string): void {
const thinkingLevel = parseConfiguredThinkingLevel(value);
if (!thinkingLevel) {
throw new Error(`Unknown ACP thinking level: ${value}`);
}
session.setThinkingLevel(thinkingLevel);
}
#toModelId(model: Model): string {
return `${model.provider}/${model.id}`;
}
#getAvailableModes(session: AgentSession): Array<{ id: string; name: string; description: string }> {
const modes = [{ id: ACP_DEFAULT_MODE_ID, name: "Default", description: "Standard ACP headless mode" }];
if (session.settings.get("plan.enabled")) {
modes.push({
id: ACP_PLAN_MODE_ID,
name: "Plan",
description: "Read-only planning mode that drafts a plan to a markdown file before any code changes",
});
}
void session;View on GitHub (pinned to 9690622007)
Solutions
- Check the value against the configured thinking levels accepted by parseConfiguredThinkingLevel (packages/coding-agent config/thinking-level module) and use exactly one of those strings.
- Update the client/ACP adapter to map its native level names onto the configured level identifiers before calling the session API.
- If the level should be supported, add it to the configured thinking-level aliases so parseConfiguredThinkingLevel resolves it.
Example fix
// before
await agent.setThinkingLevel("ultrathink");
// after
await agent.setThinkingLevel("high"); // a level parseConfiguredThinkingLevel recognizes Defensive patterns
Strategy: validation
Validate before calling
const VALID_LEVELS = new Set(["off", "minimal", "low", "medium", "high", "max"]);
if (!VALID_LEVELS.has(level)) throw new Error(`Unsupported thinking level: ${level}`);
await agent.setThinkingLevel(level); Try / catch
try {
await agent.setThinkingLevel(value);
} catch (err) {
if (err.message.startsWith("Unknown ACP thinking level")) {
logger.warn("falling back to default level", { value });
await agent.setThinkingLevel("medium");
} else throw err;
} Prevention
- Discover the accepted level ids from the agent/config surface instead of hardcoding names.
- Map client-native level names to configured aliases in one place in your adapter.
- Log unknown values with their source so config typos surface quickly.
When it happens
Trigger: Calling the ACP session set-mode / thinking-level RPC (#setThinkingLevelById) with a value string that parseConfiguredThinkingLevel returns null for — e.g. an alias or numeric string the config layer does not recognize.
Common situations: An ACP client (editor plugin) sends a thinking level name from a newer or older spec version; a user hand-edits agent config with a typo like 'hight' or 'max'; a client forwards a raw model-native level name ('high') where only configured aliases are accepted.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Failed to load tree-sitter language: {err}
- sso-token-missing
- sso-token-expired
- Destination option ${key} must be a string
- Destination option ${key} must be a finite number
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/b5ee583c31a083ba.
Report an issue: GitHub.