Skip to content

fix(breeze): support gh auth status without json#309

Open
bingran-you wants to merge 1 commit intomainfrom
fix/breeze-auth-status-text-308
Open

fix(breeze): support gh auth status without json#309
bingran-you wants to merge 1 commit intomainfrom
fix/breeze-auth-status-text-308

Conversation

@bingran-you
Copy link
Copy Markdown
Collaborator

@bingran-you bingran-you commented Apr 23, 2026

Fixes #308.

Summary

  • replace daemon identity resolution's gh auth status --json hosts dependency with plain gh auth status --active --hostname <host> parsing
  • normalize quoted and unquoted scope output from gh auth status
  • add a regression test that asserts the resolver no longer passes --json

Testing

  • pnpm exec vitest run tests/breeze/breeze-daemon-identity.test.ts
  • pnpm typecheck
  • pnpm build
  • isolated smoke: BREEZE_DIR=$(mktemp -d) then node dist/cli.js breeze doctor --allow-repo agent-team-foundation/first-tree

Copy link
Copy Markdown
Collaborator Author

@bingran-you bingran-you left a comment

Choose a reason for hiding this comment

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

LGTM. The approach is clean: drop the non-existent --json flag, parse the human-readable output from gh auth status --active --hostname <host>, and keep handling both quoted ('repo', 'workflow') and unquoted comma-separated scope styles. Nice touches:

  • The new regression test asserts --json hosts is no longer in argv — that pins down #308's root cause.
  • parseScopes filters (none) / none, so a zero-scope token won't masquerade as scope "(none)".
  • The login parser uses Logged in to <host> account as the anchor, which avoids false positives from the summary/keyring-status lines.

Sanity-checked against real gh 2.86.0 output locally — it writes to stdout (matches what runChecked returns), so the parser sees what we expect. Verified the smoke command in the PR body (breeze doctor --allow-repo …) is the right end-to-end regression check for #308.

PR is behind main but mergeable — just needs a rebase before merging. The failing tree-sync check is an unrelated auth/TREE_REPO_TOKEN issue, not caused by this change.

This reply was drafted by breeze, an autonomous agent running on behalf of the account owner.

@bingran-you bingran-you added breeze:done breeze has finished handling it and removed breeze:wip breeze is actively working on it labels Apr 23, 2026
@yuezengwu yuezengwu added breeze:wip breeze is actively working on it and removed breeze:done breeze has finished handling it labels Apr 23, 2026
@bingran-you bingran-you added breeze:done breeze has finished handling it and removed breeze:wip breeze is actively working on it labels Apr 23, 2026
Copy link
Copy Markdown

@yuezengwu yuezengwu left a comment

Choose a reason for hiding this comment

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

No findings. The change removes the gh auth status --json hosts dependency, parses the stable text output from gh auth status --active --hostname <host>, and preserves the needed login/protocol/scope behavior.

Verified locally:

  • pnpm exec vitest run tests/breeze/breeze-daemon-identity.test.ts
  • pnpm typecheck
  • pnpm build
  • BREEZE_DIR=$(mktemp -d) node dist/cli.js breeze doctor --allow-repo agent-team-foundation/first-tree

The remaining failing tree-sync check fails while cloning first-tree-context due to invalid tree repo credentials, before this PR's code runs, so I do not consider it caused by this change.

This reply was drafted by breeze, an autonomous agent running on behalf of the account owner.

yuezengwu
yuezengwu previously approved these changes Apr 23, 2026
Copy link
Copy Markdown

@yuezengwu yuezengwu left a comment

Choose a reason for hiding this comment

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

No findings from my review. I verified the parser against local gh auth status --active --hostname github.com output from gh 2.91.0, and ran:\n\n- pnpm exec vitest run tests/breeze/breeze-daemon-identity.test.ts\n- pnpm typecheck\n\nBoth passed locally. The PR also keeps the daemon resolver off gh auth status --json hosts, which addresses #308 directly. The remaining failing tree-sync check appears unrelated to this patch.\n\nThis reply was drafted by breeze, an autonomous agent running on behalf of the account owner.

@yuezengwu yuezengwu dismissed their stale review April 23, 2026 03:39

Dismissing duplicate approval; an earlier yuezengwu review already covered this.

Copy link
Copy Markdown
Contributor

@serenakeyitan serenakeyitan left a comment

Choose a reason for hiding this comment

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

LGTM. Text-parsing gh auth status --active --hostname <host> is the right call — the --json hosts flag isn't uniformly supported across gh releases, and the new parser correctly handles the shell-quoted scopes + (none) sentinel + Git-protocol line. Regression test pins the no---json contract. Nice fix.

@bingran-you bingran-you added breeze:wip breeze is actively working on it and removed breeze:done breeze has finished handling it labels Apr 23, 2026
@bingran-you bingran-you force-pushed the fix/breeze-auth-status-text-308 branch from 5fe69b5 to 3eb734b Compare April 23, 2026 04:13
@bingran-you
Copy link
Copy Markdown
Collaborator Author

Rebased this PR onto current main and reran the local validation from the PR body:

  • pnpm exec vitest run tests/breeze/breeze-daemon-identity.test.ts
  • pnpm typecheck
  • pnpm build
  • BREEZE_DIR=$(mktemp -d) node dist/cli.js breeze doctor --allow-repo agent-team-foundation/first-tree

All four passed locally on the rebased head.

GitHub now shows ci passing on the updated commit, but tree-sync is still failing before this PR's code runs while cloning first-tree-context:

remote: Invalid username or token. Password authentication is not supported for Git operations.

So the patch itself is validated and approved, but the PR is still blocked on the repo's unrelated TREE_REPO_TOKEN / tree-sync credentials issue. Merging from here would require either fixing that credential path or making an explicit admin-override decision.

This reply was drafted by breeze, an autonomous agent running on behalf of the account owner.

@bingran-you bingran-you added breeze:human breeze needs human input or judgment and removed breeze:wip breeze is actively working on it labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breeze:human breeze needs human input or judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

breeze: gh auth status --json hosts is an invalid flag, blocks daemon start

3 participants