mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix(opencode): use ACP-reported reasoning effort options (#853)
* fix(opencode): use ACP-reported reasoning effort options Expose thought_level options from OpenCode ACP to the web UI via RPC/API instead of hardcoded presets, and validate effort values before setConfigOption. Fixes #852 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(opencode): sync hub effort after coerced setConfigOption When resolveThoughtLevelEffort falls back to a different supported value, roll back session state after a successful ACP update so keepalive and the web UI do not keep advertising the rejected effort. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -320,6 +320,18 @@ export type OpencodeModelsResponse = {
|
||||
|
||||
export type ListOpencodeModelsResponse = OpencodeModelsResponse
|
||||
|
||||
export type OpencodeReasoningEffortOption = {
|
||||
value: string
|
||||
name?: string
|
||||
}
|
||||
|
||||
export type OpencodeReasoningEffortResponse = {
|
||||
success: boolean
|
||||
options?: OpencodeReasoningEffortOption[]
|
||||
currentValue?: string | null
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type CursorModelSummary = OpencodeModelSummary
|
||||
|
||||
export type CursorModelsResponse = OpencodeModelsResponse
|
||||
|
||||
@@ -28,7 +28,8 @@ export const RPC_METHODS = {
|
||||
ListCodexModels: 'listCodexModels',
|
||||
ListCursorModels: 'listCursorModels',
|
||||
ListOpencodeModels: 'listOpencodeModels',
|
||||
ListOpencodeModelsForCwd: 'listOpencodeModelsForCwd'
|
||||
ListOpencodeModelsForCwd: 'listOpencodeModelsForCwd',
|
||||
ListOpencodeReasoningEffortOptions: 'listOpencodeReasoningEffortOptions'
|
||||
} as const
|
||||
|
||||
export type RpcMethod = typeof RPC_METHODS[keyof typeof RPC_METHODS]
|
||||
|
||||
Reference in New Issue
Block a user