fix(sisyphus-task): guard client.session.get and update sync mode tests

- Add guard clause to check if client.session.get exists before calling
- Update 4 sync mode tests to properly mock session.get
- Fixes test failures from PR #731 directory inheritance feature
This commit is contained in:
Kenny
2026-01-13 13:41:41 -05:00
parent 31c5951dfc
commit 444b7ce991
2 changed files with 7 additions and 3 deletions
+3 -3
View File
@@ -407,9 +407,9 @@ System notifies on completion. Use \`background_output\` with task_id="${task.id
let syncSessionID: string | undefined
try {
const parentSession = await client.session.get({
path: { id: ctx.sessionID },
}).catch(() => null)
const parentSession = client.session.get
? await client.session.get({ path: { id: ctx.sessionID } }).catch(() => null)
: null
const parentDirectory = parentSession?.data?.directory ?? directory
const createResult = await client.session.create({