mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-25 05:07:05 +00:00
feat(kimi): thinking level selection for remote sessions (#2349)
* feat(kimi): thinking level selection for remote sessions Kimi Code's ACP session advertises the active model's thinking levels as a thought_level config option (`thinking`: off/on or off plus declared efforts). Expose it like Grok's effort: a session RPC + hub route for the options, the composer effort picker, and per-turn session/set_config_option in the remote launcher. The runner forwards --effort so resumed sessions keep the selection. * fix(kimi): keep thinking options in step with model switches Kimi Code answers session/set_model with no config options and pushes the new model's thought_level via config_option_update; capture it (opt-in in the ACP backend, same hunk as #2348), re-baseline the launcher's level after a switch, report 'switch pending' until the next turn applies it, and have the web poll until discovery succeeds. * fix(kimi): gate thinking discovery on the model the backend applied Compare the model the next queued turn carries with the backend's model instead of session state, so an older queued batch or a failed switch keeps discovery pending; forward the saved effort on terminal resume.
This commit is contained in:
@@ -1052,6 +1052,9 @@ export type GrokReasoningEffortResponse = {
|
||||
error?: string
|
||||
}
|
||||
|
||||
/** Kimi's ACP `thought_level` (`thinking`) option for the active model. */
|
||||
export type KimiReasoningEffortResponse = GrokReasoningEffortResponse
|
||||
|
||||
export type OpencodeReasoningEffortOption = {
|
||||
value: string
|
||||
name?: string
|
||||
|
||||
@@ -53,9 +53,9 @@ describe('hasCapability', () => {
|
||||
expect(hasCapability('pi', Capabilities.Effort)).toBe(true)
|
||||
})
|
||||
|
||||
test('kimi supports model-change but not effort', () => {
|
||||
test('kimi supports model-change and effort', () => {
|
||||
expect(hasCapability('kimi', Capabilities.ModelChange)).toBe(true)
|
||||
expect(hasCapability('kimi', Capabilities.Effort)).toBe(false)
|
||||
expect(hasCapability('kimi', Capabilities.Effort)).toBe(true)
|
||||
})
|
||||
|
||||
test('copilot supports model-change but not effort', () => {
|
||||
@@ -149,7 +149,7 @@ describe('convenience functions', () => {
|
||||
expect(supportsEffort('gemini')).toBe(false)
|
||||
expect(supportsEffort('pi')).toBe(true)
|
||||
expect(supportsEffort('grok')).toBe(true)
|
||||
expect(supportsEffort('kimi')).toBe(false)
|
||||
expect(supportsEffort('kimi')).toBe(true)
|
||||
expect(supportsEffort(null)).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -13,7 +13,7 @@ const FLAVOR_CAPS: Record<AgentFlavor, ReadonlySet<Capability>> = {
|
||||
agy: new Set([Capabilities.ModelChange, Capabilities.Effort]),
|
||||
claude: new Set([Capabilities.ModelChange, Capabilities.Effort]),
|
||||
gemini: new Set([Capabilities.ModelChange]),
|
||||
kimi: new Set([Capabilities.ModelChange]),
|
||||
kimi: new Set([Capabilities.ModelChange, Capabilities.Effort]),
|
||||
copilot: new Set([Capabilities.ModelChange]),
|
||||
grok: new Set([Capabilities.ModelChange, Capabilities.Effort]),
|
||||
codex: new Set([Capabilities.ModelChange]),
|
||||
|
||||
@@ -51,6 +51,7 @@ export const RPC_METHODS = {
|
||||
ListGrokReasoningEffortOptions: 'listGrokReasoningEffortOptions',
|
||||
ListCopilotModelsForCwd: 'listCopilotModelsForCwd',
|
||||
ListCopilotModels: 'listCopilotModels',
|
||||
ListKimiReasoningEffortOptions: 'listKimiReasoningEffortOptions',
|
||||
ListKimiModelsForCwd: 'listKimiModelsForCwd',
|
||||
ListKimiModels: 'listKimiModels',
|
||||
ListDshModels: 'listDshModels',
|
||||
|
||||
Reference in New Issue
Block a user