fix: add directory parameter and improve CLI run session handling
- Add directory parameter to session API calls (session.get, session.todo,
session.status, session.children)
- Improve agent resolver with display name support via agent-display-names
- Add tool execution visibility in event handlers with running/completed
status output
- Enhance poll-for-completion with main session status checking and
stabilization period handling
- Add normalizeSDKResponse import for consistent response handling
- Update types with Todo, ChildSession, and toast-related interfaces
🤖 Generated with OhMyOpenCode assistance
This commit is contained in:
@@ -8,11 +8,15 @@ const SESSION_CREATE_RETRY_DELAY_MS = 1000
|
||||
export async function resolveSession(options: {
|
||||
client: OpencodeClient
|
||||
sessionId?: string
|
||||
directory: string
|
||||
}): Promise<string> {
|
||||
const { client, sessionId } = options
|
||||
const { client, sessionId, directory } = options
|
||||
|
||||
if (sessionId) {
|
||||
const res = await client.session.get({ path: { id: sessionId } })
|
||||
const res = await client.session.get({
|
||||
path: { id: sessionId },
|
||||
query: { directory },
|
||||
})
|
||||
if (res.error || !res.data) {
|
||||
throw new Error(`Session not found: ${sessionId}`)
|
||||
}
|
||||
@@ -28,6 +32,7 @@ export async function resolveSession(options: {
|
||||
{ permission: "question", action: "deny" as const, pattern: "*" },
|
||||
],
|
||||
} as any,
|
||||
query: { directory },
|
||||
})
|
||||
|
||||
if (res.error) {
|
||||
|
||||
Reference in New Issue
Block a user