Skip to content

Chat UI displays raw JSON for 'event' type messages #204

@bomber555

Description

@bomber555

Description

When using HAPI to wrap Claude Code, certain messages appear as raw JSON in the PWA chat UI instead of being filtered.

Environment

  • HAPI: 0.15.2, macOS arm64
  • Claude Code: latest

Steps to Reproduce

  1. Start HAPI Hub + session
  2. Send any prompt triggering tool use
  3. Raw JSON blocks appear in chat

Root Cause

In the embedded JS bundle (index-BVqzYkZt.js):

  1. F7 passes raw event data through without filtering:
    function F7(e){return!ve(e)||typeof e.type!="string"?null:e}

  2. q7 only suppresses "codex" type in HD fallback, not "event":
    function q7(e){return ve(e)&&e.type==="codex"}

  3. HD fallback serializes unhandled messages as JSON text via Ra(t.content).

Suggested Fix

  • F7: return null for all events (or transform to displayable format)
  • q7: also suppress "event" type (or any type H7 can't parse)

Workaround

Binary patch (same byte length, in-place r+b write + codesign).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions