Use app-server thread name method

This commit is contained in:
Codex
2026-05-21 09:35:32 +00:00
parent bc866d1224
commit 660458af32
3 changed files with 5 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ Keep thread titles short and useful for later resume lists.
## How to Rename
- If the client exposes a thread rename or `thread/setName` capability, use it with the concise title.
- If the client exposes a thread rename or `thread/name/set` capability, use it with the concise title.
- If only Telegram commands are available, tell the user the exact `/rename TITLE` command to run.
- If no rename mechanism is available, include a short suggested title in the final answer.

View File

@@ -229,7 +229,7 @@ func (c *Client) SetThreadName(ctx context.Context, threadID, name string) error
return err
}
var ignored json.RawMessage
return c.call(ctx, "thread/setName", map[string]any{
return c.call(ctx, "thread/name/set", map[string]any{
"threadId": threadID,
"name": name,
}, &ignored)

View File

@@ -91,14 +91,14 @@ func TestClientWebSocketUnixJSONRPC(t *testing.T) {
serverDone <- err
return
}
if setName["method"] != "thread/setName" {
serverDone <- unexpectedMessage("thread/setName", setName["method"])
if setName["method"] != "thread/name/set" {
serverDone <- unexpectedMessage("thread/name/set", setName["method"])
return
}
params := setName["params"].(map[string]any)
if params["threadId"] != "thr_1" || params["name"] != "Short title" {
payload, _ := json.Marshal(params)
serverDone <- unexpectedMessage("thread/setName params", string(payload))
serverDone <- unexpectedMessage("thread/name/set params", string(payload))
return
}
if err := conn.WriteJSON(map[string]any{"id": setName["id"], "result": map[string]any{}}); err != nil {