Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): handle JSON-wrapped titles and verbose Claude output #10446

MergedNoojuno(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/10446/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 5 changed files with 137 additions and 4 deletions (loading 2).

x
0 of 5 viewed, 5 left
94 additions and 0 deletionsapps/server/src/textGeneration/ClaudeTextGeneration.test.tsModified
View file
@@ -394,6 +394,100 @@
}),
​
+ for (const verbose of [false, true]) {
+ it.effect(`unwraps a JSON title in ${verbose ? "verbose" : "normal"} Claude output`, () => {
+ const result = {
+ type: "result",
+ structured_output: { title: '{"title": "Refresh ev-stg APP ASG instances"}' },
+ };
+ return withFakeClaudeEnv(
+ { output: JSON.stringify(verbose ? [result] : result) },
+ (textGeneration) =>
+ Effect.gen(function* () {
+ const generated = yield* textGeneration.generateThreadTitle({
+ cwd: process.cwd(),
+ message: "Refresh ev-stg APP ASG instances",
+ modelSelection: {
+ instanceId: ProviderInstanceId.make("claudeAgent"),
+ model: SYNTHETIC_CLAUDE_STANDARD_MODEL,
+ },
+ });
+​
+ expect(generated.title).toBe("Refresh ev-stg APP ASG instances");
+ }),
+ );
+ });
+ }
+​
+ for (const previousTitle of [undefined, "Old thread title"]) {