Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/opencode/src/server/routes/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export const SessionRoutes = lazy(() =>
session.title = updates.title
}
if (updates.time?.archived !== undefined) session.time.archived = updates.time.archived
})
}, { touch: false })

return c.json(updatedSession)
},
Expand Down
10 changes: 6 additions & 4 deletions packages/opencode/src/session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export namespace Session {
draft.share = {
url: share.url,
}
})
}, { touch: false })
return share
})

Expand All @@ -269,14 +269,16 @@ export namespace Session {
await ShareNext.remove(id)
await update(id, (draft) => {
draft.share = undefined
})
}, { touch: false })
})

export async function update(id: string, editor: (session: Info) => void) {
export async function update(id: string, editor: (session: Info) => void, options?: { touch?: boolean }) {
const project = Instance.project
const result = await Storage.update<Info>(["session", project.id, id], (draft) => {
editor(draft)
draft.time.updated = Date.now()
if (options?.touch !== false) {
draft.time.updated = Date.now()
}
})
Bus.publish(Event.Updated, {
info: result,
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/src/session/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,6 @@ NOTE: At any point in time through this workflow you should feel free to ask the

const title = cleaned.length > 100 ? cleaned.substring(0, 97) + "..." : cleaned
draft.title = title
})
}, { touch: false })
}
}