diff options
| author | Aiden Cline <[email protected]> | 2025-09-06 09:47:42 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-06 09:47:42 -0500 |
| commit | 564143071eb7a1f7c204db8dda91492149a93604 (patch) | |
| tree | 8c9bdad2b10902dfd22d8e64d8037d2a7db7085d | |
| parent | 3cdfc529a0fc146db69df5309648839750d676de (diff) | |
| download | opencode-564143071eb7a1f7c204db8dda91492149a93604.tar.gz opencode-564143071eb7a1f7c204db8dda91492149a93604.zip | |
fix: title not generated if first msg is shell invocation (#2451)
| -rw-r--r-- | packages/opencode/src/session/index.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts index 70be047d0..619aa86ec 100644 --- a/packages/opencode/src/session/index.ts +++ b/packages/opencode/src/session/index.ts @@ -691,8 +691,10 @@ export namespace Session { const lastSummary = msgs.findLast((msg) => msg.info.role === "assistant" && msg.info.summary === true) if (lastSummary) msgs = msgs.filter((msg) => msg.info.id >= lastSummary.info.id) - - if (msgs.filter((m) => m.info.role === "user").length === 1 && !session.parentID && isDefaultTitle(session.title)) { + const numRealUserMsgs = msgs.filter( + (m) => m.info.role === "user" && !m.parts.every((p) => "synthetic" in p && p.synthetic), + ).length + if (numRealUserMsgs === 1 && !session.parentID && isDefaultTitle(session.title)) { const small = (await Provider.getSmallModel(model.providerID)) ?? model generateText({ maxOutputTokens: small.info.reasoning ? 1024 : 20, |
