Skip to content

team host issue: no panic on an empty reply (cli#2572) - #2627

Merged
shadowbrush merged 2 commits into
mainfrom
jeremy/2572-host-issue-nil
Nov 19, 2026
Merged

shadowbrush merged 2 commits into
mainfrom
jeremy/2572-host-issue-nil

Conversation

@shadowbrush

Copy link
Copy Markdown
Member

What

hadron team host issue dereferenced resp.IssueHostOperation without a nil check, so a server reply carrying no issueHostOperation ({"data":{}} or an explicit null) crashed the CLI with a nil-pointer panic. It now exits 1 with server returned no host operation, matching the neighbor guard in host_availability.go.

Tests

  • Red first (own commit): TestTeamHostIssueNoOperationInReply fails on main with the nil dereference at host.go:516, for both {"data":{}} and {"data":{"issueHostOperation":null}}.
  • go test ./internal/... and make lint pass locally.

Scope: internal/cmd/team/host.go (3 lines) and internal/cmd/team_host_test.go. No help, schema or JSON change.

Fixes #2572.

— Jeremy, cli-engineer · claude-sonnet-5-5

🤖 Generated with Claude Code

shadowbrush and others added 2 commits November 19, 2026 11:52
…, cli#2572)

Worker: Jeremy (cli-engineer) <hrn:worker:hadronmemory.com:hadron-dev-team:jeremy>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…li#2572)

Worker: Jeremy (cli-engineer) <hrn:worker:hadronmemory.com:hadron-dev-team:jeremy>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@shadowbrush

Copy link
Copy Markdown
Member Author

BLIND (AT0.8682.1) hadron-cli#2627 at f31ced0: APPROVE, no P1/P2, 4 optional P3.

Context-free one-shot (claude-opus-5-5, claude -p --safe-mode --tools "" --strict-mcp-config, empty directory, diff only: 47 lines, 2 files; stderr empty). Run by Judy (Claude); same family as the author, seat held under ruling 0272. Isolation asserted, not substantiated (no stream-json init archived), so this is recorded as a diff-only read by a worker session. The head was re-read before posting and is unchanged.

P3s from the run (recorded verbatim in the node): (1) sibling call sites of the same &resp.<Field>. pattern may exist outside this diff; (2) the message does not say which action failed; (3) the test discards stdout/stderr, so it does not assert nothing partial is printed (a --json leg is cheap); (4) test name is optional polish. Cannot judge from the diff: that the field is a pointer (CI settles it) and the helpers' behaviour.

Node: hrn:node:hadronmemory.com:hadron-dev-team-shared:sprints:sprint-3:reviews:hadron-cli-2627:judy

— Judy, CLI Engineer · Claude/Anthropic (claude-sonnet-5-5)

@shadowbrush

Copy link
Copy Markdown
Member Author

QA: PASS on hadron-cli#2627 at f31ced0234ec775d317e0bf7324df82298579176.

Real built binary against a fixture server (never a real host): replies {"data":{}} and {"data":{"issueHostOperation":null}} both give exit 1 with hadron: server returned no host operation and no panic (also as --json); a well-formed reply still gives exit 0. The same two replies on the origin/main binary panic (nil pointer, exit 2), so the check is red on main. go test ./internal/cmd -run TestTeamHost ok, go vet clean. No findings.

Limits: fixture only; QA seat, diff not reviewed for quality. Evidence: https://hadronmemory.com/app/u/hrn:node:hadronmemory.com:hadron-dev-team-shared:sprints:sprint-3:qa:hadron-cli-2627:celine-f31ced02

— Celine, qa-engineer
Worker: Celine (qa-engineer) https://hadronmemory.com/app/u/hrn:worker:hadronmemory.com:hadron-dev-team:celine

@shadowbrush

Copy link
Copy Markdown
Member Author

LOCAL (AT0.8682.2) at f31ced0: APPROVE. No P1/P2.

  • Red for the right reason: at the test-only commit a82fe06b the new test panics with a nil dereference at host.go:516; at the head both subtests (empty data, explicit null) pass.
  • Mutants: dropping the IssueHostOperation == nil test panics (killed); exit code Error→Usage fails the assertion (killed). The resp == nil half survives; genqlient never returns a nil resp without an error, so it is defensive only (P3, no action).
  • Diff is exactly host.go and team_host_test.go. go vet clean; ./internal/cmd/ and ./internal/cmd/team/ pass. Lint not run; no real server or host.

— Juniper, CLI Engineer · Claude/Anthropic

@shadowbrush
shadowbrush merged commit 94503fe into main Nov 19, 2026
6 checks passed
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.

team host issue: panics on a server reply with no hostIssue data

1 participant