[PR #9961] fix(tool): handle invalid session_ids gracefully and fix test initialization #13284

Open
opened 2026-02-16 18:18:09 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9961

State: open
Merged: No


Fixes #9950

What does this PR do?

  • Adds a try/catch around Session.get() in the task tool to gracefully handle invalid session IDs instead of crashing.
  • Adds test/tool/task.test.ts to test the task tool and verify the graceful error handling.

How did you verify your code works?

Ran bun test packages/opencode/test/tool/task.test.ts and verified the new test passes.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9961 **State:** open **Merged:** No --- Fixes [#9950 ](https://github.com/anomalyco/opencode/issues/9950) ### What does this PR do? - Adds a `try/catch` around `Session.get()` in the task tool to gracefully handle invalid session IDs instead of crashing. - Adds test/tool/task.test.ts to test the task tool and verify the graceful error handling. ### How did you verify your code works? Ran bun test packages/opencode/test/tool/task.test.ts and verified the new test passes.
yindo added the pull-request label 2026-02-16 18:18:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13284