Skip to content

Conversation

@kdcokenny
Copy link
Collaborator

@kdcokenny kdcokenny commented Jan 13, 2026

Problem

PR #731 added client.session.get for directory inheritance but didn't update tests. The .catch() pattern only handles Promise rejections, not synchronous TypeError when the method is undefined.

Solution

  1. Guard clause in implementation - Check if client.session.get exists before calling (defensive coding for older clients)
  2. Updated test mocks - Added get mock to 4 sync mode tests so they properly test the real code path

Changes

  • src/tools/sisyphus-task/tools.ts - Guard clause for client.session.get
  • src/tools/sisyphus-task/tools.test.ts - Added get mock to 4 tests

Verification

All 27 tests pass.


Summary by cubic

Fixes a crash in sync mode by guarding client.session.get and keeps tests aligned with the directory inheritance behavior. This restores compatibility with older clients that don’t implement session.get.

  • Bug Fixes
    • Guard client.session.get before calling; fall back when unavailable to avoid TypeError.
    • Update four sync mode tests to mock session.get and verify directory inheritance.

Written for commit 444b7ce. Summary will update on new commits.

- 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
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@kdcokenny kdcokenny merged commit 2b556e0 into dev Jan 13, 2026
3 checks passed
@kdcokenny kdcokenny deleted the fix/sisyphus-task-sync-mode-tests branch January 13, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants