Skip to content

Commit 49fa4b7

Browse files
byapparovclaude
andcommitted
test(cli): fail clearly when the legacy-todo fixture finds no session (#182 review)
addLegacyTodoHistory now opens the database without creating it and asserts that an assistant message exists before using it, so a failed first run is reported with the database path instead of a TypeError. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent d49c243 commit 49fa4b7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/cli/test/cli/run-continue-legacy-todo.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ function fixtureProvider() {
3030
* completed todowrite tool part in the last assistant message, and a `todo` row.
3131
*/
3232
function addLegacyTodoHistory(database: string) {
33-
const sqlite = new Database(database)
33+
const sqlite = new Database(database, { readwrite: true })
3434
try {
35-
const message = sqlite
35+
const found = sqlite
3636
.query('SELECT id, session_id FROM message WHERE data LIKE \'%"role":"assistant"%\' ORDER BY id DESC LIMIT 1')
37-
.get() as { id: string; session_id: string }
37+
.get() as { id: string; session_id: string } | null
38+
expect(found, `no assistant message in ${database}`).toBeTruthy()
39+
const message = found!
3840
const todos = [{ content: "Check the input", status: "completed", priority: "high" }]
3941
const part = {
4042
type: "tool",

0 commit comments

Comments
 (0)