Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
MUL-5991 feat(agent): enable ACP thinking_level for the hermes provider (jcode) (#6814)
Bohan Jiang740ebdb8ef8e
diff --git a/server/internal/handler/agent.go b/server/internal/handler/agent.goindex 196fb9e5ce..3958e4e82d 100644--- a/server/internal/handler/agent.go+++ b/server/internal/handler/agent.go@@ -1140,6 +1140,19 @@ func (h *Handler) CreateAgent(w http.ResponseWriter, r *http.Request) {writeError(w, http.StatusBadRequest, thinkingLevelRejection(runtime.Provider, req.ThinkingLevel))return}+ // For ACP-catalog providers the provider name is not the capability answer+ // — this runtime's own discovered catalog is. Keeps a Hermes Agent user's+ // clear 400 instead of accepting a level the daemon would later drop.+ if req.ThinkingLevel != "" {+ switch h.acpThinkingDecision(r.Context(), runtime.Provider, runtime.ID) {+ case acpEffortAbsent:+ writeError(w, http.StatusBadRequest, thinkingCapabilityRejection(runtime.Provider))+ return+ case acpEffortUnknown:+ writeError(w, http.StatusBadRequest, thinkingCapabilityUnknownRejection(runtime.Provider))+ return+ }+ }if !agent.IsKnownServiceTier(runtime.Provider, req.ServiceTier) {writeError(w, http.StatusBadRequest, fmt.Sprintf("service_tier %q is not a recognised value for runtime %q", req.ServiceTier, runtime.Provider))return@@ -1730,6 +1743,14 @@ func (h *Handler) UpdateAgent(w http.ResponseWriter, r *http.Request) {writeError(w, http.StatusBadRequest, thinkingLevelRejection(provider, value))return}+ switch h.acpThinkingDecision(r.Context(), provider, targetRuntimeID) {+ case acpEffortAbsent:+ writeError(w, http.StatusBadRequest, thinkingCapabilityRejection(provider))+ return+ case acpEffortUnknown:+ writeError(w, http.StatusBadRequest, thinkingCapabilityUnknownRejection(provider))+ return+ }params.ThinkingLevel = pgtype.Text{String: value, Valid: true}}} else if req.RuntimeID != nil && existing.ThinkingLevel.Valid && existing.ThinkingLevel.String != "" {@@ -1753,6 +1774,14 @@ func (h *Handler) UpdateAgent(w http.ResponseWriter, r *http.Request) {writeError(w, http.StatusBadRequest, existingThinkingLevelRejection(provider, existing.ThinkingLevel.String))return}+ switch h.acpThinkingDecision(r.Context(), provider, targetRuntimeID) {+ case acpEffortAbsent:+ writeError(w, http.StatusBadRequest, existingThinkingCapabilityRejection(provider, existing.ThinkingLevel.String))+ return+ case acpEffortUnknown:+ writeError(w, http.StatusBadRequest, existingThinkingCapabilityUnknownRejection(provider, existing.ThinkingLevel.String))+ return+ }}shouldClearServiceTier := false@@ -1982,24 +2011,123 @@ func (h *Handler) resolveAgentProvider(r *http.Request, workspaceID pgtype.UUID,// so it now names the capability gap instead.func thinkingLevelRejection(provider, value string) string {if !agent.ThinkingControlSupported(provider) {- return fmt.Sprintf(- "runtime %q does not support a per-agent reasoning effort; leave thinking_level empty to use the runtime default",- provider,- )+ return thinkingCapabilityRejection(provider)}return fmt.Sprintf("thinking_level %q is not a recognised value for runtime %q", value, provider)}+// existingThinkingCapabilityRejection is the carry-over path's capability+// sentence — same answer as thinkingCapabilityRejection, but it names the value+// already on the agent and the escape hatch that clears it.+func existingThinkingCapabilityRejection(provider, value string) string {+ return fmt.Sprintf(+ "runtime %q does not support a per-agent reasoning effort; pass thinking_level=\"\" to clear the existing %q",+ provider, value,+ )+}++// thinkingCapabilityUnknownRejection covers the ambiguous case: the provider+// name does not say which binary is installed and no catalog has been reported+// yet, so we can neither confirm nor deny the capability.+//+// It deliberately does NOT reuse the "does not support" sentence. That claim+// would be actively wrong for a jcode runtime — sending its owner off to look+// for a limitation that does not exist — whereas naming the missing evidence+// points at the thing that resolves it.+func thinkingCapabilityUnknownRejection(provider string) string {+ return fmt.Sprintf(+ "cannot confirm whether runtime %q supports a per-agent reasoning effort: it has not reported a model catalog yet. Open the model picker for this runtime to trigger discovery and retry, or leave thinking_level empty to use the runtime default",+ provider,+ )+}++// existingThinkingCapabilityUnknownRejection is the carry-over path's version of+// the same answer: it names the value already on the agent and the escape hatch.+func existingThinkingCapabilityUnknownRejection(provider, value string) string {+ return fmt.Sprintf(+ "cannot confirm whether runtime %q supports a per-agent reasoning effort: it has not reported a model catalog yet. Pass thinking_level=\"\" to clear the existing %q, or retry once the runtime has reported its models",+ provider, value,+ )+}++// thinkingCapabilityRejection is the "this runtime has no reasoning dial"+// sentence. Split out because the same answer can now be reached two ways: from+// the provider name alone, or — for ACP-catalog providers, where the provider+// name is not decisive — from a discovered catalog that advertises no effort.+func thinkingCapabilityRejection(provider string) string {+ return fmt.Sprintf(+ "runtime %q does not support a per-agent reasoning effort; leave thinking_level empty to use the runtime default",+ provider,+ )+}++// acpEffortEvidence is what the discovered model catalog says about a runtime's+// reasoning-effort support.+type acpEffortEvidence int++const (+ // acpEffortUnknown — no catalog has been discovered for this runtime.+ //+ // This is NOT a transient cold-start state. The catalog is written only by+ // ReportModelListResult, i.e. only after a client explicitly asks for a+ // model list, so a caller who never opens a model picker (pure CLI use) can+ // sit here indefinitely. Treating unknown as "supported" is therefore not a+ // brief window — it is a permanent hole for anyone who works this way.+ acpEffortUnknown acpEffortEvidence = iota+ // acpEffortAbsent — a catalog exists and no model in it advertises an effort.+ acpEffortAbsent+ // acpEffortPresent — a catalog exists and at least one model advertises one.+ acpEffortPresent+)++// ambiguousACPEffortProviders are providers whose name does not determine which+// binary is actually installed, so "not discovered yet" cannot be read as+// "supported".+//+// `hermes` is the only one: it covers jcode (advertises an effort and applies+// it) and Hermes Agent (advertises none). reasonix is deliberately absent — that+// provider means one binary, which does support an effort, so an undiscovered+// reasonix runtime is safely allowed rather than blocked before its first+// discovery.+var ambiguousACPEffortProviders = map[string]bool{+ "hermes": true,+}++// acpThinkingDecision answers whether this runtime may carry a thinking level,+// consulting the model catalog its daemon reported.+//+// acpEffortPresent means "allow". Providers outside the ACP-catalog set, and+// unambiguous ACP providers with no catalog yet, are reported as present — their+// capability is already settled by the provider name. Only an ambiguous provider+// turns an undiscovered catalog into a refusal, because for those the name+// genuinely does not answer the question and guessing "yes" is what let a Hermes+// Agent user persist a level the daemon would later drop.+func (h *Handler) acpThinkingDecision(ctx context.Context, provider string, runtimeID pgtype.UUID) acpEffortEvidence {+ if !agent.UsesACPCatalogThinking(provider) {+ return acpEffortPresent+ }+ snapshot := h.cachedModelCatalog(ctx, uuidToString(runtimeID))+ if snapshot == nil || len(snapshot.Models) == 0 {+ if ambiguousACPEffortProviders[provider] {+ return acpEffortUnknown+ }+ return acpEffortPresent+ }+ for _, m := range snapshot.Models {+ if m.Thinking != nil && len(m.Thinking.SupportedLevels) > 0 {+ return acpEffortPresent+ }+ }+ return acpEffortAbsent+}+// existingThinkingLevelRejection is thinkingLevelRejection for the carry-over// path, where the caller changed runtime without touching a level the new// runtime cannot take. Both branches point at the same escape hatch, so the// user does not have to guess that clearing is allowed.func existingThinkingLevelRejection(provider, value string) string {if !agent.ThinkingControlSupported(provider) {- return fmt.Sprintf(- "runtime %q does not support a per-agent reasoning effort; pass thinking_level=\"\" to clear the existing %q",- provider, value,- )+ return existingThinkingCapabilityRejection(provider, value)}return fmt.Sprintf("existing thinking_level %q is not valid for runtime %q; pass thinking_level=\"\" to clear or set a value valid for the new runtime",diff --git a/server/internal/handler/agent_thinking_test.go b/server/internal/handler/agent_thinking_test.goindex 25ff46cdbb..2a0e6c2eca 100644--- a/server/internal/handler/agent_thinking_test.go+++ b/server/internal/handler/agent_thinking_test.go@@ -546,20 +546,25 @@ func TestUpdateAgent_RuntimeSwitch_ClearsKnownIncompatibleModel(t *testing.T) {// TestThinkingLevelRejectionCopy pins WHY a thinking_level was refused, not// just that it was. A runtime with no reasoning control must not be described// as receiving an unrecognised value: "high" is a fine effort token, and the-// old shared sentence sent Hermes users looking for a spelling that cannot-// exist (MUL-5770).+// old shared sentence sent users looking for a spelling that cannot exist+// (MUL-5770).+//+// Copilot is the standing example: it discovers over ACP but executes through+// its own CLI, so no live ACP session exists to carry an effort. Hermes used+// to play this role and no longer can — jcode runs under that provider and+// applies an advertised effort, so the provider-level gate is open for it.func TestThinkingLevelRejectionCopy(t *testing.T) {t.Parallel()t.Run("runtime without reasoning control names the capability gap", func(t *testing.T) {- msg := thinkingLevelRejection("hermes", "high")+ msg := thinkingLevelRejection("copilot", "high")if !strings.Contains(msg, "does not support a per-agent reasoning effort") {t.Errorf("expected a capability explanation, got %q", msg)}if strings.Contains(msg, "not a recognised value") {t.Errorf("capability gap must not read as a bad token, got %q", msg)}- if !strings.Contains(msg, `"hermes"`) {+ if !strings.Contains(msg, `"copilot"`) {t.Errorf("expected the runtime named in %q", msg)}})@@ -575,38 +580,41 @@ func TestThinkingLevelRejectionCopy(t *testing.T) {})t.Run("carry-over path always offers the clear escape hatch", func(t *testing.T) {- for _, provider := range []string{"hermes", "claude"} {+ for _, provider := range []string{"copilot", "claude"} {msg := existingThinkingLevelRejection(provider, "xhigh")if !strings.Contains(msg, `thinking_level=""`) {t.Errorf("provider %q: expected the clear instruction, got %q", provider, msg)}}- if msg := existingThinkingLevelRejection("hermes", "xhigh"); !strings.Contains(msg, "does not support a per-agent reasoning effort") {+ if msg := existingThinkingLevelRejection("copilot", "xhigh"); !strings.Contains(msg, "does not support a per-agent reasoning effort") {t.Errorf("expected the capability explanation on the carry-over path, got %q", msg)}})}-// TestCreateAgent_HermesRejectsThinkingLevel covers the reported flow-// end-to-end: creating a Hermes agent with a reasoning effort 400s, and the-// body explains that the runtime has no such control rather than blaming the+// TestCreateAgent_NoReasoningControlRejectsThinkingLevel covers the reported+// flow end-to-end: creating an agent on a runtime with no reasoning control+// 400s, and the body explains the capability gap rather than blaming the// value. Empty stays valid — it means "runtime default".-func TestCreateAgent_HermesRejectsThinkingLevel(t *testing.T) {+//+// It also pins the other side of the MUL-5991 change: hermes, which used to be+// this test's subject, now accepts a level because jcode applies one.+func TestCreateAgent_NoReasoningControlRejectsThinkingLevel(t *testing.T) {if testHandler == nil {t.Skip("database not available")}- hermesRuntimeID := createHermesProviderRuntime(t)+ gapRuntimeID := createProviderRuntime(t, "copilot")t.Cleanup(func() {testPool.Exec(context.Background(),- `DELETE FROM agent WHERE workspace_id = $1 AND name LIKE 'hermes-thinking-%'`,+ `DELETE FROM agent WHERE workspace_id = $1 AND name LIKE '%-thinking-%'`,testWorkspaceID,)})t.Run("effort value rejected with a capability message", func(t *testing.T) {body := map[string]any{- "name": "hermes-thinking-high",- "runtime_id": hermesRuntimeID,+ "name": "copilot-thinking-high",+ "runtime_id": gapRuntimeID,"visibility": "private","max_concurrent_tasks": 1,"thinking_level": "high",@@ -614,7 +622,7 @@ func TestCreateAgent_HermesRejectsThinkingLevel(t *testing.T) {w := httptest.NewRecorder()testHandler.CreateAgent(w, newRequest(http.MethodPost, "/api/agents", body))if w.Code != http.StatusBadRequest {- t.Fatalf("hermes thinking_level=high: expected 400, got %d: %s", w.Code, w.Body.String())+ t.Fatalf("copilot thinking_level=high: expected 400, got %d: %s", w.Code, w.Body.String())}if !strings.Contains(w.Body.String(), "does not support a per-agent reasoning effort") {t.Errorf("expected a capability explanation in the 400 body, got %s", w.Body.String())@@ -622,6 +630,52 @@ func TestCreateAgent_HermesRejectsThinkingLevel(t *testing.T) {})t.Run("empty value still creates", func(t *testing.T) {+ body := map[string]any{+ "name": "copilot-thinking-empty",+ "runtime_id": gapRuntimeID,+ "visibility": "private",+ "max_concurrent_tasks": 1,+ "thinking_level": "",+ }+ w := httptest.NewRecorder()+ testHandler.CreateAgent(w, newRequest(http.MethodPost, "/api/agents", body))+ if w.Code != http.StatusCreated {+ t.Fatalf("copilot empty thinking_level: expected 201, got %d: %s", w.Code, w.Body.String())+ }+ })++ // hermes with no discovered catalog must REFUSE, not accept. The catalog is+ // written only when a client asks for a model list, so a CLI-only caller can+ // sit in the undiscovered state forever — treating it as "supported" is the+ // permanent hole that let a Hermes Agent user persist a level the daemon+ // then drops. The message names the missing evidence rather than claiming a+ // limitation that would be false for jcode.+ t.Run("hermes with no discovered catalog is refused", func(t *testing.T) {+ hermesRuntimeID := createProviderRuntime(t, "hermes")+ body := map[string]any{+ "name": "hermes-thinking-high",+ "runtime_id": hermesRuntimeID,+ "visibility": "private",+ "max_concurrent_tasks": 1,+ "thinking_level": "high",+ }+ w := httptest.NewRecorder()+ testHandler.CreateAgent(w, newRequest(http.MethodPost, "/api/agents", body))+ if w.Code != http.StatusBadRequest {+ t.Fatalf("hermes thinking_level=high with no catalog: expected 400, got %d: %s", w.Code, w.Body.String())+ }+ if !strings.Contains(w.Body.String(), "has not reported a model catalog yet") {+ t.Errorf("expected the not-yet-discovered explanation, got %s", w.Body.String())+ }+ if strings.Contains(w.Body.String(), "does not support") {+ t.Errorf("must not claim a limitation we have not established, got %s", w.Body.String())+ }+ })++ // Empty stays valid on the same runtime — "runtime default" needs no+ // capability evidence.+ t.Run("hermes with no catalog still accepts an empty value", func(t *testing.T) {+ hermesRuntimeID := createProviderRuntime(t, "hermes")body := map[string]any{"name": "hermes-thinking-empty","runtime_id": hermesRuntimeID,@@ -637,9 +691,134 @@ func TestCreateAgent_HermesRejectsThinkingLevel(t *testing.T) {})}-// createHermesProviderRuntime stands up a runtime row with provider "hermes",-// the runtime whose ACP surface exposes no reasoning-effort control.-func createHermesProviderRuntime(t *testing.T) string {+// TestUpdateAgent_ThinkingLevelCarriesOverToUndiscoveredHermes covers the+// branch where the caller never mentions thinking_level at all: an agent that+// already carries one is switched onto a hermes runtime whose capability we+// cannot confirm. Preserving the value there would smuggle a possibly-inert+// setting onto the new runtime, so the switch is refused with the escape hatch+// spelled out.+func TestUpdateAgent_ThinkingLevelCarriesOverToUndiscoveredHermes(t *testing.T) {+ if testHandler == nil {+ t.Skip("database not available")+ }+ ctx := context.Background()+ claudeRuntimeID := createClaudeProviderRuntime(t)+ hermesRuntimeID := createProviderRuntime(t, "hermes")++ created := httptest.NewRecorder()+ testHandler.CreateAgent(created, newRequest(http.MethodPost, "/api/agents", map[string]any{+ "name": "carryover-thinking-agent",+ "runtime_id": claudeRuntimeID,+ "visibility": "private",+ "max_concurrent_tasks": 1,+ "thinking_level": "high",+ }))+ if created.Code != http.StatusCreated {+ t.Fatalf("seed agent: expected 201, got %d: %s", created.Code, created.Body.String())+ }+ var seeded map[string]any+ _ = json.NewDecoder(created.Body).Decode(&seeded)+ agentID, _ := seeded["id"].(string)+ t.Cleanup(func() { testPool.Exec(ctx, `DELETE FROM agent WHERE id = $1`, agentID) })++ w := httptest.NewRecorder()+ testHandler.UpdateAgent(w, withURLParam(+ newRequest(http.MethodPatch, "/api/agents/"+agentID, map[string]any{+ "runtime_id": hermesRuntimeID,+ }), "id", agentID))++ if w.Code != http.StatusBadRequest {+ t.Fatalf("carry-over onto undiscovered hermes: expected 400, got %d: %s", w.Code, w.Body.String())+ }+ // Decode rather than substring-match the raw body: the escape hatch contains+ // quotes, which JSON-escapes to `thinking_level=\"\"` on the wire.+ var errBody struct {+ Error string `json:"error"`+ }+ if err := json.NewDecoder(w.Body).Decode(&errBody); err != nil {+ t.Fatalf("decode error body: %v", err)+ }+ if !strings.Contains(errBody.Error, "has not reported a model catalog yet") {+ t.Errorf("expected the not-yet-discovered explanation, got %q", errBody.Error)+ }+ if !strings.Contains(errBody.Error, `thinking_level=""`) {+ t.Errorf("expected the clear-it escape hatch, got %q", errBody.Error)+ }+}++// TestAcpThinkingDecision is the fix for the regression the hermes+// change introduced: `hermes` covers jcode (advertises an effort) and Hermes+// Agent (advertises none), and the provider name cannot tell them apart. The+// discovered catalog can, so the capability 400 survives for the binary that+// genuinely has no reasoning dial.+func TestAcpThinkingDecision(t *testing.T) {+ t.Parallel()+ ctx := context.Background()+ runtimeID := parseUUID("11111111-1111-1111-1111-111111111111")++ withCatalog := func(t *testing.T, models []ModelEntry) *Handler {+ t.Helper()+ cache := NewInMemoryModelCatalogCache()+ if err := cache.Put(ctx, uuidToString(runtimeID), models, true); err != nil {+ t.Fatalf("seed catalog: %v", err)+ }+ return &Handler{ModelCatalogCache: cache}+ }++ withEffort := []ModelEntry{{+ ID: "gpt-5.6-sol",+ Thinking: &ModelThinking{SupportedLevels: []ThinkingLevel{{Value: "high", Label: "High"}}},+ }}+ withoutEffort := []ModelEntry{{ID: "hermes-4"}}++ t.Run("jcode-shaped catalog keeps the level accepted", func(t *testing.T) {+ if got := withCatalog(t, withEffort).acpThinkingDecision(ctx, "hermes", runtimeID); got != acpEffortPresent {+ t.Errorf("decision = %v, want acpEffortPresent", got)+ }+ })++ t.Run("Hermes-Agent-shaped catalog restores the capability answer", func(t *testing.T) {+ if got := withCatalog(t, withoutEffort).acpThinkingDecision(ctx, "hermes", runtimeID); got != acpEffortAbsent {+ t.Errorf("decision = %v, want acpEffortAbsent", got)+ }+ })++ // Undiscovered is its own answer for an ambiguous provider — not "supported".+ // The catalog is only written once a client asks for a model list, so this+ // state persists indefinitely for CLI-only callers.+ t.Run("no cache is unknown for hermes", func(t *testing.T) {+ if got := (&Handler{}).acpThinkingDecision(ctx, "hermes", runtimeID); got != acpEffortUnknown {+ t.Errorf("decision = %v, want acpEffortUnknown", got)+ }+ })++ t.Run("empty catalog is unknown for hermes", func(t *testing.T) {+ if got := withCatalog(t, nil).acpThinkingDecision(ctx, "hermes", runtimeID); got != acpEffortUnknown {+ t.Errorf("decision = %v, want acpEffortUnknown", got)+ }+ })++ // reasonix names exactly one binary, and that binary supports an effort, so+ // an undiscovered reasonix runtime is allowed rather than blocked before its+ // first discovery. Tightening hermes must not tighten this.+ t.Run("no cache still allows reasonix", func(t *testing.T) {+ if got := (&Handler{}).acpThinkingDecision(ctx, "reasonix", runtimeID); got != acpEffortPresent {+ t.Errorf("decision = %v, want acpEffortPresent — reasonix is unambiguous", got)+ }+ })++ // Providers outside the ACP-catalog set are answered by name alone; this+ // check must not start second-guessing them from a catalog.+ t.Run("non-ACP provider is not consulted", func(t *testing.T) {+ if got := withCatalog(t, withoutEffort).acpThinkingDecision(ctx, "claude", runtimeID); got != acpEffortPresent {+ t.Errorf("decision = %v, want acpEffortPresent — claude is decided by provider", got)+ }+ })+}++// createProviderRuntime stands up a runtime row for the given provider so a+// test can exercise provider-level gates end-to-end.+func createProviderRuntime(t *testing.T, provider string) string {t.Helper()var runtimeID stringerr := testPool.QueryRow(context.Background(), `@@ -647,11 +826,11 @@ func createHermesProviderRuntime(t *testing.T) string {workspace_id, daemon_id, name, runtime_mode, provider, status,device_info, metadata, last_seen_at, owner_id)- VALUES ($1, NULL, $2, 'cloud', 'hermes', 'online', $3, '{}'::jsonb, now(), $4)+ VALUES ($1, NULL, $2, 'cloud', $5, 'online', $3, '{}'::jsonb, now(), $4)RETURNING id- `, testWorkspaceID, "Hermes Thinking Runtime", "Hermes thinking-level test runtime", testUserID).Scan(&runtimeID)+ `, testWorkspaceID, provider+" Thinking Runtime", provider+" thinking-level test runtime", testUserID, provider).Scan(&runtimeID)if err != nil {- t.Fatalf("create hermes runtime: %v", err)+ t.Fatalf("create %s runtime: %v", provider, err)}t.Cleanup(func() {testPool.Exec(context.Background(), `DELETE FROM agent_runtime WHERE id = $1`, runtimeID)diff --git a/server/internal/service/builtin_skills/multica-creating-agents/SKILL.md b/server/internal/service/builtin_skills/multica-creating-agents/SKILL.mdindex e98edef3b0..4144ec44a0 100644--- a/server/internal/service/builtin_skills/multica-creating-agents/SKILL.md+++ b/server/internal/service/builtin_skills/multica-creating-agents/SKILL.md@@ -119,7 +119,7 @@ multica agent copy <source-agent-id> --runtime-id <target> --model <model> # cr| `avatar_url` | `agent.avatar_url` | none; an explicit non-empty value is preserved, while omitted/empty creates a random `emoji:<glyph>` avatar | catalog/listing UI only — NOT the runtime prompt || `runtime_id` | `agent.runtime_id` (nullable) | required at create (400) + must resolve to a runtime in this workspace | selects runtime/provider; `NULL` means unbound — see below || `model` | `agent.model` (nullable) | none beyond runtime support | daemon reads; empty = runtime default |-| `thinking_level` | `agent.thinking_level` (nullable) | provider-level enum/safe-token gate; unknown literal → 400. Pi accepts only `off|minimal|low|medium|high|xhigh|max`, then the daemon checks the selected model's RPC-discovered subset. ACP runtimes that advertise an effort selector in `session/new` (currently `reasonix`) take the safe-token path and are checked against the discovered catalog by the daemon; that catalog covers only the model the discovery session was on, so other models show no picker until per-model probing exists. A runtime with no reasoning control (e.g. `hermes`) rejects EVERY non-empty value and says so — that 400 is a capability answer, not a bad token | daemon; empty = runtime default |+| `thinking_level` | `agent.thinking_level` (nullable) | provider-level enum/safe-token gate; unknown literal → 400. Pi accepts only `off|minimal|low|medium|high|xhigh|max`, then the daemon checks the selected model's RPC-discovered subset. ACP runtimes that advertise an effort selector in `session/new` (currently `reasonix` and `hermes`) take the safe-token path and are checked against the discovered catalog by the daemon; that catalog covers only the model the discovery session was on, so other models show no picker until per-model probing exists. `hermes` covers two binaries — jcode advertises and applies an effort, Hermes Agent advertises none and gets no picker — so the answer there comes from the runtime's discovered catalog, not the provider name. Because that catalog is only written once a client requests a model list, a `hermes` runtime that has never been discovered is refused with a distinct "has not reported a model catalog yet" 400 rather than being assumed capable; `reasonix`, whose provider name does determine the binary, is allowed in that state. A runtime with no reasoning control at all (e.g. `copilot`, which executes outside ACP) rejects EVERY non-empty value and says so — that 400 is a capability answer, not a bad token | daemon; empty = runtime default || `service_tier` | `agent.service_tier` (nullable) | Codex-only safe token; other providers reject; exact model/tier pair checked by daemon | daemon → Codex app-server; empty = local Codex config || `custom_args` | `agent.custom_args` (JSON array) | JSON shape checked CLI-side; server stores as-is | daemon (extra CLI switches); defaults to `[]` || `runtime_config` | `agent.runtime_config` (JSON) | JSON shape checked CLI-side; server stores as-is | runtime-specific config; defaults to `{}` |diff --git a/server/internal/service/builtin_skills/multica-creating-agents/references/creating-agents-source-map.md b/server/internal/service/builtin_skills/multica-creating-agents/references/creating-agents-source-map.mdindex 27586427ff..477b5cd91e 100644--- a/server/internal/service/builtin_skills/multica-creating-agents/references/creating-agents-source-map.md+++ b/server/internal/service/builtin_skills/multica-creating-agents/references/creating-agents-source-map.md@@ -84,11 +84,12 @@ go test ./internal/service -run TestBuiltinSkillsConformToTemplate| Pi invocation effort | `pi.go` `buildPiArgs` / `piBlockedArgs` | A non-empty persisted value becomes `--thinking <level>`; custom `--thinking` flags are filtered so the first-class field is the sole owner. || Per-model thinking validation | `thinking.go` `ValidateThinkingLevel` | Accepts only values in the explicit model's `Thinking.SupportedLevels`; Pi empty-model validation resolves to the RPC current-model Default, while an empty Codex model fails closed because its effective `config.toml` model is unknown. || Dynamic Codex token gate | `thinking.go` `IsKnownThinkingValue` | Server persistence accepts syntactically safe Codex/OpenCode/Kimi and ACP-catalog tokens so new catalog values do not require a Multica release; Pi instead uses its fixed seven-token CLI vocabulary. Exact support remains a daemon-local per-model check. |-| Runtime reasoning capability | `thinking.go` `ThinkingControlSupported` | True for the fixed-enum providers (including Pi), the dynamic-catalog providers (Codex/OpenCode/Kimi), and the ACP-catalog providers in `acpCatalogThinkingProviders`. False for runtimes with no effort dial on the surface the daemon drives — Hermes' ACP adapter never carries `reasoning_config` onto a session, so its CLI-level `agent.reasoning_effort` cannot be reached from Multica (verified against Hermes Agent v0.18.2, MUL-5770) |+| Runtime reasoning capability | `thinking.go` `ThinkingControlSupported` | True for the fixed-enum providers (including Pi), the dynamic-catalog providers (Codex/OpenCode/Kimi), and the ACP-catalog providers in `acpCatalogThinkingProviders`. False for runtimes with no effort dial on the surface the daemon drives — Copilot discovers over ACP but executes through its own CLI, so no live ACP session exists to carry an effort. Provider granularity only: `hermes` reports true because jcode applies an effort, while Hermes Agent under the same provider advertises none and gets no picker — the per-session catalog settles it || Generic ACP effort catalog | `acp_effort.go` `parseACPEffortOption` / `annotateACPThinkingForSessionModel` | One provider-neutral parser reads the effort selector out of any ACP `session/new` response (option id or category `effort` / `thought_level`), taking the advertised values verbatim. CodeBuddy keeps a flag whitelist on top because it applies the level via `--effort`, not over ACP || ACP effort catalogs are per model, not per session | `acp_effort.go` `annotateACPThinkingForSessionModel` | Only the model marked `Default` (the advertised `currentModelId`) is annotated. ACP options may depend on each other, and reasonix v1.21.5 derives the catalog from the current model's provider entry — `deepseek-v4-flash` advertises `low`, `deepseek-v4-pro` does not, and some models expose no effort at all. Copying one catalog across models would offer levels the runtime then refuses. Other models keep `Thinking=nil` until per-model probing exists || ACP effort application | `acp_effort.go` `applyACPEffortOption` | Sends `session/set_config_option` with the id the session advertised, then re-reads `currentValue`. The read-back proves only that the session reports the new value — not that the runtime threaded it into its provider request; it catches Kimi ≤0.28.1 confirming `on` after being set to `max`. Failures warn and let the prompt through rather than failing the task. `stateIsCurrent=false` after a model switch skips the local vocabulary check, because the advertised list then describes the previous model |-| ACP effort opt-in | `thinking.go` `acpCatalogThinkingProviders` | A runtime joins only when its `Execute` calls `applyACPEffortOption` AND someone has confirmed from source or a real run that it acts on the setting — currently `reasonix` (GitHub #6720). This list, not the read-back, is where that verification is recorded. Speaking ACP is not sufficient: Copilot discovers over ACP but executes through its own CLI, so a catalog there would render a picker with nothing behind it |+| ACP capability is per runtime, not per provider | `agent.go` `acpThinkingDecision` / `ambiguousACPEffortProviders` | Three-state, consulted on create and both update branches. Catalog advertises an effort → allow; catalog advertises none → capability 400; **no catalog yet** → 400 for ambiguous providers only (`hermes`), because the cache is written solely by `ReportModelListResult`, so a CLI-only caller stays undiscovered indefinitely and "unknown" must not be read as "supported". `reasonix` is unambiguous and stays allowed while undiscovered |+| ACP effort opt-in | `thinking.go` `acpCatalogThinkingProviders` | A runtime joins only when its `Execute` calls `applyACPEffortOption` AND someone has confirmed from source or a real run that it acts on the setting — currently `reasonix` and `hermes` (GitHub #6720). This list, not the read-back, is where that verification is recorded. `hermes` is the case that shows why the catalog rather than a version gate decides: jcode advertises `reasoning_effort` and threads it into the provider request (verified v0.71.1/v0.73.0), Hermes Agent advertises no configOptions at all (re-verified v0.20.0, 2026-08-11), and both run under the same provider type. Speaking ACP is not sufficient: Copilot discovers over ACP but executes through its own CLI, so a catalog there would render a picker with nothing behind it || Per-model service-tier validation | `thinking.go` `ValidateServiceTier` | Accepts only a tier advertised for the explicit Codex model; empty model fails closed because config.toml is unknown || Daemon invalid-combination handling | `internal/daemon/daemon.go` 3860–3892 | Before execution, invalid `(provider, model, thinking_level)` combinations log a warning and omit the override rather than failing the task |diff --git a/server/pkg/agent/acp_effort_test.go b/server/pkg/agent/acp_effort_test.goindex 18a6c96599..bd1435f825 100644--- a/server/pkg/agent/acp_effort_test.go+++ b/server/pkg/agent/acp_effort_test.go@@ -382,8 +382,11 @@ func TestACPCatalogProviderGate(t *testing.T) {if IsKnownThinkingValue("reasonix", "not a token") {t.Error("malformed tokens must still be rejected")}- if ThinkingControlSupported("hermes") || IsKnownThinkingValue("hermes", "high") {- t.Error("hermes must stay closed until its ACP surface applies an effort")+ // hermes covers jcode (applies an advertised effort) and Hermes Agent+ // (advertises none). The gate opens at provider granularity; the+ // per-session catalog decides whether a picker actually appears.+ if !ThinkingControlSupported("hermes") || !IsKnownThinkingValue("hermes", "high") {+ t.Error("hermes should advertise reasoning control now that jcode applies it")}// Copilot discovers over ACP but executes through its own CLI, so it must// not be swept in by the generalization.@@ -391,3 +394,88 @@ func TestACPCatalogProviderGate(t *testing.T) {t.Error("copilot executes outside ACP; a picker here would do nothing")}}++// jcodeEffortSessionResult is jcode's advertised shape (GitHub #6720, verified+// by the reporter against v0.71.1 and v0.73.0). The option id is+// `reasoning_effort` — NOT one of the tokens acpEffortOptionIDs matches — so+// this only parses because the category is `thought_level`.+const jcodeEffortSessionResult = `{"sessionId":"ses-jcode",` ++ `"models":{"currentModelId":"gpt-5.6-sol","availableModels":[{"modelId":"gpt-5.6-sol","name":"GPT-5.6 Sol"}]},` ++ `"configOptions":[` ++ `{"type":"select","id":"reasoning_effort","name":"Reasoning Effort","category":"thought_level","currentValue":"low","options":[` ++ `{"value":"low","name":"Low"},{"value":"medium","name":"Medium"},{"value":"high","name":"High"}]}]}`++// hermesAgentSessionResult is what Hermes Agent actually returns. Captured+// from `hermes acp` v0.20.0 on 2026-08-11 — the keys are exactly these four,+// with no configOptions, unchanged from the v0.18.2 finding in MUL-5770.+const hermesAgentSessionResult = `{"_meta":{},"sessionId":"ses-hermes",` ++ `"models":{"currentModelId":"hermes-4","availableModels":[{"modelId":"hermes-4","name":"Hermes 4"}]},` ++ `"modes":{}}`++// TestJcodeEffortOptionMatchesByCategory pins the reason jcode needs no parser+// change: its option id is unrecognised, and the category carries the match.+func TestJcodeEffortOptionMatchesByCategory(t *testing.T) {+ t.Parallel()+ if acpEffortOptionIDs["reasoning_effort"] {+ t.Fatal("test premise broken: `reasoning_effort` is now a matched id, " ++ "so this no longer proves category matching carries jcode")+ }+ option, ok := parseACPEffortOption(json.RawMessage(jcodeEffortSessionResult))+ if !ok {+ t.Fatal("jcode's effort option was not recognised")+ }+ // The id we send back must be jcode's, not the token we matched on.+ if option.ConfigID != "reasoning_effort" {+ t.Errorf("ConfigID = %q, want reasoning_effort", option.ConfigID)+ }+ if got := strings.Join(option.values(), ","); got != "low,medium,high" {+ t.Errorf("values = %q", got)+ }+}++// TestHermesAgentAdvertisesNoEffortCatalog is the other half of the hermes+// provider: the same provider type, a binary with no effort surface, and+// therefore no picker. This is what makes the shared opt-in entry safe.+func TestHermesAgentAdvertisesNoEffortCatalog(t *testing.T) {+ t.Parallel()+ if _, ok := parseACPEffortOption(json.RawMessage(hermesAgentSessionResult)); ok {+ t.Error("Hermes Agent advertises no configOptions; nothing should parse")+ }+ models := []Model{{ID: "hermes-4", Default: true}}+ annotateACPThinkingForSessionModel(models, json.RawMessage(hermesAgentSessionResult))+ if models[0].Thinking != nil {+ t.Errorf("Thinking = %+v, want nil so no picker is offered", models[0].Thinking)+ }+}++// TestApplyACPEffortOptionHermesAgentSendsNothing: with no advertised option+// there is no config id to address, so the helper must not invent a call —+// the turn runs at the runtime default instead.+func TestApplyACPEffortOptionHermesAgentSendsNothing(t *testing.T) {+ t.Parallel()+ request, calls := recordingACPRequest(`{}`, nil)+ applyACPEffortOption(context.Background(), request, "hermes", discardLogger(),+ "ses-hermes", json.RawMessage(hermesAgentSessionResult), "high", true)+ if len(*calls) != 0 {+ t.Errorf("sent %+v, want no request against a runtime with no effort option", *calls)+ }+}++// TestApplyACPEffortOptionJcodeUsesAdvertisedID: the same provider, the other+// binary — the level goes out under jcode's own option id.+func TestApplyACPEffortOptionJcodeUsesAdvertisedID(t *testing.T) {+ t.Parallel()+ echo := `{"configOptions":[{"id":"reasoning_effort","currentValue":"high","options":[` ++ `{"value":"low"},{"value":"medium"},{"value":"high"}]}]}`+ request, calls := recordingACPRequest(echo, nil)++ applyACPEffortOption(context.Background(), request, "hermes", discardLogger(),+ "ses-jcode", json.RawMessage(jcodeEffortSessionResult), "high", true)++ if len(*calls) != 1 {+ t.Fatalf("calls = %+v, want one set_config_option", *calls)+ }+ if got := (*calls)[0].params["configId"]; got != "reasoning_effort" {+ t.Errorf("configId = %v, want reasoning_effort", got)+ }+}diff --git a/server/pkg/agent/hermes.go b/server/pkg/agent/hermes.goindex 6670aea062..5828b4c72d 100644--- a/server/pkg/agent/hermes.go+++ b/server/pkg/agent/hermes.go@@ -157,12 +157,11 @@ func StripHermesProfileArgs(args []string, sel HermesProfileSelection) []string// This is the same pattern as Codex but with the ACP protocol instead of// the Codex-specific JSON-RPC methods.//-// opts.ThinkingLevel is deliberately not consumed here: Hermes' ACP surface-// has nowhere to put a reasoning effort (see ThinkingControlSupported in-// thinking.go for the evidence and the version it was verified against), and-// the server rejects the field for this provider before a task is ever-// dispatched. Wire it up here — alongside the model selection below — once-// Hermes' ACP adapter carries reasoning onto the session.+// opts.ThinkingLevel is applied through applyACPEffortOption below, driven by+// whatever effort option the session advertises. This provider covers two+// unrelated binaries — Hermes Agent and jcode — with opposite capabilities+// here, so the catalog is the only honest discriminator; see+// acpCatalogThinkingProviders in thinking.go for which is which.type hermesBackend struct {cfg Config}@@ -401,6 +400,11 @@ func (b *hermesBackend) Execute(ctx context.Context, prompt string, opts ExecOptcwd = "."}+ // sessionResult is whichever of session/new or session/resume produced+ // this session. It carries the configOptions the effort step below+ // reads, so both branches have to keep hold of it.+ var sessionResult json.RawMessage+if opts.ResumeSessionID != "" {// Per ACP Session Setup, session/resume accepts mcpServers and// the runtime re-connects them as part of the resume. Without@@ -417,6 +421,7 @@ func (b *hermesBackend) Execute(ctx context.Context, prompt string, opts ExecOptresCh <- Result{Status: finalStatus, Error: finalError, DurationMs: time.Since(startTime).Milliseconds()}return}+ sessionResult = resultsessionID, resumeLanded = resolveHermesResumedSessionID(opts.ResumeSessionID, result)if !resumeLanded {b.cfg.Logger.Warn("agent returned a different session id on resume — original was likely lost; continuing with the new id",@@ -437,6 +442,7 @@ func (b *hermesBackend) Execute(ctx context.Context, prompt string, opts ExecOptresCh <- Result{Status: finalStatus, Error: finalError, DurationMs: time.Since(startTime).Milliseconds()}return}+ sessionResult = resultsessionID = extractACPSessionID(result)if sessionID == "" {finalStatus = "failed"@@ -510,6 +516,19 @@ func (b *hermesBackend) Execute(ctx context.Context, prompt string, opts ExecOptb.cfg.Logger.Info("hermes session model set", "model", opts.Model)}+ // 3b. Apply a persisted thinking override through whichever effort+ // option this session advertises. Which binary answered decides+ // whether anything happens: jcode advertises `reasoning_effort` and+ // threads it into the provider request, while Hermes Agent advertises+ // no configOptions at all and the helper no-ops. Unlike set_model+ // above this must NOT fail the task — an effort we could not apply+ // still runs the prompt at the runtime's own default.+ //+ // sessionResult stops describing the live session once set_model runs,+ // because an ACP effort option may depend on the current model.+ applyACPEffortOption(runCtx, c.request, "hermes", b.cfg.Logger,+ sessionID, sessionResult, opts.ThinkingLevel, opts.Model == "")+// 4. Send the prompt and wait for PromptResponse.//// Do NOT prepend opts.SystemPrompt here. Hermes ACP loads project/contextdiff --git a/server/pkg/agent/hermes_effort_execute_unix_test.go b/server/pkg/agent/hermes_effort_execute_unix_test.gonew file mode 100644index 0000000000..c14423c965--- /dev/null+++ b/server/pkg/agent/hermes_effort_execute_unix_test.go@@ -0,0 +1,131 @@+//go:build !windows++package agent++import (+ "context"+ "log/slog"+ "os"+ "path/filepath"+ "strings"+ "testing"+ "time"+)++// The `hermes` provider covers two binaries with opposite answers on reasoning+// effort, and this PR ships no real-jcode verification. These tests are the+// substitute evidence for the main execution chain: they drive+// hermesBackend.Execute against ACP stubs shaped like each binary and assert+// what reaches the wire.++// hermesEffortExecStub answers a full turn and appends every request it receives+// to $HERMES_RPC_LOG. sessionResult is returned from BOTH session/new and+// session/resume so one stub covers either entry path.+func hermesEffortExecStub(sessionResult string) string {+ return `#!/bin/sh+while IFS= read -r line; do+ printf '%s\n' "$line" >> "$HERMES_RPC_LOG"+ 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,"agentCapabilities":{"loadSession":true}}}\n' "$id"+ ;;+ *'"method":"session/new"'*|*'"method":"session/resume"'*)+ printf '{"jsonrpc":"2.0","id":%s,"result":` + sessionResult + `}\n' "$id"+ ;;+ *'"method":"session/set_config_option"'*)+ requested=$(printf '%s' "$line" | sed -n 's/.*"value":"\([^"]*\)".*/\1/p')+ printf '{"jsonrpc":"2.0","id":%s,"result":{"configOptions":[{"id":"reasoning_effort","currentValue":"%s","options":[{"value":"low"},{"value":"medium"},{"value":"high"}]}]}}\n' "$id" "$requested"+ ;;+ *'"method":"session/prompt"'*)+ printf '{"jsonrpc":"2.0","id":%s,"result":{"stopReason":"end_turn"}}\n' "$id"+ exit 0+ ;;+ esac+done+`+}++func runHermesEffortTurn(t *testing.T, sessionResult, level string, opts ExecOptions) string {+ t.Helper()+ dir := t.TempDir()+ logPath := filepath.Join(dir, "rpc.log")+ fakePath := filepath.Join(dir, "hermes")+ writeTestExecutable(t, fakePath, []byte(hermesEffortExecStub(sessionResult)))++ backend, err := New("hermes", Config{+ ExecutablePath: fakePath,+ Logger: slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelError})),+ Env: map[string]string{"HERMES_RPC_LOG": logPath},+ })+ if err != nil {+ t.Fatalf("new hermes backend: %v", err)+ }++ ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)+ defer cancel()+ opts.ThinkingLevel = level+ opts.Timeout = 15 * time.Second+ session, err := backend.Execute(ctx, "ping", opts)+ if err != nil {+ t.Fatalf("execute: %v", err)+ }+ go func() {+ for range session.Messages {+ }+ }()+ result := <-session.Result+ if result.Status != "completed" {+ t.Fatalf("result = %+v, want a completed turn", result)+ }++ raw, err := os.ReadFile(logPath)+ if err != nil {+ t.Fatalf("read rpc log: %v", err)+ }+ return string(raw)+}++// TestHermesExecuteAppliesJcodeEffort covers both entry paths: a fresh session+// and a resumed one must each push the level under jcode's own advertised+// option id, before the prompt.+func TestHermesExecuteAppliesJcodeEffort(t *testing.T) {+ for _, tc := range []struct {+ name string+ opts ExecOptions+ }{+ {name: "session/new"},+ {name: "session/resume", opts: ExecOptions{ResumeSessionID: "ses-jcode", ResumeExpected: true}},+ } {+ t.Run(tc.name, func(t *testing.T) {+ rpcLog := runHermesEffortTurn(t, jcodeEffortSessionResult, "high", tc.opts)++ if !strings.Contains(rpcLog, `"method":"session/set_config_option"`) {+ t.Fatalf("no set_config_option reached the runtime; log:\n%s", rpcLog)+ }+ if !strings.Contains(rpcLog, `"configId":"reasoning_effort"`) {+ t.Errorf("configId was not jcode's advertised id; log:\n%s", rpcLog)+ }+ if !strings.Contains(rpcLog, `"value":"high"`) {+ t.Errorf("the requested level did not reach the runtime; log:\n%s", rpcLog)+ }+ // An effort applied after the prompt would not affect it.+ if strings.Index(rpcLog, "set_config_option") > strings.Index(rpcLog, "session/prompt") {+ t.Errorf("effort was applied after the prompt; log:\n%s", rpcLog)+ }+ })+ }+}++// TestHermesExecuteSendsNothingForHermesAgent is the other binary under the same+// provider: no advertised option means no config call at all, and the turn still+// runs at the runtime's own default.+func TestHermesExecuteSendsNothingForHermesAgent(t *testing.T) {+ rpcLog := runHermesEffortTurn(t, hermesAgentSessionResult, "high", ExecOptions{})+ if strings.Contains(rpcLog, "set_config_option") {+ t.Errorf("sent a config call to a runtime advertising no option; log:\n%s", rpcLog)+ }+ if !strings.Contains(rpcLog, `"method":"session/prompt"`) {+ t.Errorf("the turn should still have prompted; log:\n%s", rpcLog)+ }+}diff --git a/server/pkg/agent/models.go b/server/pkg/agent/models.goindex 60105b0d95..3c0d83d74e 100644--- a/server/pkg/agent/models.go+++ b/server/pkg/agent/models.go@@ -1264,6 +1264,12 @@ func discoverHermesModels(ctx context.Context, executablePath string) ([]Model,clientName: "multica-model-discovery",extraEnv: []string{"HERMES_YOLO_MODE=1"},tmpdirPrefix: "multica-hermes-discovery-",+ // The same handshake carries an effort selector on jcode and carries+ // none on Hermes Agent, so annotate is what tells the two apart —+ // Hermes Agent models come back with a nil Thinking and show no+ // picker. Only the session's current model is annotated; see+ // annotateACPThinkingForSessionModel.+ annotate: annotateACPThinkingForSessionModel,})}diff --git a/server/pkg/agent/thinking.go b/server/pkg/agent/thinking.goindex 2417afc1b5..3dd9f6a03e 100644--- a/server/pkg/agent/thinking.go+++ b/server/pkg/agent/thinking.go@@ -801,6 +801,26 @@ var acpCatalogThinkingProviders = map[string]bool{// config surface. Its catalog is per model — see// annotateACPThinkingForSessionModel."reasonix": true,+ // hermes covers two unrelated binaries, and membership here is safe only+ // because the catalog decides per session which one answered:+ //+ // - jcode advertises option id `reasoning_effort` (category+ // `thought_level`) and genuinely applies it — set_config_option waits+ // for an `effort_changed` ack, and the provider request carries+ // `reasoning.effort` upstream. Confirmed against jcode v0.71.1 and+ // v0.73.0 (GitHub #6720). Its catalog is per model too: jcode+ // revalidates the effort against the new model's advertised list on a+ // model switch.+ // - Hermes Agent advertises no configOptions at all, so it gets an empty+ // catalog, no picker, and no set_config_option call. Re-verified+ // against v0.20.0 on 2026-08-11: session/new still returns only+ // `_meta`, `models`, `modes`, `sessionId` — unchanged from the v0.18.2+ // finding in MUL-5770.+ //+ // That split is why this feature is catalog-driven rather than gated on a+ // version string: one provider, two binaries, and the session answers the+ // capability question directly.+ "hermes": true,}// usesDynamicThinkingCatalog reports whether a provider's effort vocabulary is@@ -809,30 +829,35 @@ func usesDynamicThinkingCatalog(providerType string) bool {return thinkingDynamicCatalogProviders[providerType] || acpCatalogThinkingProviders[providerType]}+// UsesACPCatalogThinking reports whether a provider's effort support is decided+// per session by what its ACP handshake advertises, rather than by the provider+// name alone.+//+// Callers that can reach a discovered catalog should use it to answer the+// capability question for a specific runtime: `hermes` covers both jcode (which+// advertises and applies an effort) and Hermes Agent (which advertises none), so+// the provider name is not a sufficient answer for either. See+// acpCatalogThinkingProviders.+func UsesACPCatalogThinking(providerType string) bool {+ return acpCatalogThinkingProviders[providerType]+}+// ThinkingControlSupported reports whether Multica can deliver a per-agent// reasoning effort to this runtime at all. False means the answer to any// thinking_level is "no", regardless of the token: the runtime exposes no// effort dial on the surface the daemon speaks to it over, so there is nothing// to inject and nothing a different spelling would fix.//-// Hermes is the instructive case (MUL-5770). The Hermes CLI does support-// reasoning effort — `agent.reasoning_effort` in `<HERMES_HOME>/config.yaml`,-// checked against its own `minimal|low|medium|high|xhigh|max|ultra` set — but-// Multica drives Hermes over ACP (`hermes acp`), and its ACP adapter does not-// carry that setting onto the session:-// - `session/new` advertises `models` and `modes` only, no `configOptions`,-// so there is no effort catalog to discover;-// - `session/set_config_option` records the value on the session and never-// applies it;-// - `acp_adapter/session.py::_make_agent` constructs the agent without-// `reasoning_config`, so every ACP session runs at the transport default.+// Copilot is the instructive case. It speaks ACP for model discovery but+// executes through its own CLI surface (`--acp` is blocked in copilot.go), so+// there is no live ACP session to carry an effort onto — a picker there would+// be inert no matter what discovery advertised.//-// Verified against Hermes Agent v0.18.2. Because the config file is read by-// the CLI/gateway paths but not the ACP one, writing an effort into a per-task-// HERMES_HOME would be just as inert as accepting the value here — which is-// why this is a capability gap to report, not a value to pass through. Revisit-// when Hermes' ACP surface exposes reasoning; the picker then follows from the-// discovered catalog like every other runtime's.+// True at provider granularity only. The `hermes` provider covers two+// unrelated binaries whose answers differ — jcode applies an advertised+// effort, Hermes Agent has no effort surface on ACP at all — so it reports+// true here and the per-session catalog decides whether a picker actually+// appears. See acpCatalogThinkingProviders for the evidence on each.func ThinkingControlSupported(providerType string) bool {if usesDynamicThinkingCatalog(providerType) {return truediff --git a/server/pkg/agent/thinking_test.go b/server/pkg/agent/thinking_test.goindex 593b1cef9a..cc6d0d8e91 100644--- a/server/pkg/agent/thinking_test.go+++ b/server/pkg/agent/thinking_test.go@@ -515,7 +515,10 @@ func TestIsKnownThinkingValue(t *testing.T) {{"kimi", ".hidden", false},{"kimi", "bad value", false},{"hermes", "", true},- {"hermes", "low", false}, // hermes' ACP surface exposes no effort dial+ // jcode runs under this provider and applies an advertised effort;+ // Hermes Agent advertises none. The per-session catalog decides, so the+ // literal gate opens for both.+ {"hermes", "low", true},{"grok", "", true},{"grok", "low", true},{"grok", "medium", true},@@ -549,7 +552,7 @@ func TestThinkingControlSupported(t *testing.T) {{"codex", true}, // dynamic catalog, validated per model by the daemon{"opencode", true}, // dynamic variant names from opencode.json{"pi", true}, // fixed tokens, per-model subset discovered over RPC- {"hermes", false}, // ACP adapter drops reasoning entirely (MUL-5770)+ {"hermes", true}, // jcode applies it; Hermes Agent gets an empty catalog{"kimi", true}, // dynamic catalog; ACP session/set_config_option applies it{"qwenpaw", false},{"", false},