Skip to content

/fork command crashes with 'undefined is not an object' #25811

@rf-leon

Description

@rf-leon

Bug Report

Description

Running /fork to fork a session crashes with:

ERROR  undefined is not an object (evaluating 'T')

Stack Trace

/$bunfs/root/claude:2475:888

- bG8 (/$bunfs/root/claude:2475:888)
- $VB (/$bunfs/root/claude:2475:1834)
- KRB (/$bunfs/root/claude:2105:5583)
- v7 (/$bunfs/root/claude:682:20801)
- F4 (/$bunfs/root/claude:682:39204)
- ip (/$bunfs/root/claude:682:49829)
- gv (/$bunfs/root/claude:682:86106)
- mTT (/$bunfs/root/claude:682:85078)
- Rl (/$bunfs/root/claude:682:84902)
- sp (/$bunfs/root/claude:682:81693)

Analysis

The crash occurs in bG8, which processes web search results (searchCount, totalResultCount). It appears to be iterating over a result set where an entry is undefined/null, likely from a WebSearch tool result in the session being forked.

The function $VB (which renders the tool result message for web search) calls bG8(T.results) without null-checking T or T.results.

Steps to Reproduce

  1. Have a session that used web search
  2. Run /fork
  3. Observe crash

Expected Behavior

/fork should successfully fork the session, handling any null/undefined tool results gracefully.

Environment

  • Platform: macOS (Darwin 25.2.0)
  • Shell: zsh

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingplatform:macosIssue specifically occurs on macOS

    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