Support Codex 0.134 approvals
Use available approval decisions from the app-server schema, preserve structured policy decisions in callbacks, and keep approval rendering aligned with normal tool-call output. Also simplify thread commands, clear stale active turns more carefully, and update command/help docs.
This commit is contained in:
@@ -72,9 +72,33 @@ func TestStoreUsersWorkspacesSessions(t *testing.T) {
|
||||
if session.SettingsChatID != 1001 || session.SettingsMessageID != 2002 {
|
||||
t.Fatalf("settings message not saved: %+v", session)
|
||||
}
|
||||
thread, err := st.CreateThread(ctx, 42, "codex-thread-123", ws.ID, "test thread")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := st.SetActiveThread(ctx, 42, thread.ID); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := st.SetActiveTurn(ctx, 42, "turn-123"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
turns, err := st.ListActiveTurns(ctx)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(turns) != 1 || turns[0].TelegramUserID != 42 || turns[0].CodexThreadID != "codex-thread-123" || turns[0].TurnID != "turn-123" {
|
||||
t.Fatalf("active turns not listed: %+v", turns)
|
||||
}
|
||||
if err := st.ClearActiveTurn(ctx, 42, "other-turn"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
session, err = st.GetSession(ctx, 42)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if session.ActiveTurnID != "turn-123" {
|
||||
t.Fatalf("wrong turn cleared: %+v", session)
|
||||
}
|
||||
if err := st.ClearActiveTurns(ctx); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user