Sync thread workspaces from Codex cwd

This commit is contained in:
Codex
2026-05-21 09:56:47 +00:00
parent 1d433038ab
commit a73f88fe5e
5 changed files with 120 additions and 29 deletions

View File

@@ -79,6 +79,7 @@ func TestClientWebSocketUnixJSONRPC(t *testing.T) {
if err := conn.WriteJSON(map[string]any{
"id": start["id"],
"result": map[string]any{
"cwd": "/tmp/project",
"thread": map[string]any{"id": "thr_1", "preview": "test"},
},
}); err != nil {
@@ -104,7 +105,7 @@ func TestClientWebSocketUnixJSONRPC(t *testing.T) {
if err := conn.WriteJSON(map[string]any{
"id": readThread["id"],
"result": map[string]any{
"thread": map[string]any{"id": "thr_1", "name": "Read title", "preview": "test"},
"thread": map[string]any{"id": "thr_1", "name": "Read title", "preview": "test", "cwd": "/tmp/project"},
},
}); err != nil {
serverDone <- err
@@ -167,14 +168,14 @@ func TestClientWebSocketUnixJSONRPC(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if thread.ID != "thr_1" {
if thread.ID != "thr_1" || thread.CWD != "/tmp/project" {
t.Fatalf("unexpected thread: %+v", thread)
}
readThread, err := client.ReadThread(ctx, "thr_1")
if err != nil {
t.Fatal(err)
}
if readThread.ID != "thr_1" || readThread.Name != "Read title" {
if readThread.ID != "thr_1" || readThread.Name != "Read title" || readThread.CWD != "/tmp/project" {
t.Fatalf("unexpected read thread: %+v", readThread)
}
if err := client.SetThreadName(ctx, "thr_1", "Short title"); err != nil {