Skip to content

fix: keep attach button visible on a fresh thread#459

Merged
91jaeminjo merged 1 commit into
mainfrom
fix/attachment-detection-fresh-thread
Jul 24, 2026
Merged

fix: keep attach button visible on a fresh thread#459
91jaeminjo merged 1 commit into
mainfrom
fix/attachment-detection-fresh-thread

Conversation

@91jaeminjo

Copy link
Copy Markdown
Collaborator

Problem

The composer's file-attachment button disappeared on a freshly created chat
thread in a room that supports attachments, even though room-scoped uploads
still worked.

Root cause

ThreadHistory.supportsAttachments was derived from the thread's replayed
AG-UI state. A thread with no finished run has no replayable state — and the
backend omits run_input for unfinished runs on the history endpoint — so it
resolved to a false negative that shadowed the authoritative room-level
capability.

Fix

  • ThreadHistory.supportsAttachments is now tri-state (bool?): an empty
    AG-UI state means undetermined (null) rather than a definitive false.
  • The room screen records a per-thread value only when it is resolved, so the
    attach gates fall back to room.supportsAttachments when undetermined. The
    thread-level signal still takes precedence when the thread has resolvable
    state.
  • The three attach gates now share a single _attachEnabledForThread helper,
    so the undetermined→room fallback lives in one place.

Tests

  • Domain: tri-state getter (true / false / null).
  • Client API: getThreadHistory at the real wire shape (unfinished run,
    run_input: null) → supportsAttachments == null.
  • Widget: undetermined state + skill room → attach shows; resolved non-sandbox
    state + skill room → attach hidden.

All room and client suites pass; analyzer clean.

🤖 Generated with Claude Code

ThreadHistory.supportsAttachments is now bool?: an empty AG-UI state means undetermined (a freshly created thread has no finished run, and the history endpoint omits run_input for unfinished runs) rather than a definitive false. The room screen records a per-thread value only when it is resolved, so the attach gate falls back to the room capability instead of hiding the button. The thread-level signal still takes precedence when the thread has resolvable state.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@91jaeminjo
91jaeminjo merged commit a310b10 into main Jul 24, 2026
6 checks passed
@91jaeminjo
91jaeminjo deleted the fix/attachment-detection-fresh-thread branch July 24, 2026 23:01
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.

1 participant