Skip to content

Forked threads lose charts that load data from source-thread storage #47

Backlog

Description

@dimiboi

What happens

Opening a fork shows a file-load error in a chart inherited from a completed reply. The chart’s JSON still exists in the source thread, where the same block passed check_ui.

Environment — BB desktop 0.50.1 on macOS (arm64), Codex provider, Generative UI 0.3.2.

Reproduce

  1. In a new BB thread with Generative UI enabled, ask the agent to create a two-value data file with this command.

    printf '%s\n' '[2,5]' > "$BB_THREAD_STORAGE/counts.json"
  2. Ask the agent to pass the following line as the spec to check_ui, then send it in a fenced ui block in its reply. Keep the literal $BB_THREAD_STORAGE prefix in the block.

    Chart("bar", ["A", "B"], {Count: Load("$BB_THREAD_STORAGE/counts.json")})
  3. After the reply finishes, fork the thread from that reply. Open the fork and scroll to the inherited chart before creating any files in the fork.

Expected — The inherited chart still displays A = 2 and B = 5 while the source data is available.

Actual — The inherited chart displays a file-load error. In the observed fork, check_ui reported file not found for the storage-prefixed path. Passing the source file’s absolute path hit the allowed-roots check. Copying the same bytes to the same relative location in the fork made the unchanged block pass check_ui. Visual recovery after copying was not verified.

Diagnostic evidence

  • Fork history. BB copies the selected events with the fork as their thread ID. The assistant row passes its thread ID to the code-fence renderer. The SDK message carries a single thread ID, with no separate field identifying where the reply was authored. Fork history copy · Assistant row · Fence message · SDK message fields
  • Historical rendering. Generative UI’s SlotFence passes message.threadId to Fence. Its UiFence loads data for that thread, and the hook calls the load_data RPC on a cache miss. The RPC passes the supplied ID to loadThreadFile. SlotFence · UiFence · RPC selection · Cache lookup and load · RPC handler
  • Validation. check_ui calls loadThreadFile directly with the invoking tool’s ctx.threadId. Both paths therefore resolve the literal prefix against the fork’s own storage root in this case. A fresh call to check_ui in the fork tests that root independently of the historical renderer. Tool handler · Root selection and absolute-path check · BB storage path

The two-value example passed the released plugin’s validator with an in-memory SDK file fixture. The visual failure was observed in an existing fork. The renderer’s RPC arguments during that incident were not captured.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions