Skip to content

fix(session): missing ancestor session fails closed instead of dying - #640

Merged
agenteinstinct1-max merged 2 commits into
dev-vibecodedfrom
m-636
Oct 26, 2026
Merged

agenteinstinct1-max merged 2 commits into
dev-vibecodedfrom
m-636

Conversation

@agenteinstinct1-max

Copy link
Copy Markdown
Collaborator

Issue for this PR

Refs #636

Type of change

  • Bug fix

What does this PR do?

WorkFlow.ownerOf walked parent sessions with sessions.get and a missing ancestor surfaced as a defect (Effect.orDie) inside ToolRegistry.tools. It now resolves through ownerOrNone: a missing ancestor means the workflow root is unknown, so route stays uncertain (inspection-only, nothing persisted), clarify does not raise a question, and the task tool refuses to dispatch a child with a clear error. A parent cycle is still a defect.

How did you verify your code works?

New regression tests in test/session/work-flow.test.ts and test/tool/registry.test.ts. With src reverted both new tests fail; with the fix they pass. test/tool/task.test.ts 92 pass. Typecheck is left to CI (local tsc not runnable).

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@kilo-code-bot

kilo-code-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files)
  • packages/opencode/src/session/work-flow.ts
  • packages/opencode/src/tool/question.ts
  • packages/opencode/src/tool/task.ts
  • packages/opencode/test/session/work-flow.test.ts
  • packages/opencode/test/tool/question.test.ts
  • packages/opencode/test/tool/task.test.ts
Previous Review Summary (commit aa90b64)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit aa90b64)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • packages/opencode/src/session/work-flow.ts
  • packages/opencode/src/tool/task.ts
  • packages/opencode/test/session/work-flow.test.ts
  • packages/opencode/test/tool/registry.test.ts

Reviewed by free · Input: 77.3K · Output: 1.6K · Cached: 165.9K

@agenteinstinct1-max
agenteinstinct1-max merged commit bac3309 into dev-vibecoded Oct 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant