Skip to content

TUI crashes when task history references a missing child session #26871

@WarGloom

Description

@WarGloom

Summary

Opening a session in the TUI can terminate the process when historical task output references a child/subagent session that no longer exists.

What happens

A completed task tool part can store metadata.sessionId for the child session it delegated to. When that child session has been removed or is otherwise missing, the parent session still renders the historical task entry. During render, the TUI tries to sync the missing child session and the rejected Session not found lookup becomes an unhandled process error.

Expected behavior

The parent session should still open. The stale task entry should render as historical output, and navigation into the missing child session should be disabled or ignored.

Notes

The affected code is in packages/opencode/src/cli/cmd/tui/routes/session/index.tsx in the task tool renderer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions