Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(kiro): expose and apply thinking levels (MUL-8595) (#9925)
Bohan Jiang0d63bfc6556c
diff --git a/apps/docs/content/docs/providers.mdx b/apps/docs/content/docs/providers.mdxindex 89d4cb0a83..42e00f0dc7 100644--- a/apps/docs/content/docs/providers.mdx+++ b/apps/docs/content/docs/providers.mdx@@ -63,6 +63,8 @@ When you create an agent, the model list comes from the corresponding runtime. SIf you do not pick a model, Multica uses the tool's own default. If the list is empty, confirm the runtime is online and the tool is signed in, then refresh the model list.+For Kiro CLI, the **Thinking** picker in agent creation and settings lists the effort levels advertised for the selected model. The choice applies to new and resumed sessions. Leave it unset to use Kiro's own effort setting. Models or CLI versions that return no effort options keep the picker hidden.+Devin's picker lists the model choices advertised by its ACP session. Choose a canonical model ID, an unambiguous session model name or catalog family slug/alias (such as `opus`), or leave the model empty for the CLI default. Family aliases that require `devin models list` can still require a saved CLI login; if alias resolution fails, select a model ID from the picker. Multica confirms the actual session model before sending the prompt; a fallback to another family is rejected. Ambiguous names, arbitrary partial names, or unavailable variants require a canonical ID rather than a guessed match. Usage is attributed to the reported model, not the launch flag. Adaptive usage stays under the reported Adaptive routing ID, not an inferred underlying model.Devin reads `WINDSURF_API_KEY` when set, otherwise the login saved by `devin auth login`; unknown ACP auth methods do not block that stored login. Model discovery uses the daemon user's credentials: a key set only in an agent's custom environment is unavailable to the runtime model picker. An empty session model list prompts you to check those credentials and your team's model allowlist. Multica preserves Devin's configured session mode rather than raising permissions. If it defaults to `plan`, switch to an editing mode in Devin before dispatching work that must change files.diff --git a/apps/docs/content/docs/providers.zh.mdx b/apps/docs/content/docs/providers.zh.mdxindex e6a7f17e8d..a0c327f3e3 100644--- a/apps/docs/content/docs/providers.zh.mdx+++ b/apps/docs/content/docs/providers.zh.mdx@@ -67,6 +67,8 @@ Devin 优先读取 `WINDSURF_API_KEY`,否则使用 `devin auth login` 保存不选择模型时,Multica 使用该工具的默认设置。列表为空时,先确认运行时在线并且工具已经登录,再刷新模型列表。+使用 Kiro CLI 时,创建和设置智能体页面中的**思考**选项来自所选模型支持的 effort 档位,选择会应用到新建和恢复的会话。不选择时沿用 Kiro 自身的 effort 设置。模型或 CLI 版本未返回 effort 选项时,不显示该选择器。+QwenPaw、MiniMax Code 和 ZeroClaw 例外:它们不接受在 Multica 侧选择的模型,选择框不可用,显示为"由运行时管理",模型要在工具自身的配置里选。它们的模型列表为空是正常的,不表示运行时离线。DeepSeek Harness 的模型目录由运行时自身提供(`dsh --profile multica --list-models`)。它的模型 id 采用 `provider/model` 形式(例如 `deepseek-official/deepseek-chat`),请从列表中选择完整 id。diff --git a/packages/views/agents/components/inspector/thinking-prop-row.test.tsx b/packages/views/agents/components/inspector/thinking-prop-row.test.tsxindex 24fa9a9f1e..4033c1c84b 100644--- a/packages/views/agents/components/inspector/thinking-prop-row.test.tsx+++ b/packages/views/agents/components/inspector/thinking-prop-row.test.tsx@@ -152,6 +152,31 @@ describe("ThinkingPropRow", () => {cleanup();});+ it("offers Kiro's discovered effort levels and saves the selected token", async () => {+ mockInitiateListModels.mockResolvedValue(listResult([{+ id: "claude-opus-4.7",+ label: "claude-opus-4.7",+ default: true,+ thinking: {+ supported_levels: [+ { value: "low", label: "Low" },+ { value: "xhigh", label: "Xhigh" },+ { value: "max", label: "Max" },+ ],+ default_level: "xhigh",+ },+ }]));+ const { onChange } = renderRow({+ provider: "kiro",+ model: "claude-opus-4.7",+ });++ await screen.findByText("Thinking");+ fireEvent.click(screen.getByRole("button"));+ fireEvent.click(await screen.findByText("Max"));+ expect(onChange).toHaveBeenCalledWith("max");+ });+it("offers discovered OpenCode variants and emits the native token for saving", async () => {mockInitiateListModels.mockResolvedValue(listResult([{id: "opencode-go/deepseek-v4.1-flash",diff --git a/packages/views/agents/create/agent-execution-overrides.test.tsx b/packages/views/agents/create/agent-execution-overrides.test.tsxindex dafe223a37..992b9d83e5 100644--- a/packages/views/agents/create/agent-execution-overrides.test.tsx+++ b/packages/views/agents/create/agent-execution-overrides.test.tsx@@ -122,6 +122,32 @@ describe("AgentExecutionOverrides", () => {afterEach(cleanup);+ it("offers Kiro effort during agent creation", async () => {+ const model: RuntimeModel = {+ id: "claude-opus-4.7",+ label: "claude-opus-4.7",+ thinking: {+ supported_levels: [+ { value: "high", label: "High" },+ { value: "max", label: "Max" },+ ],+ default_level: "high",+ },+ };+ mockInitiateListModels.mockResolvedValue(listResult([model]));+ const { onChange } = renderOverrides({+ runtime: { ...ONLINE_RUNTIME, provider: "kiro" },+ draft: { ...baseDraft, model: model.id },+ });++ await screen.findByText("Thinking");+ fireEvent.click(screen.getByRole("button", { name: /thinking/i }));+ fireEvent.click(await screen.findByText("Max"));+ expect(onChange).toHaveBeenCalledWith(+ expect.objectContaining({ model: model.id, thinkingLevel: "max" }),+ );+ });+it("prefills ZCode's advertised reasoning level without changing other providers", async () => {const model: RuntimeModel = {id: "desktop/glm", label: "GLM",diff --git a/server/pkg/agent/kiro.go b/server/pkg/agent/kiro.goindex 85d22ccbc1..292e7a96b0 100644--- a/server/pkg/agent/kiro.go+++ b/server/pkg/agent/kiro.go@@ -6,6 +6,7 @@ import ("errors""fmt""io"+ "maps""os/exec""strings""sync"@@ -130,7 +131,13 @@ func (b *kiroBackend) Execute(ctx context.Context, prompt string, opts ExecOptiotimeout := opts.TimeoutrunCtx, cancel := runContext(ctx, timeout)- kiroArgs := append([]string{"acp", "--trust-all-tools"}, filterCustomArgs(opts.CustomArgs, kiroBlockedArgs, b.cfg.Logger)...)+ blockedArgs := kiroBlockedArgs+ if opts.ThinkingLevel != "" {+ // Preserve custom effort unless a structured override takes precedence.+ blockedArgs = maps.Clone(kiroBlockedArgs)+ blockedArgs["--effort"] = blockedWithValue+ }+ kiroArgs := append([]string{"acp", "--trust-all-tools"}, filterCustomArgs(opts.CustomArgs, blockedArgs, b.cfg.Logger)...)cmd := b.cfg.commandAt(execPath).exec(runCtx, kiroArgs...)hideAgentWindow(cmd)b.cfg.logAgentCommand(cmd, newAgentCommandLogArgs(kiroArgs, trustAgentCommandPositional(0, "acp")))@@ -408,14 +415,20 @@ func (b *kiroBackend) Execute(ctx context.Context, prompt string, opts ExecOptiosupplements.mu.Unlock()b.cfg.Logger.Info("kiro session created", "session_id", sessionID)- if opts.Model != "" {+ modelToSet := opts.Model+ // Kiro 2.34 can return a default model before loading its reasoning+ // schema. Selecting that same model initializes effort support.+ if modelToSet == "" && opts.ThinkingLevel != "" {+ modelToSet = effectiveModel+ }+ if modelToSet != "" {if _, err := c.request(runCtx, "session/set_model", map[string]any{"sessionId": sessionID,- "modelId": opts.Model,+ "modelId": modelToSet,}); err != nil {- b.cfg.Logger.Warn("kiro set_session_model failed", "error", err, "requested_model", opts.Model)+ b.cfg.Logger.Warn("kiro set_session_model failed", "error", err, "requested_model", modelToSet)finalStatus = "failed"- finalError = fmt.Sprintf("kiro could not switch to model %q: %v", opts.Model, err)+ finalError = fmt.Sprintf("kiro could not switch to model %q: %v", modelToSet, err)if setupFailureWithholdsSessionID(opts) {sessionID = ""} else if isACPSessionNotFound(err) {@@ -439,9 +452,11 @@ func (b *kiroBackend) Execute(ctx context.Context, prompt string, opts ExecOptio}return}- b.cfg.Logger.Info("kiro session model set", "model", opts.Model)+ b.cfg.Logger.Info("kiro session model set", "model", modelToSet)}+ applyKiroEffort(runCtx, c.request, b.cfg.Logger, sessionID, opts.ThinkingLevel)+userText := promptif opts.SystemPrompt != "" {userText = opts.SystemPrompt + "\n\n---\n\n" + promptdiff --git a/server/pkg/agent/kiro_effort.go b/server/pkg/agent/kiro_effort.gonew file mode 100644index 0000000000..be3728d7fb--- /dev/null+++ b/server/pkg/agent/kiro_effort.go@@ -0,0 +1,103 @@+package agent++import (+ "context"+ "encoding/json"+ "log/slog"+ "strings"+)++// Kiro CLI v2 exposes reasoning metadata through the same model options+// extension its TUI uses, rather than ACP configOptions. Observed on 2.34.0.+func enrichKiroModelThinking(ctx context.Context, request acpRequestFn, models []Model, session json.RawMessage) {+ sessionID := extractACPSessionID(session)+ if sessionID == "" {+ return+ }+ raw, err := request(ctx, "_kiro.dev/commands/options", map[string]any{+ "sessionId": sessionID,+ "command": "model",+ })+ if err != nil {+ return+ }+ thinking, err := parseKiroModelThinking(raw)+ if err != nil {+ return+ }+ for i := range models {+ models[i].Thinking = thinking[models[i].ID]+ }+}++func parseKiroModelThinking(raw json.RawMessage) (map[string]*ModelThinking, error) {+ var result struct {+ Options []struct {+ Value string `json:"value"`+ Reasoning struct {+ EffortLevels []string `json:"effortLevels"`+ DefaultEffort string `json:"defaultEffort"`+ } `json:"reasoning"`+ } `json:"options"`+ }+ if err := json.Unmarshal(raw, &result); err != nil {+ return nil, err+ }+ byModel := make(map[string]*ModelThinking)+ for _, option := range result.Options {+ id := strings.TrimSpace(option.Value)+ if id == "" {+ continue+ }+ thinking := &ModelThinking{}+ seen := make(map[string]bool)+ for _, value := range option.Reasoning.EffortLevels {+ value = strings.TrimSpace(value)+ // `default` is an internal schema value, not a selectable effort.+ if value == "" || value == "default" || seen[value] || !isValidDynamicThinkingValue(value) {+ continue+ }+ seen[value] = true+ thinking.SupportedLevels = append(thinking.SupportedLevels, ThinkingLevel{+ Value: value,+ Label: strings.Title(value), //nolint:staticcheck+ })+ }+ if len(thinking.SupportedLevels) == 0 {+ continue+ }+ if value := strings.TrimSpace(option.Reasoning.DefaultEffort); seen[value] {+ thinking.DefaultLevel = value+ }+ byModel[id] = thinking+ }+ return byModel, nil+}++// Apply to the live session after model selection, including resumed sessions.+// The effort command changes this session without saving a CLI-wide default.+func applyKiroEffort(ctx context.Context, request acpRequestFn, logger *slog.Logger, sessionID, level string) {+ if level == "" {+ return+ }+ raw, err := request(ctx, "_kiro.dev/commands/execute", map[string]any{+ "sessionId": sessionID,+ "command": map[string]any{+ "command": "effort",+ "args": map[string]any{"level": level},+ },+ })+ var result struct {+ Success bool `json:"success"`+ Message string `json:"message"`+ }+ if err == nil {+ err = json.Unmarshal(raw, &result)+ }+ if err != nil || !result.Success {+ logger.Warn("kiro did not apply the requested reasoning effort; sending the prompt anyway",+ "requested_level", level, "error", err, "message", result.Message)+ return+ }+ logger.Info("kiro session reasoning effort applied", "level", level)+}diff --git a/server/pkg/agent/kiro_effort_test.go b/server/pkg/agent/kiro_effort_test.gonew file mode 100644index 0000000000..19931ea3cb--- /dev/null+++ b/server/pkg/agent/kiro_effort_test.go@@ -0,0 +1,259 @@+package agent++import (+ "context"+ "encoding/json"+ "log/slog"+ "os"+ "path/filepath"+ "reflect"+ "runtime"+ "strings"+ "testing"+ "time"+)++const kiroEffortModelOptions = `{"options":[+ {"value":"claude-opus-4.7","reasoning":{"thinking":"alwaysOn","effortLevels":["low","medium","high","xhigh","max"],"defaultEffort":"high"}},+ {"value":"gpt-5.6-sol","reasoning":{"effortLevels":["none","high","max"],"defaultEffort":"high"}},+ {"value":"claude-haiku-4.5","reasoning":{"effortLevels":[]}},+ {"value":"internal-default","reasoning":{"effortLevels":["default"]}}+],"hasMore":false}`++func TestParseKiroModelThinking(t *testing.T) {+ t.Parallel()+ got, err := parseKiroModelThinking(json.RawMessage(kiroEffortModelOptions))+ if err != nil {+ t.Fatal(err)+ }+ if len(got) != 2 {+ t.Fatalf("models with effort = %v, want only Opus and Sol", got)+ }+ if levels := thinkingValues(got["claude-opus-4.7"]); !reflect.DeepEqual(levels, []string{"low", "medium", "high", "xhigh", "max"}) {+ t.Errorf("Opus effort = %v", levels)+ }+ if levels := thinkingValues(got["gpt-5.6-sol"]); !reflect.DeepEqual(levels, []string{"none", "high", "max"}) {+ t.Errorf("Sol effort = %v", levels)+ }+ for id, thinking := range got {+ if thinking.DefaultLevel != "high" {+ t.Errorf("%s default = %q, want high", id, thinking.DefaultLevel)+ }+ for _, level := range thinking.SupportedLevels {+ if !IsKnownThinkingValue("kiro", level.Value) {+ t.Errorf("advertised Kiro effort %q cannot be saved", level.Value)+ }+ }+ }+ cleaned, err := parseKiroModelThinking(json.RawMessage(`{"options":[{"value":"m","reasoning":{"effortLevels":["","default","low","low","bad value","future-level"],"defaultEffort":"missing"}}]}`))+ if err != nil {+ t.Fatal(err)+ }+ if levels := thinkingValues(cleaned["m"]); !reflect.DeepEqual(levels, []string{"low", "future-level"}) || cleaned["m"].DefaultLevel != "" {+ t.Errorf("cleaned catalog = %+v", cleaned["m"])+ }+ if _, err := parseKiroModelThinking(json.RawMessage(`{"options":"invalid"}`)); err == nil {+ t.Error("malformed options must not produce a catalog")+ }+}++func TestDiscoverKiroModelsIncludesPerModelEffort(t *testing.T) {+ if runtime.GOOS == "windows" {+ t.Skip("fake CLI is a shell script")+ }+ t.Parallel()+ for _, tc := range []struct {+ name string+ response string+ wantLevel bool+ }{+ {"native catalog", `"result":` + kiroEffortModelOptions, true},+ {"older CLI", `"error":{"code":-32601,"message":"Method not found"}`, false},+ {"malformed metadata", `"result":{"options":"invalid"}`, false},+ } {+ t.Run(tc.name, func(t *testing.T) {+ response := strings.ReplaceAll(tc.response, "\n", "")+ script := `#!/bin/sh+while IFS= read -r line; do+ id=$(printf '%s' "$line" | sed -n 's/.*"id":\([0-9]*\).*/\1/p')+ case "$line" in+ *'"method":"initialize"'*)+ printf '{"jsonrpc":"2.0","id":%s,"result":{"protocolVersion":1}}\n' "$id" ;;+ *'"method":"session/new"'*)+ printf '{"jsonrpc":"2.0","id":%s,"result":{"sessionId":"discovery","models":{"currentModelId":"gpt-5.6-sol","availableModels":[{"modelId":"claude-opus-4.7"},{"modelId":"gpt-5.6-sol"},{"modelId":"claude-haiku-4.5"},{"modelId":"unknown"}]}}}\n' "$id" ;;+ *'"method":"_kiro.dev/commands/options"'*)+ case "$line" in+ *'"command":"model"'*'"sessionId":"discovery"'*)+ printf '{"jsonrpc":"2.0","id":%s,` + response + `}\n' "$id" ;;+ *) exit 1 ;;+ esac ;;+ esac+done+`+ fake := filepath.Join(t.TempDir(), "kiro-cli")+ writeTestExecutable(t, fake, []byte(script))+ catalog, err := ListModels(context.Background(), "kiro", Command{Path: fake})+ if err != nil {+ t.Fatal(err)+ }+ if len(catalog.Models) != 4 || !catalog.Verified() {+ t.Fatalf("catalog = %+v, want four discovered models", catalog)+ }+ for i, model := range catalog.Models {+ wantThinking := tc.wantLevel && i < 2+ if (model.Thinking != nil) != wantThinking {+ t.Errorf("%s thinking = %+v, want present %v", model.ID, model.Thinking, wantThinking)+ }+ }+ if tc.wantLevel {+ for _, check := range []struct {+ model, level string+ want bool+ }{+ {"claude-opus-4.7", "xhigh", true},+ {"gpt-5.6-sol", "none", true},+ {"gpt-5.6-sol", "xhigh", false},+ {"claude-haiku-4.5", "high", false},+ {"", "none", true},+ } {+ got, err := ValidateThinkingLevelWith(func() (Catalog, error) { return catalog, nil }, "kiro", check.model, check.level)+ if err != nil || got != check.want {+ t.Errorf("validate(%q, %q) = %v, %v; want %v", check.model, check.level, got, err, check.want)+ }+ }+ }+ })+ }+}++func TestKiroBackendAppliesEffortBeforePrompt(t *testing.T) {+ if runtime.GOOS == "windows" {+ t.Skip("fake CLI is a shell script")+ }+ t.Parallel()+ for _, tc := range []struct {+ name, model, resume, level, response, warning string+ customArgs []string+ }{+ {name: "fresh", model: "auto", level: "max", response: `"result":{"success":true}`},+ {name: "resumed", model: "auto", resume: "ses_loaded", level: "low", response: `"result":{"success":true}`},+ {name: "default model", level: "max", response: `"result":{"success":true}`},+ {name: "resumed without model override", resume: "ses_loaded", level: "low", response: `"result":{"success":true}`},+ {name: "runtime default", customArgs: []string{}},+ {name: "custom effort separate value", customArgs: []string{"--effort", "high"}},+ {name: "custom effort inline value", customArgs: []string{"--effort=low"}},+ {name: "resumed custom effort", resume: "ses_loaded", customArgs: []string{"--effort", "high"}},+ {name: "rejected", level: "max", response: `"result":{"success":false,"message":"unsupported effort"}`, warning: "unsupported effort"},+ {name: "unsupported command", level: "high", response: `"error":{"code":-32601,"message":"Method not found"}`, warning: "Method not found"},+ {name: "unconfirmed", level: "high", response: `"result":{}`, warning: "did not apply"},+ } {+ t.Run(tc.name, func(t *testing.T) {+ dir := t.TempDir()+ requestsFile := filepath.Join(dir, "requests.jsonl")+ argsFile := filepath.Join(dir, "args.txt")+ fake := filepath.Join(dir, "kiro-cli")+ script := strings.Replace(fakeKiroACPScript(), ` *'"method":"session/prompt"'*)`, ` *'"method":"_kiro.dev/commands/execute"'*)+ printf '{"jsonrpc":"2.0","id":%s,`+tc.response+`}\n' "$id"+ ;;+ *'"method":"session/prompt"'*)`, 1)+ writeTestExecutable(t, fake, []byte(script))+ var logs strings.Builder+ backend, err := New("kiro", Config{+ ExecutablePath: fake,+ Logger: slog.New(slog.NewTextHandler(&logs, nil)),+ Env: map[string]string{+ "KIRO_REQUESTS_FILE": requestsFile,+ "KIRO_ARGS_FILE": argsFile,+ },+ })+ if err != nil {+ t.Fatal(err)+ }+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)+ defer cancel()+ customArgs := tc.customArgs+ if customArgs == nil {+ customArgs = []string{"--effort", "high", "--effort=low"}+ }+ session, err := backend.Execute(ctx, "task", ExecOptions{+ ResumeSessionID: tc.resume,+ Model: tc.model,+ ThinkingLevel: tc.level,+ Timeout: 5 * time.Second,+ CustomArgs: customArgs,+ })+ if err != nil {+ t.Fatal(err)+ }+ for range session.Messages {+ }+ result := <-session.Result+ if result.Status != "completed" {+ t.Fatalf("result = %+v", result)+ }+ if tc.warning != "" && !strings.Contains(logs.String(), tc.warning) {+ t.Errorf("missing diagnostic %q in %s", tc.warning, logs.String())+ }+ argv, err := os.ReadFile(argsFile)+ if err != nil {+ t.Fatal(err)+ }+ wantArgs := []string{"acp", "--trust-all-tools"}+ if tc.level == "" {+ wantArgs = append(wantArgs, customArgs...)+ }+ if got := strings.Split(strings.TrimSpace(string(argv)), "\n"); !reflect.DeepEqual(got, wantArgs) {+ t.Errorf("launch args = %q, want %q", got, wantArgs)+ }+ raw, err := os.ReadFile(requestsFile)+ if err != nil {+ t.Fatal(err)+ }+ var methods []string+ for _, line := range strings.Split(strings.TrimSpace(string(raw)), "\n") {+ var request struct {+ Method string `json:"method"`+ Params struct {+ SessionID string `json:"sessionId"`+ ModelID string `json:"modelId"`+ Command struct {+ Command string `json:"command"`+ Args map[string]string `json:"args"`+ } `json:"command"`+ } `json:"params"`+ }+ if err := json.Unmarshal([]byte(line), &request); err != nil {+ t.Fatal(err)+ }+ methods = append(methods, request.Method)+ if request.Method == "session/set_model" && request.Params.ModelID != "auto" {+ t.Errorf("model selection did not initialize the effective model: %s", line)+ }+ if request.Method == "_kiro.dev/commands/execute" {+ wantID := "ses_new"+ if tc.resume != "" {+ wantID = tc.resume+ }+ if request.Params.SessionID != wantID || request.Params.Command.Command != "effort" || request.Params.Command.Args["level"] != tc.level {+ t.Errorf("effort request = %s", line)+ }+ }+ }+ setup := "session/new"+ if tc.resume != "" {+ setup = "session/load"+ }+ want := []string{"initialize", setup}+ if tc.model != "" || tc.resume == "" && tc.level != "" {+ want = append(want, "session/set_model")+ }+ if tc.level != "" {+ want = append(want, "_kiro.dev/commands/execute")+ }+ want = append(want, "session/prompt")+ if !reflect.DeepEqual(methods, want) {+ t.Errorf("methods = %v, want %v", methods, want)+ }+ })+ }+}diff --git a/server/pkg/agent/models.go b/server/pkg/agent/models.goindex df66ade37a..ece626f69e 100644--- a/server/pkg/agent/models.go+++ b/server/pkg/agent/models.go@@ -1956,6 +1956,7 @@ func discoverKiroModels(ctx context.Context, runtimeCmd Command) ([]Model, errordefaultBin: "kiro-cli",clientName: "multica-model-discovery",tmpdirPrefix: "multica-kiro-discovery-",+ enrich: enrichKiroModelThinking,})}@@ -2058,6 +2059,9 @@ type acpDiscoveryProvider struct {// ignores. CodeBuddy uses it to read its effort catalog out of the same// handshake, which is why it needs no separate discovery call at all.annotate func([]Model, json.RawMessage)+ // enrich reads provider-specific metadata through the same discovery+ // session when session/new does not include model capabilities.+ enrich func(context.Context, acpRequestFn, []Model, json.RawMessage)// probeModelEffort switches the throwaway session onto each non-current// model to read that model's own effort catalog; see probeACPModelEffort.probeModelEffort bool@@ -2290,6 +2294,11 @@ func discoverACPModels(ctx context.Context, runtimeCmd Command, p acpDiscoveryPrif p.annotate != nil {p.annotate(models, sessionResult)}+ if p.enrich != nil {+ p.enrich(runCtx, func(_ context.Context, method string, params any) (json.RawMessage, error) {+ return requestACP(method, params)+ }, models, sessionResult)+ }if p.probeModelEffort {probeACPModelEffort(runCtx, func(_ context.Context, method string, params any) (json.RawMessage, error) {return requestACP(method, params)diff --git a/server/pkg/agent/thinking.go b/server/pkg/agent/thinking.goindex 39bf4645ce..f0f67065fa 100644--- a/server/pkg/agent/thinking.go+++ b/server/pkg/agent/thinking.go@@ -1000,7 +1000,10 @@ var thinkingDynamicCatalogProviders = map[string]bool{"grok": true,"opencode": true,"kimi": true,- "zcode": true,+ // Kiro's model command options advertise per-model effortLevels. Its+ // native effort command applies the override to fresh and loaded sessions.+ "kiro": true,+ "zcode": true,}// acpCatalogThinkingProviders are the ACP runtimes that discover their effortdiff --git a/server/pkg/agent/thinking_test.go b/server/pkg/agent/thinking_test.goindex 35b11a1f6c..014ed88e65 100644--- a/server/pkg/agent/thinking_test.go+++ b/server/pkg/agent/thinking_test.go@@ -748,6 +748,12 @@ func TestIsKnownThinkingValue(t *testing.T) {{"kimi", "future-level", true}, // exact support is checked against the daemon catalog{"kimi", ".hidden", false},{"kimi", "bad value", false},+ {"kiro", "", true},+ {"kiro", "none", true},+ {"kiro", "max", true},+ {"kiro", "future-level", true},+ {"kiro", ".hidden", false},+ {"kiro", "bad value", false},{"hermes", "", true},// jcode runs under this provider and applies an advertised effort;// Hermes Agent advertises none. The per-session catalog decides, so the@@ -791,6 +797,7 @@ func TestThinkingControlSupported(t *testing.T) {{"omp", true}, // pi backend identity; per-model subset from `omp models --json`{"hermes", true}, // jcode applies it; Hermes Agent gets an empty catalog{"kimi", true}, // dynamic catalog; ACP session/set_config_option applies it+ {"kiro", true}, // native model options and session effort command{"qwenpaw", false},{"", false},{"not-a-runtime", false},@@ -809,7 +816,7 @@ func TestThinkingControlSupported(t *testing.T) {// reject a level while claiming the runtime supports one, or vice versa.func TestThinkingControlSupportedMatchesTokenGate(t *testing.T) {t.Parallel()- providers := []string{"claude", "codebuddy", "grok", "codex", "opencode", "pi", "omp", "hermes", "kimi", "cursor"}+ providers := []string{"claude", "codebuddy", "grok", "codex", "opencode", "pi", "omp", "hermes", "kimi", "kiro", "cursor"}// "medium" is in every fixed enum and is a well-formed dynamic token, so a// provider with any reasoning control accepts it.for _, provider := range providers {