Skip to content

brclient: JSON parse failures with br >= 0.1.38 wrapped response format #3

Description

@deokcf

Summary

atari's brclient fails to parse JSON responses from br >= 0.1.38 in at least two places:

  1. br epic close-eligible - atari expects []brclient.EpicCloseResult (array) but br returns a wrapped object ({"issues": [...], ...}).
  2. br show <id> - enrichment calls fail with exit status 3 when the bead is in_progress, causing a spam loop of failed to enrich bead warnings every ~5 seconds in the debug log.

These failures prevent atari from:

  • Closing beads after a successful session ("session and follow-up both failed to close bead")
  • Closing eligible epics (infinite retry loop in idle state)
  • Enriching bead data for TUI display

Versions

  • br: 0.1.38 (latest as of 2026-04-12)
  • atari: dev @ 9fed7677 (latest main as of 2026-04-12)
  • The Handle wrapped JSON format in brclient List and Ready fix (PR Fix br list --json format change in beads_rust 0.1.37 #2, commit 78f1d583) addressed List and Ready but the same wrapping issue affects other endpoints.

Reproduction

# Start atari against a workspace with beads
cd /path/to/workspace && atari start --tui

# Debug log fills with:
# WARN failed to close eligible epics: parse br epic close-eligible output: json: cannot unmarshal object into Go value of type []brclient.EpicCloseResult
# WARN failed to enrich bead, using basic data: br show <id> failed: exit status 3

Impact

  • Beads complete successfully but cannot be closed by atari, requiring manual br close intervention
  • The epic close-eligible retry loop runs every ~5 seconds indefinitely when atari is idle
  • TUI shows "no active bead" even when a session is running (enrichment failures)

Suggested Fix

Audit all brclient JSON parsing to handle both the legacy array format and the new wrapped object format ({"issues": [...], "total": N, ...}) that br 0.1.38 returns. The same unwrapping logic from PR #2 likely needs to be applied to:

  • EpicCloseEligible()
  • Show()
  • Any other brclient method that parses br JSON output

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