Sync thread names from Codex

This commit is contained in:
Codex
2026-05-21 09:47:05 +00:00
parent 660458af32
commit 1d433038ab
5 changed files with 162 additions and 21 deletions

View File

@@ -203,6 +203,22 @@ func (c *Client) ResumeThread(ctx context.Context, threadID string) (Thread, err
return result.Thread, nil
}
func (c *Client) ReadThread(ctx context.Context, threadID string) (Thread, error) {
if err := c.EnsureConnected(ctx); err != nil {
return Thread{}, err
}
var result struct {
Thread Thread `json:"thread"`
}
if err := c.call(ctx, "thread/read", map[string]any{
"threadId": threadID,
"includeTurns": false,
}, &result); err != nil {
return Thread{}, err
}
return result.Thread, nil
}
func (c *Client) ForkThread(ctx context.Context, threadID string) (Thread, error) {
if err := c.EnsureConnected(ctx); err != nil {
return Thread{}, err