graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
fix: title uses the live session provider, not a chat remap
Cursor Agent45ca2b024d15
diff --git a/docs/releases/v0.0.279-continuation.md b/docs/releases/v0.0.279-continuation.mdindex 036c33a9..f87f7616 100644--- a/docs/releases/v0.0.279-continuation.md+++ b/docs/releases/v0.0.279-continuation.md@@ -10,3 +10,4 @@ This branch is **not** a retag and is **not** merged back.| #613 ACP Registry | **Docs only.** Submit recipe in [acp-registry.md](../acp-registry.md). Listing + auth check live in `agentclientprotocol/registry`. #612 streaming already shipped. Blocker: `initialize` has no `authMethods`. No registry client here. || yxlyx doctor / cube / governed / localhost | **Inventory.** [yxlyx-leftovers.md](../yxlyx-leftovers.md). `/doctor` goal/todo slice and `--max-model-calls` already exist. Lease/job/listener doctor, idle localhost supervisor, cube NDJSON ingress, protected verifiers, review-cycle caps: parked. No new product mode. || WASM / libgraff / in-process embed | **Started (ADR 0038).** `graff-core.wasm` + `libgraff` + `@codegraff/sdk/embed` `createGraffAgent()`. ACP handshake in-process; first-slice turn is `echo:`. Live tools stay `graff acp`. |+| Tab title | **Fixed.** Title uses the live session provider/model (no extra chat remap). Failures stay off the `thinking…` row. Responses-kind errors name the provider, not "codex". |diff --git a/src/title.zig b/src/title.zigindex 46569949..037f3104 100644--- a/src/title.zig+++ b/src/title.zig@@ -323,56 +323,11 @@ test "cleanTitle: normalizes a model reply into a tab label, else null (/title)"try std.testing.expect(cleanTitle("\"\"") == null);}-/// Same model the turn is on. If the session is riding Responses on top of a-/// chat-completions catalog (xAI, Codegraff), mint the tab title on chat so-/// a Responses-only host (Codex / gateway `/v1/responses`) cannot reject-/// `grok-4.6` with "use /v1/chat/completions".-pub fn titleProvider(base: Provider) Provider {- if (base.kind != .responses) return base;- const spec = provider_mod.specFor(base.id) orelse return base;- if (spec.kind != .openai) return base;- if (std.mem.indexOf(u8, spec.url, "chat/completions") == null) return base;- var out = base;- out.kind = .openai;- out.url = spec.url;- return out;-}--test "titleProvider keeps the session model and prefers chat when the catalog has it" {- const xai: Provider = .{- .id = "xai",- .kind = .responses,- .auth = .bearer,- .url = provider_mod.xai_responses_url,- .api_key = "k",- .model = "grok-4.6",- .context = 500_000,- };- const titled = titleProvider(xai);- try std.testing.expectEqualStrings("xai", titled.id);- try std.testing.expectEqualStrings("grok-4.6", titled.model);- try std.testing.expectEqual(Provider.Kind.openai, titled.kind);- try std.testing.expect(std.mem.indexOf(u8, titled.url, "chat/completions") != null);-- const codex: Provider = .{- .id = "codex",- .kind = .responses,- .auth = .bearer,- .url = "https://chatgpt.com/backend-api/codex/responses",- .api_key = "k",- .model = "gpt-5.6-sol",- .context = 272_000,- };- const same = titleProvider(codex);- try std.testing.expectEqual(Provider.Kind.responses, same.kind);- try std.testing.expectEqualStrings(codex.url, same.url);- try std.testing.expectEqualStrings("gpt-5.6-sol", same.model);-}-/// Generate a terse tab-label title for the turn's first prompt — runs on its/// own arena + a throwaway one-message sub-Agent, so it can be spawned via/// io.async and overlap the real turn instead of blocking after it. Returns a-/// gpa-owned title (caller frees), or null on any failure.+/// gpa-owned title (caller frees), or null on any failure. Uses the session+/// provider as-is (same model and wire as the turn).pub fn titleTask(gpa: std.mem.Allocator, io: Io, client: *std.http.Client, provider: Provider, prompt: []const u8, run_budget: ?*@import("run_budget.zig").RunBudget, tracer: ?*@import("trace.zig").Tracer) ?[]const u8 {var arena_state = std.heap.ArenaAllocator.init(gpa);defer arena_state.deinit();@@ -382,7 +337,7 @@ pub fn titleTask(gpa: std.mem.Allocator, io: Io, client: *std.http.Client, provi.arena = arena,.io = io,.client = client,- .provider = titleProvider(provider),+ .provider = provider,.messages = std.json.Array.init(arena),.sub = true, // pool thread: never touches stdout or the main agent's state.label = "title",