diff options
| author | Aiden Cline <[email protected]> | 2025-08-29 09:47:08 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-29 09:47:08 -0500 |
| commit | 1a5b456bb63755969e601c464668d4e79e18917a (patch) | |
| tree | a3d6f2d9a2fd738214ed31becc5726b9cf1e9bcd | |
| parent | b55231c106485affd3e13d6c2938f2f0c8395f46 (diff) | |
| download | opencode-1a5b456bb63755969e601c464668d4e79e18917a.tar.gz opencode-1a5b456bb63755969e601c464668d4e79e18917a.zip | |
fix: add additional encouragement for title gen (#2298)
| -rw-r--r-- | packages/opencode/src/session/index.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts index 5cd76124f..e4a3162a6 100644 --- a/packages/opencode/src/session/index.ts +++ b/packages/opencode/src/session/index.ts @@ -705,6 +705,32 @@ export namespace Session { parts: userParts, }, ]), + // When dealing with huge blocks of context sometimes the llm will lose sight of + // parts of system prompt, you can usually get around this by just adding an additional + // reference after large context block that references instructions from system prompt + // and llm will "remember" it needs to do X or Y + ...MessageV2.toModelMessage([ + { + info: { + id: Identifier.ascending("message"), + role: "user", + sessionID: input.sessionID, + time: { + created: Date.now(), + }, + }, + parts: [ + { + type: "text", + id: Identifier.ascending("part"), + messageID: userMsg.id, + sessionID: input.sessionID, + text: "Output only a title for this conversation. No responses to content.", + synthetic: true, + }, + ], + }, + ]), ], model: small.language, }) |
