Skip to content

fix(tui): swallow 404 when auto-syncing referenced subagent session#29353

Closed
sjawhar wants to merge 1 commit into
anomalyco:devfrom
sjawhar:fix/tui-subagent-sync-404-swallow
Closed

fix(tui): swallow 404 when auto-syncing referenced subagent session#29353
sjawhar wants to merge 1 commit into
anomalyco:devfrom
sjawhar:fix/tui-subagent-sync-404-swallow

Conversation

@sjawhar
Copy link
Copy Markdown

@sjawhar sjawhar commented May 26, 2026

Issue for this PR

Closes #29350

Type of change

  • Bug fix

What does this PR do?

Subagent sessions are ephemeral — they can be GC'd, deleted, or never persisted depending on agent lifecycle. The parent session's Task message still references the subagent ID, and when the TUI auto-syncs that reference and the session is gone, the backend 404 propagates as an unhandled rejection.

One-line .catch(() => {}) on the auto-sync call. Comment explains the lifecycle reasoning. Task message still renders fine without the subagent message preview.

How did you verify your code works?

Manual repro: opened a session with subagent Task references, removed the subagent session, reopened the parent. Pre-fix: error toast / failed render. Post-fix: clean render, no toast.

The auto-sync call is fire-and-forget by design so there's no existing test path covering the rejection — adding a unit test would require mocking the entire SDK client.

Checklist

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

@github-actions
Copy link
Copy Markdown
Contributor

ghost commented May 26, 2026

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found one potentially related PR:

Related PR:

The current PR (#29353) is more specific about swallowing the 404 error during auto-sync, while #26944 deals with preventing crashes when tasks reference missing child sessions. They may be addressing complementary aspects of the same issue.

@github-actions
Copy link
Copy Markdown
Contributor

ghost commented May 26, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

…missing

Cherry-picked from upstream PR anomalyco#26944 by @shalin-dev which is a superset of our prior local fix. Adds the .catch() on auto-sync (was our 1-line fix) plus a sessionMissing signal that disables Task onClick to prevent dead-link navigation.
@legion-implementer legion-implementer Bot force-pushed the fix/tui-subagent-sync-404-swallow branch from 465afa1 to b9c6c04 Compare May 26, 2026 08:35
@sjawhar
Copy link
Copy Markdown
Author

sjawhar commented May 26, 2026

Closing in favor of #26944, which lands the same fix plus a navigation guard for the dead-link case. Cherry-picked their content into our fork locally so we get the fix without an extra upstream PR.

@sjawhar sjawhar closed this May 26, 2026
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.

TUI crashes when opening a session that references a removed subagent

1 participant