Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(providers): support unsigned thinking replay

Tioit-Wang59216f5f23a0
diff --git a/apps/desktop/src/components/settings/ModelAdvancedSettings.tsx b/apps/desktop/src/components/settings/ModelAdvancedSettings.tsx
index 751a407d4..a890e4d24 100644
--- a/apps/desktop/src/components/settings/ModelAdvancedSettings.tsx
+++ b/apps/desktop/src/components/settings/ModelAdvancedSettings.tsx
@@ -303,6 +303,26 @@ export function ModelAdvancedSettings({
/>
<HelpIcon label={t(fastModeHint)} />
</span>
+ <span className="provider-chosen-capability-item">
+ <Checkbox
+ className="provider-chosen-capability"
+ checked={binding.allowEmptyThinkingSignature === true}
+ disabled={apiStyle !== "anthropic_messages"}
+ onChange={(event) =>
+ updateBinding(binding.id, {
+ allowEmptyThinkingSignature: event.target.checked,
+ })
+ }
+ label={t("settings.allowEmptyThinkingSignature")}
+ />
+ <HelpIcon
+ label={t(
+ apiStyle === "anthropic_messages"
+ ? "settings.allowEmptyThinkingSignatureHint"
+ : "settings.allowEmptyThinkingSignatureDefaultHint",
+ )}
+ />
+ </span>
</div>
</section>
</div>
diff --git a/apps/desktop/src/components/settings/provider-copy.ts b/apps/desktop/src/components/settings/provider-copy.ts
index cb099aa30..424933a12 100644
--- a/apps/desktop/src/components/settings/provider-copy.ts
+++ b/apps/desktop/src/components/settings/provider-copy.ts
@@ -50,6 +50,9 @@ export function copyProviderConfiguration(provider: ProviderPublic, name: string
...(model.availableForSubagents !== undefined ? { availableForSubagents: model.availableForSubagents } : {}),
...(model.nativeWebSearch !== undefined ? { nativeWebSearch: model.nativeWebSearch } : {}),
...(model.fastModeAllowed !== undefined ? { fastModeAllowed: model.fastModeAllowed } : {}),
+ ...(model.allowEmptyThinkingSignature !== undefined
+ ? { allowEmptyThinkingSignature: model.allowEmptyThinkingSignature }
+ : {}),
})),
};
}
diff --git a/apps/desktop/test/model-advanced-capabilities.test.mjs b/apps/desktop/test/model-advanced-capabilities.test.mjs
index efd407fb6..2e001e894 100644
--- a/apps/desktop/test/model-advanced-capabilities.test.mjs
+++ b/apps/desktop/test/model-advanced-capabilities.test.mjs
@@ -309,3 +309,11 @@ test("model settings let the user allow Fast mode per model on Responses wires",
assert.match(pickerSource, /"settings\.fastModeAllowedUsageHint"/);
assert.match(pickerSource, /"settings\.fastModeAllowedUnsupported"/);
});
+
+test("Anthropic Messages model rows persist unsigned thinking replay as an explicit opt-in", () => {
+ assert.match(pickerSource, /checked=\{binding\.allowEmptyThinkingSignature === true\}/);
+ assert.match(pickerSource, /disabled=\{apiStyle !== "anthropic_messages"\}/);
+ assert.match(pickerSource, /allowEmptyThinkingSignature: event\.target\.checked/);
+ assert.match(pickerSource, /settings\.allowEmptyThinkingSignatureHint/);
+ assert.match(pickerSource, /settings\.allowEmptyThinkingSignatureDefaultHint/);
+});
diff --git a/apps/desktop/test/provider-copy.test.mjs b/apps/desktop/test/provider-copy.test.mjs
index 031ac3992..e7c1905c8 100644
--- a/apps/desktop/test/provider-copy.test.mjs
+++ b/apps/desktop/test/provider-copy.test.mjs
@@ -12,6 +12,7 @@ const source = () => ({
models: [{ id: 'model', alias: 'Fast', contextWindow: 32000, maxTokens: 4000,
thinkingLevels: ['off', 'high'], defaultThinkingLevel: 'high',
supportsImages: true, supportsDocuments: null, availableForSubagents: true,
+ allowEmptyThinkingSignature: true,
contextWindowSource: 'catalog', maxTokensSource: 'user',
secretValue: 'never-copy' }],
});
@@ -24,9 +25,10 @@ test('copy drafts carry only editable non-credential fields, with independent mo
assert.equal(copy.models[0].alias, 'Fast');
assert.equal(copy.models[0].supportsImages, true);
assert.equal(copy.models[0].supportsDocuments, null);
+ assert.equal(copy.models[0].availableForSubagents, true);
assert.equal(copy.models[0].contextWindowSource, 'catalog');
+ assert.equal(copy.models[0].allowEmptyThinkingSignature, true);
assert.equal(copy.models[0].maxTokensSource, 'user');
- assert.equal(copy.models[0].availableForSubagents, true);
assert.ok(!JSON.stringify(copy).includes('never-copy'));
copy.name='Changed'; copy.apiStyle='anthropic_messages';
copy.models[0].alias='Changed'; copy.models[0].thinkingLevels.push('low');
diff --git a/crates/host-core/src/plugins/providers.rs b/crates/host-core/src/plugins/providers.rs
index 6d2f63d26..4b9d08f82 100644
--- a/crates/host-core/src/plugins/providers.rs
+++ b/crates/host-core/src/plugins/providers.rs
@@ -188,6 +188,9 @@ pub(crate) fn declared_providers(manifest: &PluginManifest) -> Vec<DeclaredPlugi
available_for_subagents: None,
native_web_search: None,
fast_mode_allowed: None,
+ allow_empty_thinking_signature: model
+ .get("allowEmptyThinkingSignature")
+ .and_then(Value::as_bool),
})
})
.collect::<Vec<_>>()
diff --git a/crates/host-core/src/plugins/providers/tests.rs b/crates/host-core/src/plugins/providers/tests.rs
index 77e691659..f142fe1c1 100644
--- a/crates/host-core/src/plugins/providers/tests.rs
+++ b/crates/host-core/src/plugins/providers/tests.rs
@@ -27,7 +27,7 @@ fn manifest() -> PluginManifest {
"apiStyle": "chat_completions",
"authKind": "api_key",
"models": [
- { "id": "demo-large", "name": "Demo Large", "contextWindow": 200000, "maxTokens": 8192 },
+ { "id": "demo-large", "name": "Demo Large", "contextWindow": 200000, "maxTokens": 8192, "allowEmptyThinkingSignature": true },
{ "id": "demo-small" }
]
}]
@@ -142,11 +142,24 @@ fn declared_providers_reads_the_manifest() {
["demo-large", "demo-small"]
);
assert_eq!(provider.models[0].context_window, 200_000);
- // A model that declares no limits falls back to the runtime default
- // instead of storing a zero window.
assert_eq!(provider.models[1].context_window, 0);
+ assert_eq!(
+ provider.models[0].allow_empty_thinking_signature,
+ Some(true)
+ );
+ assert_eq!(provider.models[1].allow_empty_thinking_signature, None);
}
+#[test]
+fn plugin_provider_rejects_non_boolean_empty_signature_opt_in() {
+ let temp = tempfile::tempdir().unwrap();
+ let mut value = serde_json::to_value(manifest()).unwrap();
+ value["contributes"]["providers"][0]["models"][0]["allowEmptyThinkingSignature"] = json!("yes");
+ write_plugin(temp.path(), value);
+ assert!(
+ read_manifest_err(temp.path()).contains("allowEmptyThinkingSignature must be a boolean")
+ );
+}
#[test]
fn provider_declarations_have_no_eight_row_cap() {
let ids: Vec<String> = (0..18).map(|index| format!("site-{index}")).collect();
diff --git a/crates/host-core/src/plugins/validation.rs b/crates/host-core/src/plugins/validation.rs
index 193062350..a948c206a 100644
--- a/crates/host-core/src/plugins/validation.rs
+++ b/crates/host-core/src/plugins/validation.rs
@@ -274,6 +274,11 @@ pub(crate) fn validate_contributions(root: &Path, manifest: &PluginManifest) ->
);
}
}
+ if let Some(allow_empty_signature) = model.get("allowEmptyThinkingSignature") {
+ if !allow_empty_signature.is_boolean() {
+ bail!("PLUGIN_INVALID: provider {id} model {model_id} allowEmptyThinkingSignature must be a boolean");
+ }
+ }
if seen_models.contains(&model_id) {
bail!("PLUGIN_INVALID: provider {id} declares model {model_id} twice");
}
diff --git a/crates/host-core/src/providers/catalog.rs b/crates/host-core/src/providers/catalog.rs
index 911fa339f..92c85d9c3 100644
--- a/crates/host-core/src/providers/catalog.rs
+++ b/crates/host-core/src/providers/catalog.rs
@@ -83,6 +83,7 @@ pub(crate) fn normalize_model_bindings(bindings: &[ModelBinding]) -> Vec<ModelBi
available_for_subagents: binding.available_for_subagents,
native_web_search: binding.native_web_search,
fast_mode_allowed: binding.fast_mode_allowed,
+ allow_empty_thinking_signature: binding.allow_empty_thinking_signature,
})
})
.collect()
@@ -108,6 +109,7 @@ fn legacy_model_binding(model_id: Option<String>) -> Vec<ModelBinding> {
available_for_subagents: None,
native_web_search: None,
fast_mode_allowed: None,
+ allow_empty_thinking_signature: None,
}]
})
.unwrap_or_default()
@@ -535,6 +537,7 @@ mod tests {
available_for_subagents: None,
native_web_search: None,
fast_mode_allowed: None,
+ allow_empty_thinking_signature: None,
}
}
diff --git a/crates/host-core/src/providers/model.rs b/crates/host-core/src/providers/model.rs
index 900c12ea4..cfa9ffe92 100644
--- a/crates/host-core/src/providers/model.rs
+++ b/crates/host-core/src/providers/model.rs
@@ -177,6 +177,9 @@ pub struct ModelBinding {
/// service tier for this model (ADR 0334). None/false keeps the default.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub fast_mode_allowed: Option<bool>,
+ /// Whether unsigned Anthropic thinking blocks may be replayed.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub allow_empty_thinking_signature: Option<bool>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
diff --git a/crates/host-core/src/providers/repository.rs b/crates/host-core/src/providers/repository.rs
index c51f650a6..33646fa52 100644
--- a/crates/host-core/src/providers/repository.rs
+++ b/crates/host-core/src/providers/repository.rs
@@ -113,6 +113,7 @@ fn hydrate_dynamic_plugin_models(db: &Database, provider: &mut ProviderPublic) -
available_for_subagents: None,
native_web_search: None,
fast_mode_allowed: None,
+ allow_empty_thinking_signature: None,
}
})
.collect();
diff --git a/crates/host-core/src/providers/tests.rs b/crates/host-core/src/providers/tests.rs
index 69bb14d74..0c92b2193 100644
--- a/crates/host-core/src/providers/tests.rs
+++ b/crates/host-core/src/providers/tests.rs
@@ -255,6 +255,7 @@ fn model_bindings_roundtrip_and_legacy_model_migrates_on_read() {
available_for_subagents: Some(true),
native_web_search: None,
fast_mode_allowed: Some(true),
+ allow_empty_thinking_signature: Some(true),
},
ModelBinding {
id: "plain-model".into(),
@@ -272,6 +273,7 @@ fn model_bindings_roundtrip_and_legacy_model_migrates_on_read() {
available_for_subagents: None,
native_web_search: None,
fast_mode_allowed: None,
+ allow_empty_thinking_signature: None,
},
]),
default_model_id: None,
@@ -325,9 +327,15 @@ fn model_bindings_roundtrip_and_legacy_model_migrates_on_read() {
assert!(config["models"][1].get("availableForSubagents").is_none());
assert!(config["models"][1].get("supportsImages").is_none());
assert_eq!(config["models"][0]["fastModeAllowed"], true);
+ assert_eq!(config["models"][0]["allowEmptyThinkingSignature"], true);
assert!(config["models"][1].get("fastModeAllowed").is_none());
assert_eq!(provider.models[0].supports_images, Some(true));
assert_eq!(provider.models[1].supports_documents, Some(false));
+ assert_eq!(
+ provider.models[0].allow_empty_thinking_signature,
+ Some(true)
+ );
+ assert_eq!(provider.models[1].allow_empty_thinking_signature, None);
let legacy = create_provider(
&db,
@@ -387,6 +395,7 @@ fn binding_with_alias(id: &str, alias: Option<&str>) -> ModelBinding {
available_for_subagents: None,
native_web_search: None,
fast_mode_allowed: None,
+ allow_empty_thinking_signature: None,
}
}
@@ -444,6 +453,59 @@ fn alias_survives_the_provider_config_round_trip() {
assert_eq!(restored[0].alias.as_deref(), Some("pro"));
assert_eq!(restored[1].alias, None);
}
+#[test]
+fn empty_thinking_signature_binding_survives_provider_storage_round_trip() {
+ let (_dir, db, secrets) = test_context();
+ let mut binding = binding_with_alias("relay-model", None);
+ binding.allow_empty_thinking_signature = Some(true);
+ let provider = create_provider(
+ &db,
+ &secrets,
+ ProviderCreateInput {
+ name: "Anthropic relay".into(),
+ vendor_key: Some("custom".into()),
+ provider_type: Some("openai_compatible".into()),
+ protocol: Some("anthropic".into()),
+ base_url: Some("https://relay.example/v1".into()),
+ auth_kind: Some("none".into()),
+ models: Some(vec![binding]),
+ default_model_id: None,
+ secret_value: None,
+ api_style: Some("anthropic_messages".into()),
+ oauth_account_label: None,
+ headers: None,
+ context_window: None,
+ max_output_tokens: None,
+ temperature: None,
+ supports_reasoning: None,
+ supported_thinking_levels: None,
+ },
+ )
+ .unwrap();
+
+ assert_eq!(
+ provider.models[0].allow_empty_thinking_signature,
+ Some(true)
+ );
+ let reloaded = get_provider(&db, &secrets, &provider.id).unwrap().unwrap();
+ assert_eq!(
+ reloaded.models[0].allow_empty_thinking_signature,
+ Some(true)
+ );
+ assert_eq!(
+ reloaded.models[0].id, "relay-model",
+ "the opt-in must stay bound to its configured model",
+ );
+}
+
+#[test]
+fn absent_empty_thinking_signature_binding_remains_disabled() {
+ let binding = binding_with_alias("relay-model", None);
+ let json = serde_json::to_value(&binding).unwrap();
+ assert!(json.get("allowEmptyThinkingSignature").is_none());
+ let restored: ModelBinding = serde_json::from_value(json).unwrap();
+ assert_eq!(restored.allow_empty_thinking_signature, None);
+}
#[test]
fn alias_survives_provider_create_and_update() {
@@ -1685,6 +1747,7 @@ fn binding_with_limits(id: &str, context_window: u32, max_tokens: u32) -> ModelB
available_for_subagents: None,
native_web_search: None,
fast_mode_allowed: None,
+ allow_empty_thinking_signature: None,
}
}
diff --git a/docs/spec/03-runtime/12-provider-config-schema.md b/docs/spec/03-runtime/12-provider-config-schema.md
index ca1cd7b9e..8162730ae 100644
--- a/docs/spec/03-runtime/12-provider-config-schema.md
+++ b/docs/spec/03-runtime/12-provider-config-schema.md
@@ -252,6 +252,11 @@ Host read/write and normalization preserve `true`; records created before this
field existed remain disabled by default. This flag is what Electron main uses
to build the delegation model catalog, so changing it survives provider edits
and application restarts.
+`models[].allowEmptyThinkingSignature` is an optional endpoint-specific opt-in.
+When `true`, Anthropic Messages replay keeps reasoning blocks with an empty
+signature as thinking blocks; otherwise the adapter default is unchanged.
+An explicit `false` overrides published compatibility metadata. The setting is
+persisted with its model binding and defaults to absent for existing providers.
`apiStyle: "opencode_go"` is a first-class OpenCode Go preset layered on the
OpenAI-compatible provider type. It persists as its own style so the UI can
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index a189fad06..f59f5750e 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -238,7 +238,7 @@ identify the platform validation still needed.
| E / F / Quality — MCP server timeout override | E2E-261 |
| A — App startup | E2E-001, E2E-002, E2E-003, E2E-004, E2E-067, E2E-076, E2E-079, E2E-092, E2E-097, E2E-143, E2E-150, E2E-168, E2E-204 |
| A / C / F / Quality — Tray session navigation | E2E-TRAY-bounded-session-navigation |
-| B — Model config | E2E-005, E2E-PROVIDER-custom-endpoint-no-api-key, E2E-006, E2E-007, E2E-038, E2E-050, E2E-052, E2E-055, E2E-066, E2E-080, E2E-082, E2E-102c, E2E-102d, E2E-102e, E2E-151, E2E-154, E2E-163, E2E-166, E2E-172, E2E-174, E2E-197, E2E-005G, E2E-005J, E2E-199, E2E-201, E2E-202, E2E-203, E2E-205, E2E-206, E2E-209, E2E-PLUGIN-provider-catalog-add-service |
+| B — Model config | E2E-005, E2E-PROVIDER-custom-endpoint-no-api-key, E2E-PROVIDER-unsigned-thinking-replay, E2E-006, E2E-007, E2E-038, E2E-050, E2E-052, E2E-055, E2E-066, E2E-080, E2E-082, E2E-102c, E2E-102d, E2E-102e, E2E-151, E2E-154, E2E-163, E2E-166, E2E-172, E2E-174, E2E-197, E2E-005G, E2E-005J, E2E-199, E2E-201, E2E-202, E2E-203, E2E-205, E2E-206, E2E-209, E2E-PLUGIN-provider-catalog-add-service |
| C — Conversation & stream | E2E-CHAT-long-history-stream-keeps-responsive, E2E-CHAT-running-status-survives-output-pauses, E2E-008, E2E-008d, E2E-008e, E2E-008a, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-031, E2E-040, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-052, E2E-053, E2E-054, E2E-055, E2E-059, E2E-059a, E2E-060c, E2E-060d, E2E-061, E2E-061a, E2E-062, E2E-064, E2E-065, E2E-068, E2E-071, E2E-073, E2E-074, E2E-075, E2E-081, E2E-083, E2E-084, E2E-086, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-COMPOSER-narrow-controls, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102g, E2E-106, E2E-109, E2E-111, E2E-114, E2E-116, E2E-117, E2E-118, E2E-119, E2E-120, E2E-121, E2E-218, E2E-259, E2E-219, E2E-AGENTS-001, E2E-142, E2E-144, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-151, E2E-154, E2E-155, E2E-158, E2E-159, E2E-161, E2E-162, E2E-166, E2E-172, E2E-173, E2E-174, E2E-177, E2E-178, E2E-179, E2E-180, E2E-182, E2E-183, E2E-187, E2E-198, E2E-199, E2E-202, E2E-203, E2E-207, E2E-208, E2E-CHAT-content-width-handles, E2E-250, E2E-102i, E2E-PLUGIN-session-orchestrator-real-workers, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-SUBAGENT-resume-a-settled-delegation |
| C — Conversation & stream (composer drafts) | E2E-011c, E2E-011c-1, E2E-011c-2 |
| D — Workspace | E2E-012, E2E-013, E2E-022B, E2E-024I, E2E-047, E2E-049, E2E-057, E2E-058, E2E-060, E2E-068, E2E-075, E2E-078, E2E-153, E2E-158, E2E-182, E2E-187, E2E-252 |
diff --git a/docs/spec/06-delivery/e2e/providers-and-models.md b/docs/spec/06-delivery/e2e/providers-and-models.md
index 5e381ba7e..195dddd98 100644
--- a/docs/spec/06-delivery/e2e/providers-and-models.md
+++ b/docs/spec/06-delivery/e2e/providers-and-models.md
@@ -226,6 +226,27 @@ with only Host API controlled. Running-turn configuration remains queued.
binding tests; desktop settings coverage remains part of the provider model
configuration E2E fixture.
+## E2E-PROVIDER-unsigned-thinking-replay
+
+- **Preconditions:** A saved Anthropic Messages custom provider backed by a
+ local mock SSE endpoint. The endpoint emits a non-empty thinking block with
+ an empty signature; no live credentials or external service.
+- **Steps:** In Settings → Models, open the custom model's Advanced options,
+ enable unsigned thinking replay, save, reload the provider configuration,
+ and send two prompts in one session. Capture the second outbound request.
+- **Expected:** The setting survives save and reload. The second request sends
+ the prior reasoning as `{ type: "thinking", signature: "" }`, not as an
+ assistant text block. An absent setting preserves existing adapter/catalog
+ behavior, and an explicit false overrides published metadata.
+- **Coverage:** Host provider storage round-trip tests, model binding tests,
+ and `pi-1.5-adapter-features.test.ts` use a local request fixture. Settings
+ control wiring is covered by `model-advanced-capabilities.test.mjs`.
+- **Specs:** `03-runtime/12-provider-config-schema.md` and
+ `07-plugins/02-plugin-manifest-schema.md`.
+- **Acceptance:** Persisted user configuration and second-request replay.
+- **Milestone:** Maintenance.
+- **Status:** Candidate regression coverage added.
+
## Provider & Key
## E2E-169: Default model picker selects a configured model
diff --git a/docs/spec/07-plugins/02-plugin-manifest-schema.md b/docs/spec/07-plugins/02-plugin-manifest-schema.md
index df049fa31..221efa928 100644
--- a/docs/spec/07-plugins/02-plugin-manifest-schema.md
+++ b/docs/spec/07-plugins/02-plugin-manifest-schema.md
@@ -388,8 +388,14 @@ type PluginProviderModelContrib = {
thinkingLevels?: string[];
/** New sessions use this level when it is present in `thinkingLevels`. */
defaultThinkingLevel?: string;
+ /** Preserve unsigned reasoning blocks when the Anthropic endpoint accepts them. */
+ allowEmptyThinkingSignature?: boolean;
};
```
+The opt-in is copied into the Host-owned model binding and survives provider
+reloads. It is only used when constructing Anthropic Messages requests;
+omitting it preserves the adapter default. Manifest validation rejects
+non-boolean values.
To materialize these fields, the Host trims entries, drops unknown canonical
names, removes duplicates, and preserves the remaining declaration order. An
absent or unusable list becomes an empty binding. `defaultThinkingLevel` is kept
diff --git a/packages/agent-runtime/src/model-capabilities.test.ts b/packages/agent-runtime/src/model-capabilities.test.ts
index b72b1ef62..5856be934 100644
--- a/packages/agent-runtime/src/model-capabilities.test.ts
+++ b/packages/agent-runtime/src/model-capabilities.test.ts
@@ -288,3 +288,28 @@ it("keeps native Pi null and absent extended mappings unavailable", () => {
expect(configured.thinkingLevelMap?.xhigh).toBeNull();
expect(configured.thinkingLevelMap?.max).toBeUndefined();
});
+describe("unsigned thinking signature model binding", () => {
+ const model = {
+ ...genericModelConfig("relay-model", "https://relay.example"),
+ reasoning: true,
+ compat: { supportsStrictTools: true, allowEmptySignature: false },
+ };
+ const base = {
+ contextWindow: 128_000,
+ maxTokens: 8_192,
+ thinkingLevels: ["off", "high"] as ThinkingLevel[],
+ };
+
+ it("preserves catalog compat when the binding is absent", () => {
+ const config = modelConfigWithBinding(model, base);
+ expect(config.compat).toEqual({ supportsStrictTools: true, allowEmptySignature: false });
+ });
+
+ it.each([true, false])("lets the explicit binding value %s override catalog compat", (value) => {
+ const config = modelConfigWithBinding(model, {
+ ...base,
+ allowEmptyThinkingSignature: value,
+ });
+ expect(config.compat).toEqual({ supportsStrictTools: true, allowEmptySignature: value });
+ });
+});
diff --git a/packages/agent-runtime/src/model-capabilities.ts b/packages/agent-runtime/src/model-capabilities.ts
index 6a6496b72..62f0111ec 100644
--- a/packages/agent-runtime/src/model-capabilities.ts
+++ b/packages/agent-runtime/src/model-capabilities.ts
@@ -102,6 +102,7 @@ export function modelConfigWithBinding(
| "supportsImages"
| "supportsDocuments"
| "nativeWebSearch"
+ | "allowEmptyThinkingSignature"
>
| null,
): ModelConfig {
@@ -135,10 +136,17 @@ export function modelConfigWithBinding(
? requestedLevels.filter(level => model.supportedThinkingLevels?.includes(level))
: requestedLevels;
const thinkingLevelMap = { ...(model.thinkingLevelMap ?? {}) };
- const compat = binding.thinkingProtocol
+ const hasCompatOverride = binding.thinkingProtocol !== undefined ||
+ binding.allowEmptyThinkingSignature !== undefined;
+ const compat = hasCompatOverride
? {
...(model.compat ?? {}),
- forceAdaptiveThinking: binding.thinkingProtocol === "adaptive",
+ ...(binding.thinkingProtocol
+ ? { forceAdaptiveThinking: binding.thinkingProtocol === "adaptive" }
+ : {}),
+ ...(binding.allowEmptyThinkingSignature !== undefined
+ ? { allowEmptySignature: binding.allowEmptyThinkingSignature }
+ : {}),
}
: model.compat;
// pi-ai treats xhigh/max as unsupported when their adapter-facing mapping
diff --git a/packages/agent-runtime/src/pi-1.5-adapter-features.test.ts b/packages/agent-runtime/src/pi-1.5-adapter-features.test.ts
index 2f175978e..e035ea572 100644
--- a/packages/agent-runtime/src/pi-1.5-adapter-features.test.ts
+++ b/packages/agent-runtime/src/pi-1.5-adapter-features.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
import { normalizeContext, type AssistantMessage, type Message } from "@earendil-works/pi-ai";
import { getBuiltinModel } from "@earendil-works/pi-ai/providers/all";
import { buildProviderModel, createProviderModels, type RuntimeProviderConfig } from "./provider-binding.js";
-import { modelConfigFromPi } from "./model-capabilities.js";
+import { genericModelConfig, modelConfigFromPi, modelConfigWithBinding } from "./model-capabilities.js";
import { classifyProviderError, isTransientProviderRetryCode } from "./provider-retry.js";
function anthropic(id: "claude-haiku-5-5" | "claude-opus-5" = "claude-haiku-5-5"): RuntimeProviderConfig {
@@ -124,3 +124,66 @@ describe("Pi 1.5 adapters through Desktop provider binding", () => {
expect(isTransientProviderRetryCode(error.code)).toBe(true);
});
});
+
+describe("Anthropic unsigned thinking replay", () => {
+ const baseModelConfig = {
+ ...genericModelConfig("relay-model", "https://anthropic-relay.invalid"),
+ reasoning: true,
+ };
+ const replay: Message[] = [
+ { role: "user", content: "First question", timestamp: 1 },
+ {
+ role: "assistant",
+ api: "anthropic-messages",
+ provider: "custom",
+ model: "relay-model",
+ content: [
+ { type: "thinking", thinking: "prior reasoning", thinkingSignature: "" },
+ { type: "text", text: "Prior answer" },
+ ],
+ usage,
+ stopReason: "stop",
+ timestamp: 2,
+ },
+ { role: "user", content: "Second question", timestamp: 3 },
+ ];
+
+ function providerWithBinding(allowEmptyThinkingSignature?: boolean): RuntimeProviderConfig {
+ const modelConfig = modelConfigWithBinding(baseModelConfig, {
+ contextWindow: 128_000,
+ maxTokens: 8_192,
+ thinkingLevels: ["off", "high"],
+ ...(allowEmptyThinkingSignature !== undefined ? { allowEmptyThinkingSignature } : {}),
+ });
+ return {
+ id: "relay-row",
+ name: "Anthropic relay",
+ vendorKey: "custom",
+ modelId: "relay-model",
+ baseUrl: "https://anthropic-relay.invalid",
+ apiKey: "fixture",
+ apiStyle: "anthropic_messages",
+ supportsReasoning: true,
+ supportedThinkingLevels: ["off", "high"],
+ modelConfig,
+ };
+ }
+
+ it("replays unsigned thinking as a thinking block on the next request after opt-in", async () => {
+ const payload = await anthropicRequest(providerWithBinding(true), replay, "high");
+ const assistant = payload.messages.find((message) => message.role === "assistant");
+ expect(assistant?.content).toEqual([
+ { type: "thinking", thinking: "prior reasoning", signature: "" },
+ { type: "text", text: "Prior answer" },
+ ]);
+ });
+
+ it.each([undefined, false])("keeps adapter defaults unchanged without opt-in (%s)", async (value) => {
+ const payload = await anthropicRequest(providerWithBinding(value), replay, "high");
+ const assistant = payload.messages.find((message) => message.role === "assistant");
+ expect(assistant?.content).toEqual([
+ { type: "text", text: "prior reasoning" },
+ { type: "text", text: "Prior answer" },
+ ]);
+ });
+});
diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.ts
index 06a75045a..d9a12f5d9 100644
--- a/packages/i18n/src/locales/de/index.ts
+++ b/packages/i18n/src/locales/de/index.ts
@@ -2096,6 +2096,9 @@ sklm: {
fastModeAllowedSubscriptionHint: "Erlaubt /fast, für dieses Modell die Prioritätsstufe von OpenAI anzufordern. Antworten kommen schneller und verbrauchen mehr Nutzungslimit deines ChatGPT-Abos.",
fastModeAllowedUsageHint: "Erlaubt /fast, für dieses Modell die Prioritätsstufe von OpenAI (service_tier) anzufordern. OpenAI berechnet dafür einen höheren Preis pro Token; ein Relay kann das Feld ignorieren oder anders abrechnen.",
fastModeAllowedUnsupported: "Der Fast-Modus braucht die OpenAI Responses API oder ein ChatGPT-Abo.",
+ allowEmptyThinkingSignature: "Allow unsigned thinking replay",
+ allowEmptyThinkingSignatureHint: "Send thinking blocks without a signature back to Anthropic Messages endpoints that support unsigned reasoning.",
+ allowEmptyThinkingSignatureDefaultHint: "Uses the endpoint's published or adapter default.",
"searchModelId": "Modell-ID suchen…",
"searchChosenModels": "Hinzugefügte Modelle suchen…",
"noChosenModelMatches": "Keine passenden hinzugefügten Modelle.",
diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.ts
index 4604d7347..7af35c435 100644
--- a/packages/i18n/src/locales/en/index.ts
+++ b/packages/i18n/src/locales/en/index.ts
@@ -2116,6 +2116,9 @@ sklm: {
fastModeAllowedSubscriptionHint: "Let /fast request OpenAI's priority tier for this model. Replies come faster and use more of your ChatGPT plan's usage limits.",
fastModeAllowedUsageHint: "Let /fast request OpenAI's priority tier (service_tier) for this model. OpenAI bills the tier at a higher per-token price; a relay may ignore the field or bill it differently.",
fastModeAllowedUnsupported: "Fast mode needs the OpenAI Responses API or a ChatGPT subscription.",
+ allowEmptyThinkingSignature: "Allow unsigned thinking replay",
+ allowEmptyThinkingSignatureHint: "Send thinking blocks without a signature back to Anthropic Messages endpoints that support unsigned reasoning.",
+ allowEmptyThinkingSignatureDefaultHint: "Uses the endpoint's published or adapter default.",
searchModelId: "Search model ID…",
searchChosenModels: "Search added models…",
noChosenModelMatches: "No matching added models.",
diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.ts
index 886ad6ba0..1b4ed6823 100644
--- a/packages/i18n/src/locales/es/index.ts
+++ b/packages/i18n/src/locales/es/index.ts
@@ -2096,6 +2096,9 @@ sklm: {
fastModeAllowedSubscriptionHint: "Permite que /fast pida el nivel prioritario de OpenAI para este modelo. Las respuestas llegan antes y consumen más del límite de uso de tu plan de ChatGPT.",
fastModeAllowedUsageHint: "Permite que /fast pida el nivel prioritario de OpenAI (service_tier) para este modelo. OpenAI lo factura a un precio por token más alto; un relay puede ignorar el campo o facturarlo de otra forma.",
fastModeAllowedUnsupported: "El modo Fast necesita la API Responses de OpenAI o una suscripción a ChatGPT.",
+ allowEmptyThinkingSignature: "Allow unsigned thinking replay",
+ allowEmptyThinkingSignatureHint: "Send thinking blocks without a signature back to Anthropic Messages endpoints that support unsigned reasoning.",
+ allowEmptyThinkingSignatureDefaultHint: "Uses the endpoint's published or adapter default.",
"searchModelId": "ID de modelo de búsqueda…",
"searchChosenModels": "Buscar modelos añadidos…",
"noChosenModelMatches": "No hay modelos añadidos que coincidan.",
diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.ts
index f44c691d6..1bbfc39a1 100644
--- a/packages/i18n/src/locales/fr/index.ts
+++ b/packages/i18n/src/locales/fr/index.ts
@@ -2096,6 +2096,9 @@ sklm: {
fastModeAllowedSubscriptionHint: "Autorise /fast à demander le niveau prioritaire d'OpenAI pour ce modèle. Les réponses arrivent plus vite et consomment davantage les limites de votre abonnement ChatGPT.",
fastModeAllowedUsageHint: "Autorise /fast à demander le niveau prioritaire d'OpenAI (service_tier) pour ce modèle. OpenAI le facture à un prix par token plus élevé ; un relais peut ignorer ce champ ou le facturer autrement.",
fastModeAllowedUnsupported: "Le mode Fast nécessite l'API Responses d'OpenAI ou un abonnement ChatGPT.",
+ allowEmptyThinkingSignature: "Allow unsigned thinking replay",
+ allowEmptyThinkingSignatureHint: "Send thinking blocks without a signature back to Anthropic Messages endpoints that support unsigned reasoning.",
+ allowEmptyThinkingSignatureDefaultHint: "Uses the endpoint's published or adapter default.",
"searchModelId": "ID de modèle de recherche…",
"searchChosenModels": "Rechercher les modèles ajoutés…",
"noChosenModelMatches": "Aucun modèle ajouté correspondant.",
diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.ts
index 076df20a3..8f122b16d 100644
--- a/packages/i18n/src/locales/ko/index.ts
+++ b/packages/i18n/src/locales/ko/index.ts
@@ -2112,6 +2112,9 @@ sklm: {
fastModeAllowedSubscriptionHint: "/fast가 이 모델에 OpenAI 우선 등급을 요청하도록 허용합니다. 응답이 더 빨라지고 ChatGPT 구독 사용 한도를 더 많이 소모합니다.",
fastModeAllowedUsageHint: "/fast가 이 모델에 OpenAI 우선 등급(service_tier)을 요청하도록 허용합니다. OpenAI는 더 높은 토큰 단가로 청구하며, 중계 서비스는 이 필드를 무시하거나 다르게 청구할 수 있습니다.",
fastModeAllowedUnsupported: "Fast 모드는 OpenAI Responses API 또는 ChatGPT 구독이 필요합니다.",
+ allowEmptyThinkingSignature: "Allow unsigned thinking replay",
+ allowEmptyThinkingSignatureHint: "Send thinking blocks without a signature back to Anthropic Messages endpoints that support unsigned reasoning.",
+ allowEmptyThinkingSignatureDefaultHint: "Uses the endpoint's published or adapter default.",
searchModelId: "모델 ID 검색…",
searchChosenModels: "추가된 모델 검색…",
noChosenModelMatches: "일치하는 추가된 모델이 없습니다.",
diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.ts
index d94718896..0de8347fe 100644
--- a/packages/i18n/src/locales/pt-BR/index.ts
+++ b/packages/i18n/src/locales/pt-BR/index.ts
@@ -2066,6 +2066,9 @@ export const ptBR = {
fastModeAllowedSubscriptionHint: "Permite que /fast peça o nível prioritário da OpenAI para este modelo. As respostas chegam mais rápido e consomem mais do limite de uso do seu plano do ChatGPT.",
fastModeAllowedUsageHint: "Permite que /fast peça o nível prioritário da OpenAI (service_tier) para este modelo. A OpenAI cobra um preço por token mais alto; um relay pode ignorar o campo ou cobrar de outra forma.",
fastModeAllowedUnsupported: "O modo Fast precisa da API Responses da OpenAI ou de uma assinatura do ChatGPT.",
+ allowEmptyThinkingSignature: "Allow unsigned thinking replay",
+ allowEmptyThinkingSignatureHint: "Send thinking blocks without a signature back to Anthropic Messages endpoints that support unsigned reasoning.",
+ allowEmptyThinkingSignatureDefaultHint: "Uses the endpoint's published or adapter default.",
searchModelId: "ID de modelo de pesquisa…",
searchChosenModels: "Pesquisar modelos adicionados…",
noChosenModelMatches: "Nenhum modelo escolhido corresponde à busca.",
diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.ts
index 720c7b7a0..617c2dc51 100644
--- a/packages/i18n/src/locales/tr/index.ts
+++ b/packages/i18n/src/locales/tr/index.ts
@@ -2106,6 +2106,9 @@ sklm: {
fastModeAllowedSubscriptionHint: "/fast komutunun bu model için OpenAI öncelikli katmanını istemesine izin verir. Yanıtlar daha hızlı gelir ve ChatGPT planınızın kullanım sınırından daha fazla harcar.",
fastModeAllowedUsageHint: "/fast komutunun bu model için OpenAI öncelikli katmanını (service_tier) istemesine izin verir. OpenAI bunu daha yüksek token fiyatıyla ücretlendirir; bir aktarıcı alanı yok sayabilir veya farklı ücretlendirebilir.",
fastModeAllowedUnsupported: "Fast modu, OpenAI Responses API'si veya ChatGPT aboneliği gerektirir.",
+ allowEmptyThinkingSignature: "Allow unsigned thinking replay",
+ allowEmptyThinkingSignatureHint: "Send thinking blocks without a signature back to Anthropic Messages endpoints that support unsigned reasoning.",
+ allowEmptyThinkingSignatureDefaultHint: "Uses the endpoint's published or adapter default.",
searchModelId: "Model kimliği ara…",
searchChosenModels: "Eklenen modellerde ara…",
noChosenModelMatches: "Eşleşen eklenen model yok.",
diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.ts
index 064454021..5d99c96e9 100644
--- a/packages/i18n/src/locales/zh-CN/index.ts
+++ b/packages/i18n/src/locales/zh-CN/index.ts
@@ -2092,6 +2092,9 @@ sklm: {
fastModeAllowedUsageHint: "允许 /fast 为该模型请求 OpenAI 优先档位(service_tier)。OpenAI 按更高的 token 单价计费;中转服务可能忽略该字段或另行计费。",
fastModeAllowedUnsupported: "Fast 模式需要 OpenAI Responses 接口或 ChatGPT 订阅。",
searchModelId: "搜索模型 ID…",
+ allowEmptyThinkingSignature: "允许回放无签名思考",
+ allowEmptyThinkingSignatureHint: "仅对支持无签名推理的 Anthropic Messages 端点开启;后续请求会继续按思考块回放。",
+ allowEmptyThinkingSignatureDefaultHint: "使用端点目录或适配器默认行为。",
searchChosenModels: "搜索已添加模型…",
noChosenModelMatches: "没有匹配的已添加模型",
selectAllVisibleModels: "全选",
diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.ts
index 3fd98389f..92c4f2719 100644
--- a/packages/i18n/src/locales/zh-TW/index.ts
+++ b/packages/i18n/src/locales/zh-TW/index.ts
@@ -2091,6 +2091,9 @@ sklm: {
fastModeAllowedSubscriptionHint: "允許 /fast 為此模型請求 OpenAI 優先層級:回覆更快,但會更快消耗 ChatGPT 訂閱額度。",
fastModeAllowedUsageHint: "允許 /fast 為此模型請求 OpenAI 優先層級(service_tier)。OpenAI 以較高的 token 單價計費;中轉服務可能忽略此欄位或另行計費。",
fastModeAllowedUnsupported: "Fast 模式需要 OpenAI Responses 介面或 ChatGPT 訂閱。",
+ allowEmptyThinkingSignature: "Allow unsigned thinking replay",
+ allowEmptyThinkingSignatureHint: "Send thinking blocks without a signature back to Anthropic Messages endpoints that support unsigned reasoning.",
+ allowEmptyThinkingSignatureDefaultHint: "Uses the endpoint's published or adapter default.",
searchModelId: "搜尋模型 ID…",
searchChosenModels: "搜尋已新增模型…",
noChosenModelMatches: "沒有符合的已新增模型",
diff --git a/packages/plugin-sdk/src/index.test.ts b/packages/plugin-sdk/src/index.test.ts
index 504042497..22e90c827 100644
--- a/packages/plugin-sdk/src/index.test.ts
+++ b/packages/plugin-sdk/src/index.test.ts
@@ -1030,8 +1030,13 @@ describe("contributes.providers", () => {
},
}).error,
).toMatch(/defaultThinkingLevel must be a string/);
+ expect(
+ validateManifest({
+ ...perm,
+ contributes: { providers: [{ ...provider, models: [{ ...provider.models[0], allowEmptyThinkingSignature: "yes" as never }] }] },
+ }).error,
+ ).toMatch(/allowEmptyThinkingSignature must be a boolean/);
});
-
it("requires provider.oauth and accepts a declared OAuth provider", () => {
const oauthProvider: PluginProviderContrib = {
...provider,
diff --git a/packages/plugin-sdk/src/index.ts b/packages/plugin-sdk/src/index.ts
index aba3b7b8e..711fdbe1e 100644
--- a/packages/plugin-sdk/src/index.ts
+++ b/packages/plugin-sdk/src/index.ts
@@ -759,6 +759,8 @@ export type PluginProviderModelContrib = {
* one of them. Omit to let the runtime pick the first available level.
*/
defaultThinkingLevel?: string;
+ /** Whether Anthropic Messages requests can replay unsigned thinking blocks. */
+ allowEmptyThinkingSignature?: boolean;
};
/**
@@ -2343,6 +2345,12 @@ export function validateContributions(
if (model.defaultThinkingLevel !== undefined && typeof model.defaultThinkingLevel !== "string") {
return `provider "${provider.id}" model ${modelId} defaultThinkingLevel must be a string`;
}
+ if (
+ model.allowEmptyThinkingSignature !== undefined &&
+ typeof model.allowEmptyThinkingSignature !== "boolean"
+ ) {
+ return `provider "${provider.id}" model ${modelId} allowEmptyThinkingSignature must be a boolean`;
+ }
}
}
diff --git a/packages/shared/src/provider-sync.test.ts b/packages/shared/src/provider-sync.test.ts
index 16919ab82..b2fa1849a 100644
--- a/packages/shared/src/provider-sync.test.ts
+++ b/packages/shared/src/provider-sync.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
import { isSyncableProvider, parseProviderImportPayload, parseProviderImportSummary, PROVIDER_SYNC_MAX_PROVIDERS } from "./provider-sync.js";
import type { ProviderPublic } from "./types/providers.js";
-const model = { id: "model/a", contextWindow: 120000, maxTokens: 8000, thinkingLevels: ["off", "high"] as const, defaultThinkingLevel: "high", thinkingProtocol: "adaptive", nativeWebSearch: true };
+const model = { id: "model/a", contextWindow: 120000, maxTokens: 8000, thinkingLevels: ["off", "high"] as const, defaultThinkingLevel: "high", thinkingProtocol: "adaptive", nativeWebSearch: true, allowEmptyThinkingSignature: true };
function payload() {
return { version: 1, providers: [{ sourceId: "local-1", input: {
name: "Custom", vendorKey: "custom", type: "openai_compatible", protocol: "openai_compatible",
@@ -18,6 +18,14 @@ describe("provider sync boundary", () => {
Object.assign(input.providers[0]!.input.models[0]!, { supportsReasoningEffort });
expect(parseProviderImportPayload(input)).toEqual(input);
});
+ it("preserves unsigned thinking opt-in and validates explicit opt-out", () => {
+ const input = payload();
+ expect(parseProviderImportPayload(input).providers[0]!.input.models![0]!.allowEmptyThinkingSignature).toBe(true);
+ input.providers[0]!.input.models![0]!.allowEmptyThinkingSignature = false;
+ expect(parseProviderImportPayload(input).providers[0]!.input.models![0]!.allowEmptyThinkingSignature).toBe(false);
+ input.providers[0]!.input.models![0]!.allowEmptyThinkingSignature = "yes" as never;
+ expect(() => parseProviderImportPayload(input)).toThrow("Invalid provider import payload");
+ });
it("preserves current model settings and meaningful zero values", () => {
const input = payload();
expect(parseProviderImportPayload(input)).toEqual(input);
diff --git a/packages/shared/src/provider-sync.ts b/packages/shared/src/provider-sync.ts
index 8db9c67af..66a8e85cd 100644
--- a/packages/shared/src/provider-sync.ts
+++ b/packages/shared/src/provider-sync.ts
@@ -23,7 +23,7 @@ const API_STYLES = new Set(["auto", "chat_completions", "responses", "anthropic_
const EXCLUDED_VENDORS = new Set(["claude-cli", "codex", "openai-codex", "github-copilot", "google-antigravity", "google-gemini-cli", "ollama", "lmstudio", "lm-studio", "local"]);
const RESERVED_HEADERS = new Set(["authorization", "proxy-authorization", "x-api-key", "api-key", "x-goog-api-key", "cookie", "set-cookie", "host", "content-type", "content-length", "connection", "transfer-encoding", "te", "trailer", "upgrade", "keep-alive", "chatgpt-account-id", "x-opencode-session"]);
const INPUT_FIELDS = ["name", "vendorKey", "type", "protocol", "baseUrl", "authKind", "models", "defaultModelId", "secretValue", "apiStyle", "headers", "supportsReasoning", "supportedThinkingLevels", "contextWindow", "maxOutputTokens", "temperature"];
-const MODEL_FIELDS = ["id", "alias", "contextWindow", "contextWindowSource", "maxTokens", "maxTokensSource", "thinkingLevels", "defaultThinkingLevel", "thinkingProtocol", "supportsReasoningEffort", "supportsImages", "supportsDocuments", "availableForSubagents", "nativeWebSearch", "fastModeAllowed"];
+const MODEL_FIELDS = ["id", "alias", "contextWindow", "contextWindowSource", "maxTokens", "maxTokensSource", "thinkingLevels", "defaultThinkingLevel", "thinkingProtocol", "supportsReasoningEffort", "supportsImages", "supportsDocuments", "availableForSubagents", "nativeWebSearch", "fastModeAllowed", "allowEmptyThinkingSignature"];
function invalid(): never {
// Never include input values, unknown field names, parser diagnostics or causes.
@@ -85,7 +85,7 @@ function validateModel(value: unknown): ModelBinding {
for (const key of ["supportsImages", "supportsDocuments", "supportsReasoningEffort"] as const) {
if (value[key] !== undefined && value[key] !== null && typeof value[key] !== "boolean") invalid();
}
- for (const key of ["availableForSubagents", "nativeWebSearch", "fastModeAllowed"] as const) {
+ for (const key of ["availableForSubagents", "nativeWebSearch", "fastModeAllowed", "allowEmptyThinkingSignature"] as const) {
if (value[key] !== undefined && typeof value[key] !== "boolean") invalid();
}
return value as ModelBinding;
diff --git a/packages/shared/src/types/models.ts b/packages/shared/src/types/models.ts
index f28c6517c..0613a56a4 100644
--- a/packages/shared/src/types/models.ts
+++ b/packages/shared/src/types/models.ts
@@ -262,6 +262,12 @@ export type ModelBinding = {
* tier; only Responses wires carry it (`fastModeSupportedOn`).
*/
fastModeAllowed?: boolean;
+ /**
+ * Whether Anthropic Messages requests may replay thinking blocks without a
+ * signature. Absent preserves the adapter default; explicit false overrides
+ * any published endpoint metadata.
+ */
+ allowEmptyThinkingSignature?: boolean;
};
export const MODEL_MODALITIES = ["text", "image", "audio", "video", "pdf"] as const;