mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
feat(schedules): open repo session with run context for finished worktree runs
This commit is contained in:
1 parent
7102715068
commit
ca348f20a3
5 files changed
+221
-23
No files matched your search
@@ -136,6 +136,21 @@ export async function forkSession(sessionID: string, before?: string): Promise<S
|
||||
)
|
||||
}
|
||||
|
||||
export async function addSessionContext(sessionID: string, text: string): Promise<void> {
|
||||
await callOpenCode((api) => api.session.synthetic({ sessionID, text, resume: false }))
|
||||
}
|
||||
|
||||
export async function createSessionWithContext(input: CreateSessionInput, context: string): Promise<SessionInfo> {
|
||||
const session = await createSession(input)
|
||||
try {
|
||||
await addSessionContext(session.id, context)
|
||||
} catch (error) {
|
||||
await deleteSession(session.id).catch(() => undefined)
|
||||
throw error
|
||||
}
|
||||
return session
|
||||
}
|
||||
|
||||
export async function switchSessionModel(sessionID: string, model: ModelRef): Promise<void> {
|
||||
await callOpenCode((api) => api.session.switchModel({ sessionID, model }))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user