Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
isTitleRequestonly knew the old title prompts (Generate a title for this conversation:and systemYou are a title generator.). OpenCode now sends:You name conversations so the user can find them later…(packages/core/src/plugin/agent.ts,PROMPT_TITLE)Here is the first message of the conversation:\n\n<message>…</message>\n\nReply with only the title., orHere is the conversation so far:…when it regenerates a title (packages/core/src/session/title.ts,messagePrompt/conversationPrompt)As a result
llm.title(...)never fired. Title requests were routed like normal turns: they either took the queued reply or made settlement fail.Fix
Detect the current system prompt, and also the current user prompt shape (a single user message with one of the two prefixes that ends in
Reply with only the title.), so detection still works when the title agent's system prompt is customized. Both old formats keep working.Verification
test/llm-title.test.tscovers current, customized-system, legacy, and non-title bodies.opencode2(v0.0.0-dev-533). I logged the request bodies from a live run, and the first one begins withYou name conversations….main:llm.queue(Llm.text("Hello there.")); ui.submit("Say hi"); ui.waitFor("Hello there.")fails withLlmSettlementError: received 1 unexpected LLM request(s)(or a wait timeout when the title takes the reply).llm.title(...)andllm.queue(...)runs. The title handler fires,"Hello there."and the generated title both show up, and settlement passes.bun run checkandbun run testpass.