The open source coding agent.
TypeScript
fix: session title generation (#293)
Márk Magyar137e96413170
diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.tsindex 95a8faf1816..aa2895da36e 100644--- a/packages/opencode/src/provider/transform.ts+++ b/packages/opencode/src/provider/transform.ts@@ -1,4 +1,4 @@-import type { CoreMessage, LanguageModelV1Prompt } from "ai"+import type { LanguageModelV1Prompt } from "ai"import { unique } from "remeda"export namespace ProviderTransform {diff --git a/packages/opencode/src/session/prompt/title.txt b/packages/opencode/src/session/prompt/title.txtindex 62a4cc43c27..373456a79a9 100644--- a/packages/opencode/src/session/prompt/title.txt+++ b/packages/opencode/src/session/prompt/title.txt@@ -1,7 +1,11 @@-You will generate a short title based on the first message a user begins a conversation with-- ensure it is not more than 50 characters long-- the title should be a summary of the user's message-- it should be one line long-- do not use quotes or colons-- the entire text you return will be used as the title-- never return anything that is more than one sentence (one line) long+Generate a short title based on the first message a user begins a conversation with. CRITICAL: Your response must be EXACTLY one line with NO line breaks, newlines, or multiple sentences.++Requirements:+- Maximum 50 characters+- Single line only - NO newlines or line breaks+- Summary of the user's message+- No quotes, colons, or special formatting+- Do not include explanatory text like "summary:" or similar+- Your entire response becomes the title++IMPORTANT: Return only the title text on a single line. Do not add any explanations, formatting, or additional text.