mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 12:26:38 -06:00
fix(ios): native Talk respects session thinking level (#112901)
* fix(ios): inherit thinking in native Talk * test(ios): verify native Talk thinking inheritance * test(ios): keep Talk regression i18n-neutral * test(ios): import Talk request builder module * test(secrets): secure plugin preset fixture --------- Co-authored-by: RECOVERI <alfred@recoveri.io>
This commit is contained in:
committed by
GitHub
parent
c5ea0787a2
commit
26e4dec8c9
@@ -2781,7 +2781,7 @@ final class TalkModeManager: NSObject {
|
||||
agentID: nil,
|
||||
expectedSessionRoutingContract: nil,
|
||||
message: message,
|
||||
thinking: "low",
|
||||
thinking: Self.chatThinkingOverride,
|
||||
idempotencyKey: idempotencyKey,
|
||||
attachments: [],
|
||||
runTimeoutMs: 30000)
|
||||
@@ -5168,6 +5168,10 @@ extension TalkModeManager {
|
||||
}
|
||||
#endif
|
||||
|
||||
extension TalkModeManager {
|
||||
static let chatThinkingOverride: String? = nil
|
||||
}
|
||||
|
||||
private struct IncrementalSpeechContext: Equatable {
|
||||
let apiKey: String?
|
||||
let voiceId: String?
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import AVFoundation
|
||||
import Foundation
|
||||
import OpenClawChatUI
|
||||
import OpenClawKit
|
||||
import Testing
|
||||
@testable import OpenClaw
|
||||
@@ -1064,6 +1065,26 @@ struct TalkModeManagerTests {
|
||||
runId: "missing-run") == nil)
|
||||
}
|
||||
|
||||
@Test func `native Talk chat request inherits thinking policy`() {
|
||||
let request = OpenClawChatGatewayRequests.sendMessage(
|
||||
sessionKey: "agent:main:main",
|
||||
agentID: nil,
|
||||
expectedSessionRoutingContract: nil,
|
||||
message: "hello",
|
||||
thinking: TalkModeManager.chatThinkingOverride,
|
||||
idempotencyKey: "talk-1",
|
||||
attachments: [],
|
||||
runTimeoutMs: 30000)
|
||||
|
||||
#expect(TalkModeManager.chatThinkingOverride == nil)
|
||||
#expect(request.method == "chat.send")
|
||||
#expect(request.params["message"]?.value as? String == "hello")
|
||||
#expect(request.params["sessionKey"]?.value as? String == "agent:main:main")
|
||||
#expect(request.params["idempotencyKey"]?.value as? String == "talk-1")
|
||||
#expect(request.params["thinking"] == nil)
|
||||
#expect(request.params["timeoutMs"]?.value as? Int == 30000)
|
||||
}
|
||||
|
||||
@Test func `subscribes before sending chat completion request`() throws {
|
||||
let testsURL = URL(fileURLWithPath: #filePath).deletingLastPathComponent()
|
||||
let sourceURL = testsURL
|
||||
|
||||
@@ -551,8 +551,8 @@ describe("secret provider integration presets", () => {
|
||||
const rootDir = makeTempDir();
|
||||
const resolverPath = path.join(rootDir, "bin", "resolve.mjs");
|
||||
fs.writeFileSync(path.join(rootDir, "index.ts"), "export default {};\n", "utf8");
|
||||
fs.mkdirSync(path.dirname(resolverPath));
|
||||
fs.writeFileSync(
|
||||
makeSecureDir(path.dirname(resolverPath));
|
||||
writeSecureFile(
|
||||
resolverPath,
|
||||
[
|
||||
"let input = '';",
|
||||
@@ -564,7 +564,6 @@ describe("secret provider integration presets", () => {
|
||||
" process.stdout.write(JSON.stringify({ protocolVersion: 1, values }));",
|
||||
"});",
|
||||
].join("\n"),
|
||||
"utf8",
|
||||
);
|
||||
fs.writeFileSync(
|
||||
path.join(rootDir, "openclaw.plugin.json"),
|
||||
|
||||
Reference in New Issue
Block a user