From 02b4c7a35ac0b714bc045d54fb4bb45d1ce4e490 Mon Sep 17 00:00:00 2001 From: t Date: Sat, 13 Jun 2026 23:45:59 -0600 Subject: Add Codex Responses support and session debugging Teach provider config and auth resolution about the Codex Responses dialect, including user-facing `style = "openai_responses"` with `dialect = "codex"`. Serialize and parse Responses traffic with provider-specific reasoning replay, assistant phase metadata, and robust function-call assembly keyed by `output_index` so streamed tool inputs survive proxy quirks and empty terminal payloads. Also persist thinking origins and message metadata across sessions, add the Anthropic interleaved-thinking header switch, write per-session debug logs, and improve the TUI and scripts for inspecting tool output and session costs. --- src/tui_selectors.zig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/tui_selectors.zig') diff --git a/src/tui_selectors.zig b/src/tui_selectors.zig index 590d321..e76f82d 100644 --- a/src/tui_selectors.zig +++ b/src/tui_selectors.zig @@ -89,7 +89,7 @@ pub const ReasoningOption = struct { pub fn forStyle(style: APIStyle) []const ReasoningOption { return switch (style) { // The Responses style takes the same reasoning-effort options. - .openai_chat, .openai_responses => &openai, + .openai_chat, .openai_responses, .openai_codex_responses => &openai, .anthropic_messages => &anthropic, }; } @@ -100,6 +100,7 @@ pub const ReasoningOption = struct { .openai_chat => |r| switch (cfg.*) { .openai_chat => |*c| c.reasoning = r, .openai_responses => |*c| c.reasoning = r, + .openai_codex_responses => |*c| c.reasoning = r, .anthropic_messages => {}, }, .anthropic_messages => |sel| switch (cfg.*) { @@ -110,7 +111,7 @@ pub const ReasoningOption = struct { c.effort = e; }, }, - .openai_chat, .openai_responses => {}, + .openai_chat, .openai_responses, .openai_codex_responses => {}, }, } } @@ -120,7 +121,8 @@ pub const ReasoningOption = struct { pub fn matches(self: ReasoningOption, cfg: ProviderConfig) bool { switch (self.value) { .openai_chat => |r| return (cfg == .openai_chat and cfg.openai_chat.reasoning == r) or - (cfg == .openai_responses and cfg.openai_responses.reasoning == r), + (cfg == .openai_responses and cfg.openai_responses.reasoning == r) or + (cfg == .openai_codex_responses and cfg.openai_codex_responses.reasoning == r), .anthropic_messages => |sel| { if (cfg != .anthropic_messages) return false; const c = cfg.anthropic_messages; @@ -173,7 +175,7 @@ pub fn adaptiveFallback(cfg: *ProviderConfig) bool { c.thinking_budget_tokens = budget; return true; }, - .openai_chat, .openai_responses => return false, + .openai_chat, .openai_responses, .openai_codex_responses => return false, } } -- cgit v1.3