Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ All notable changes to DreamCoder will be documented in this file.
- **Stopping a reply keeps the session's context.** Stop ends the agent process only when the reply has not stopped a few seconds after you press Stop, and a restarted agent keeps uploaded images and files, instruction files from subfolders and files restored after compaction, without adding a "Continue from where you left off." message (#270).
- The agent knows the available skills again after compaction, gets only newly added skills when the skill folders change, and does not get the whole list again after a restart (#270).
- **`/goal` keeps working until the goal is met.** Before, the turn ended at the first check that found the goal unmet. Each automatic continuation now tells the agent the goal, what is still missing and how many continuations are left. The turn ends and the goal stays active when the agent needs something only you can provide, or after 10 continuations in a row without a message from you (#270).
- Session titles are written in the language of your message instead of English, and no longer answer the message (#285). Thanks @inverteum.
- A provider in OpenAI format whose base URL already ends in a version, such as `https://open.bigmodel.cn/api/paas/v4` or Gemini's `.../v1beta/openai`, works: requests, model lists and the connection test no longer add another `/v1`. Base URLs without a version still get `/v1` (#262).
- A streamed reply through the local proxy is no longer cut off when the provider pauses for more than 60 seconds, and stopping a reply or deleting a session now also stops the request to the provider before it starts answering (#262).
- With a manual HTTP proxy set in the network settings, the agent reaches the app's local proxy directly instead of sending those requests to the HTTP proxy (#262).
Expand Down
1 change: 1 addition & 0 deletions docs/features/harness/prompt/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@

### T-SYS-09 服务端标题提示词没有「不要回答」和「用用户的语言」

- 状态:已修复(#285):标题提示词要求用用户写的语言写标题、不要回答用户消息,并增加中文示例。
- 类型:问题
- 严重程度:低
- 体量:700 字符,每个会话 2 次(第 1、3 条用户消息后)。
Expand Down
29 changes: 29 additions & 0 deletions src/server/__tests__/title-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,35 @@ describe('titleService', () => {
}
})

test('title prompt names the session instead of answering and uses the user language', async () => {
let requestBody: Record<string, unknown> | null = null
const server = Bun.serve({
hostname: '127.0.0.1',
port: 0,
async fetch(req) {
requestBody = await req.json() as Record<string, unknown>
return Response.json({
type: 'message',
content: [{ type: 'text', text: '{"title":"Trace ok"}' }],
})
},
})

try {
await writeLoggedProvider(server.port)

await expect(generateTitle('帮我看看为什么 bun test 在 CI 上失败?')).resolves.toBe('Trace ok')
const system = requestBody?.system
expect(typeof system).toBe('string')
expect(system).toContain('title-generation task, not a conversation')
expect(system).toContain('Never answer the user\'s question')
expect(system).toContain('language the user writes in')
expect(system).toContain('排查 CI 上的测试失败')
} finally {
server.stop(true)
}
})

test('logs why the title request failed upstream', async () => {
const server = Bun.serve({
hostname: '127.0.0.1',
Expand Down
3 changes: 3 additions & 0 deletions src/server/services/titleService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ const TITLE_LOG_EXCERPT_LEN = 200

const TITLE_SYSTEM_PROMPT = `Generate a concise, sentence-case title (3-7 words) that captures the main topic or goal of this coding session. The title should be clear enough that the user recognizes the session in a list. Use sentence case: capitalize only the first word and proper nouns.

This is a title-generation task, not a conversation. Never answer the user's question or fulfill their request. Write the title in the language the user writes in, even when the message contains English code, commands or product names: a Chinese message gets a Chinese title.

Return JSON with a single "title" field.

Good examples:
{"title": "Fix login button on mobile"}
{"title": "Add OAuth authentication"}
{"title": "Debug failing CI tests"}
{"title": "Refactor API client error handling"}
{"title": "排查 CI 上的测试失败"}

Bad (too vague): {"title": "Code changes"}
Bad (too long): {"title": "Investigate and fix the issue where the login button does not respond on mobile devices"}
Expand Down
Loading