summaryrefslogtreecommitdiff
path: root/src/tui_selectors.zig
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-06-13 23:45:59 -0600
committert <t@tjp.lol>2026-06-15 15:08:32 -0600
commit02b4c7a35ac0b714bc045d54fb4bb45d1ce4e490 (patch)
tree134196a82dd6fdd55b735be4c0cf38428c85038d /src/tui_selectors.zig
parent71643a5d69ffc40882c9fcde3cc8a3bcf02d7396 (diff)
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.
Diffstat (limited to 'src/tui_selectors.zig')
-rw-r--r--src/tui_selectors.zig10
1 files changed, 6 insertions, 4 deletions
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,
}
}