fix(background-agent): pass query directory to session.get in 4 call-sites (#2937)
resolveSubagentSpawnContext and related lookups called client.session.get without the query.directory parameter, causing project-scoped sessions to 404 under newer OpenCode SDK versions. Threaded directory through SpawnerContext/BackgroundManager so all four call-sites pass it. 🤖 Generated with OhMyOpenCode assistance https://github.com/code-yeongyu/oh-my-opencode
This commit is contained in:
@@ -20,7 +20,8 @@ export function getMaxRootSessionSpawnBudget(config?: BackgroundTaskConfig): num
|
||||
|
||||
export async function resolveSubagentSpawnContext(
|
||||
client: OpencodeClient,
|
||||
parentSessionID: string
|
||||
parentSessionID: string,
|
||||
directory?: string
|
||||
): Promise<SubagentSpawnContext> {
|
||||
const visitedSessionIDs = new Set<string>()
|
||||
let rootSessionID = parentSessionID
|
||||
@@ -38,6 +39,7 @@ export async function resolveSubagentSpawnContext(
|
||||
try {
|
||||
const response = await client.session.get({
|
||||
path: { id: currentSessionID },
|
||||
...(directory ? { query: { directory } } : {}),
|
||||
})
|
||||
if (response.error) {
|
||||
throw new Error(String(response.error))
|
||||
|
||||
Reference in New Issue
Block a user