Skip to content

fix(antigravity): honor CLI overrides and explain excluded reports - #3689

Closed
hhh2210 wants to merge 20 commits into
steipete:mainfrom
hhh2210:antigravity/identity-guard
Closed

hhh2210 wants to merge 20 commits into
steipete:mainfrom
hhh2210:antigravity/identity-guard

Conversation

@hhh2210

@hhh2210 hhh2210 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

The shared per-source diagnostics have landed in #3683 and are included in 0.61.0. This PR now contains only the remaining Antigravity override and identity-free report boundaries. Refs #3673, #3649, #3650, and #3662.

An unusable ANTIGRAVITY_CLI_PATH previously fell through to an ambient agy. A background usage refresh could therefore launch the CLI and trigger interactive login even when the explicit path was intended to disable discovery.

  • Make only Antigravity's explicit override authoritative. An unusable override stops resolution before PATH, well-known locations, shell lookup, or alias lookup; an absent override retains normal discovery. Other providers keep the shared resolver's existing behavior.
  • Explain why Auto excludes an identity-free agy -p /usage report when an account is selected or OAuth credentials are injected. Diagnose exports and debug logs retain the safe identity_free_report_excluded category. Explicit CLI mode keeps its report fallback.
  • Preserve main's error precedence, including notRunning and missingCSRFToken placeholders. The merged fix(antigravity): complete per-source failure diagnostics #3683 pipeline, upstream proof-isolation fix, and released diagnostics note are retained unchanged.

Compatibility decision for maintainers: treating an unusable explicit Antigravity path as disabling ambient discovery is intentional and changes main's fallback behavior for that provider. This policy still needs maintainer acceptance; the unrelated providers' contracts are unchanged.

The latest main is merged. The two unshipped changes are documented in a new Unreleased section. Released changelog history exactly matches main, with #3683 correctly recorded under 0.61.0 and the stale duplicate under 0.60.5 removed.

Validation

  • Current integration: make check, git diff --check, exact source-anchor checks, and comparison of shared pipeline/CLI files with upstream main passed.
  • Previous head 05d6b4993: all nine GitHub checks passed, including both macOS test shards and all Linux CLI builds.
  • On that head, local focused suites passed 168 Swift Testing tests plus 43 XCTest tests. The full run completed all 1,189 selections in 110 groups on the first pass, with no retries or timeouts.
  • Seven isolated production CLI scenarios passed: four unusable overrides made zero sentinel calls; an ambient-discovery positive control executed the sentinel; scoped Auto usage and diagnose omitted the identity-free report and exposed its safe category. Sanitized evidence.

This update integrates main and fixes changelog placement; the guard/exclusion behavior is unchanged from that validated head. Local Swift/AppKit suites were not rerun for this integration. Current-head CI is pending after the push.

When every auto source fails, keep the most authoritative attempted
source's error (app > cli > ide > oauth > offline) instead of the last
one written: only .notRunning placeholders still yield to later errors.
Add per-source outcome diagnostics: an auto-failure summary line in
codexbar usage text output, one debug log line when a pipeline exhausts
its strategies, and strategyID + outcome fields in the diagnose export.

Part of steipete#3673 (workstream 1); targets the error-masking class behind
steipete#3146 and steipete#3662. Source precedence is unchanged.
A set-but-non-executable *_CLI_PATH override was treated as absent and
resolution fell through to login-PATH, well-known paths, and shell
lookups, so ANTIGRAVITY_CLI_PATH=/nonexistent still resolved the real
agy and a background one-shot report fetch could spawn its interactive
login. Overrides are now authoritative: unusable overrides fail
resolution outright (BinaryLocator.resolveBinary plus the Codex RPC
resolver's direct CODEX_CLI_PATH read), and the Claude planner's
fallthrough characterization now pins fail-fast.

Part of steipete#3673 (workstream 2).
When auto mode has a selected token account or injected OAuth
credentials, the identity-free 'agy -p /usage' fallback was suppressed
by rethrowing the legacy failure with no trace that the report was
skipped. The exclusion now throws a dedicated error whose description
keeps the underlying failure and names the skipped identity-free
report, so per-source outcomes (usage summary, debug log, diagnose)
show it. Placeholder .notRunning failures still pass through unwrapped
to keep the first-authoritative fold semantics from steipete#3683 intact.

Part of steipete#3673 (workstream 2, conservative branch).
… fails

The app/ide account-mismatch error claimed CodexBar is 'using the
selected account's OAuth data instead', which is wrong in the all-failed
corner where this error stays surfaced while the OAuth source has also
failed. State the rejection and the data-source policy instead of
promising an OAuth switch.

Part of steipete#3673 (workstream 2, copy-only follow-up to steipete#3683).
Copilot AI lite review requested due to automatic review settings September 16, 2026 13:11
@clawsweeper

clawsweeper Bot commented Sep 16, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T13:18:36.207391Z 98df78c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex review: blocked before merge. Reviewed September 18, 2026, 1:21 PM ET / 17:21 UTC (Revision 4).

ClawSweeper review

What this changes

The branch makes invalid Antigravity CLI path overrides stop executable discovery and adds safe explanations when Auto excludes account-unverified usage reports.

Merge readiness

Blocked before merge - 3 items remain

The PR retains useful work beyond the merged diagnostics changes, and the earlier findings are resolved. No new actionable defect was found; the intentional override compatibility change still needs maintainer acceptance.

Priority: P2
Reviewed head: 1eb084d5f25875f296d738208dcd38be21125a72
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused patch with sufficient production CLI evidence, resolved prior findings, and one explicit compatibility decision.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The captured macOS production CLI run exercises actual resolver, subprocess, and diagnostic owners with an isolated sentinel: invalid overrides prevent execution, absent overrides permit it, and scoped Auto emits the exclusion category without running the usage report. Relevant behavior is unchanged since the recorded source revision.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured macOS production CLI run exercises actual resolver, subprocess, and diagnostic owners with an isolated sentinel: invalid overrides prevent execution, absent overrides permit it, and scoped Auto emits the exclusion category without running the usage report. Relevant behavior is unchanged since the recorded source revision.
Evidence reviewed 9 items Repository policy and review scope: Read the complete root AGENTS.md; no nested AGENTS.md or .agents/maintainer-notes directory exists. Applied provider isolation and credential-safe validation guidance. No builds, tests, or live account probes were executed during this read-only review.
Introduced scope and compatibility boundary: The complete main-to-head diff adds the authoritative override check only to Antigravity. An invalid explicit path now returns nil before ambient discovery; shared resolution and other providers retain their existing behavior. The PR body explicitly identifies this as an unapproved compatibility decision.
Existing account boundary preserved: The selected/injected-account exclusion predicate remains equivalent to main. The patch adds an explanatory error while preserving cancellation and the notRunning/missingCSRFToken placeholders. Focused tests cover selected and injected accounts, explicit CLI mode, unavailable-source precedence, and redacted export categories.
Findings None None.
Security None None.

How this fits together

CodexBar’s Antigravity provider combines local app, CLI, and OAuth sources into usage results. Executable discovery controls CLI launches, while account-selection rules determine whether fallback reports can supply quotas.

flowchart TD
  A[Usage refresh] --> B[CLI path resolution]
  B --> C{Explicit path usable?}
  C -->|Invalid| D[Skip CLI source]
  C -->|Valid or normally discovered| E[Try local CLI quota source]
  E --> F{Report permitted for selected account?}
  F -->|Yes| G[Read usage report]
  F -->|No| H[Record safe exclusion and continue fallback]
Loading

Decision needed

Question Recommendation
Should an invalid ANTIGRAVITY_CLI_PATH disable ambient CLI discovery for existing installations? Preserve fallback compatibility: Retain existing fallback by default and expose deliberate no-discovery behavior through an explicit opt-in.

Why: The current release falls back, while the proposed behavior deliberately stops discovery; source correctness and runtime proof cannot establish acceptance of that upgrade policy.

Before merge

  • Resolve merge risk (P1) - Existing installations with an invalid ANTIGRAVITY_CLI_PATH that currently recover through PATH will lose the CLI source after upgrade until the override is corrected or removed; acceptance of that intentional change remains unresolved.
  • Complete next step (P2) - Obtain maintainer acceptance of authoritative invalid Antigravity overrides, or revise discovery suppression to preserve existing fallback by default.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test growth Production net +32 lines; tests net +193 lines Production growth is justified by the scoped resolver guard and exclusion diagnostics, with focused boundary coverage.
Production CLI scenarios 7 recorded scenarios The transcript covers four invalid overrides, normal discovery, and scoped Auto usage and diagnose output.

Merge-risk options

Maintainer options:

  1. Choose a compatible default (recommended)
    Preserve ambient fallback for existing users and make deliberate discovery suppression opt-in.
  2. Approve the documented behavior change
    Accept that invalid Antigravity overrides disable CLI discovery and retain the accompanying documentation and regression coverage.

Technical review

Best possible solution:

Keep the exclusion diagnostics, and preserve existing discovery by default with an explicit no-discovery opt-in unless maintainers approve the documented Antigravity-only compatibility change.

Do we have a high-confidence way to reproduce the issue?

Yes: current main’s resolver falls through an unusable override to ambient discovery, and scoped Auto report exclusions lack the dedicated category. This is source-verified; the reviewer did not execute a current-main reproduction.

Is this the best way to solve the issue?

Unclear until the compatibility policy is accepted: the implementation is narrow and preserves account guards, but preserving fallback by default would avoid breaking existing invalid-override setups.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1d8cb13d3fba.

Labels

Label justifications:

  • P2: This is a bounded Antigravity source-selection and diagnostic improvement with no demonstrated urgent regression.
  • merge-risk: 🚨 compatibility: Existing invalid overrides will stop recovering through ambient discovery, potentially removing a working CLI source after upgrade.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured macOS production CLI run exercises actual resolver, subprocess, and diagnostic owners with an isolated sentinel: invalid overrides prevent execution, absent overrides permit it, and scoped Auto emits the exclusion category without running the usage report. Relevant behavior is unchanged since the recorded source revision.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured macOS production CLI run exercises actual resolver, subprocess, and diagnostic owners with an isolated sentinel: invalid overrides prevent execution, absent overrides permit it, and scoped Auto emits the exclusion category without running the usage report. Relevant behavior is unchanged since the recorded source revision.

Evidence

What I checked:

  • Repository policy and review scope: Read the complete root AGENTS.md; no nested AGENTS.md or .agents/maintainer-notes directory exists. Applied provider isolation and credential-safe validation guidance. No builds, tests, or live account probes were executed during this read-only review. (AGENTS.md:1, 1eb084d5f258)
  • Introduced scope and compatibility boundary: The complete main-to-head diff adds the authoritative override check only to Antigravity. An invalid explicit path now returns nil before ambient discovery; shared resolution and other providers retain their existing behavior. The PR body explicitly identifies this as an unapproved compatibility decision. (Sources/CodexBarCore/PathEnvironment.swift:131, 1eb084d5f258)
  • Existing account boundary preserved: The selected/injected-account exclusion predicate remains equivalent to main. The patch adds an explanatory error while preserving cancellation and the notRunning/missingCSRFToken placeholders. Focused tests cover selected and injected accounts, explicit CLI mode, unavailable-source precedence, and redacted export categories. (Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:540, 1eb084d5f258)
  • Production CLI behavior proof: The complete captured transcript exercises the built CLI under macOS isolation: four invalid overrides cause zero sentinel invocations; absent override invokes the sentinel including /usage; scoped Auto usage and diagnose invoke only --version and expose identity_free_report_excluded. These observations exercise actual executable discovery, subprocess boundaries, and diagnostic serialization without real credentials. The prepared screenshots were also inspected; they belong to the earlier Settings guidance PR and are not proof for this branch. (.github/pr-proof/antigravity-identity-guard.log:1, 1eb084d5f258)
  • Proof continuity across integration: GitHub comparisons show the proof source revision to the previous reviewed head changes only the proof log and architecture test anchors. Comparing that reviewed head with the current head leaves the Antigravity guard/exclusion behavior unchanged; the resolver’s unrelated access-level change comes from main. Local historical diff/blame attempts encountered unavailable blobs and HTTP 403; GitHub read-only comparisons supplied the relevant continuity evidence. (Sources/CodexBarCore/PathEnvironment.swift:131, 1eb084d5f258)
  • Prior review concerns resolved: The two remaining changes are under Unreleased, resolving the prior changelog finding. Earlier cross-provider override edits are absent. Main’s shared pipeline already applies the folded terminal error and logs only safe categories; this branch preserves those files unchanged. (CHANGELOG.md:3, 1eb084d5f258)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • sobczi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • hhh2210: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the maintainer’s decision on invalid Antigravity overrides before landing.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-16T13:14:26.405Z sha 98df78c :: needs real behavior proof before merge. :: [P1] [P1] Preserve unrelated providers' override fallback behavior | [P2] [P2] Apply the selected error to terminal source failures | [P2] [P2] Preserve a safe exclusion reason in diagnostic exports
  • reviewed 2026-09-17T05:25:03.755Z sha 5f19650 :: needs real behavior proof before merge. :: [P1] [P1] Preserve unrelated providers' override fallback behavior | [P2] [P2] Preserve a safe exclusion reason in diagnostic exports | [P2] [P2] Log safe categories instead of raw provider errors | [P2] [P2] Emit source diagnostics before terminal failure returns
  • reviewed 2026-09-18T11:50:39.841Z sha 05d6b49 :: blocked before merge. :: [P3] Move the diagnostics entry into the unreleased section

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved moderate findings and test coverage nits remain.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR hardens CLI override resolution and makes Antigravity identity-free fallback diagnostics visible.

Changes:

  • Makes unusable CLI overrides fail fast.
  • Surfaces identity-free report exclusions and improves error messaging.
  • Adds per-source diagnostics, tests, documentation, and changelog updates.
File summaries
File Reviewed change / final comment
Tests/CodexBarTests/ProviderDiagnosticExportTests.swift Covers diagnostic export behavior.
Tests/CodexBarTests/ProviderArchitectureGatekeeperTests.swift Updates provider architecture anchors.
Tests/CodexBarTests/CLIAntigravityFallbackSummaryTests.swift Tests CLI fallback summaries.
Tests/CodexBarTests/ClaudeSourcePlannerTests.swift Pins fail-fast Claude override behavior.
Tests/CodexBarTests/AntigravityCLIUsageReportTests.swift Tests identity-free report exclusion.
Tests/CodexBarTests/AntigravityCLIHTTPSFetchStrategyTests.swift Tests fallback behavior and outcomes.
Tests/CodexBarTests/AntigravityBinaryLocatorTests.swift Nit (1 vote): Assert lookup closures are never called.
Sources/CodexBarCore/Providers/ProviderFetchPlan.swift Adds strategy outcomes and diagnostic logging.
Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift Moderate (1 vote): Preserve an exclusion code or field in diagnose exports.
Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift Moderate (1 vote): Add a stable diagnostic category or flag for identity-free exclusions.
Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift Moderate (1 vote): Apply and log resolved errors on terminal strategy returns.
Sources/CodexBarCore/PathEnvironment.swift Moderate (1 vote): Route Kiro resolution through the shared fail-fast resolver or narrow the guarantee.
Sources/CodexBarCore/CodexExecutableResolver.swift Nit (2 votes): Add coverage for an unusable CODEX_CLI_PATH with an ambient executable.
Sources/CodexBarCLI/CLIUsageCommand.swift Displays Antigravity fallback summaries.
Sources/CodexBarCLI/CLIHelpers.swift Formats per-source summaries.
docs/antigravity.md Documents override and fallback behavior.
CHANGELOG.md Records the fixes.
Review details

Suppressed comments (5)

Sources/CodexBarCore/PathEnvironment.swift:370

  • This makes the shared resolver fail-fast only for callers that actually use it. The Kiro production strategy still calls TTYCommandRunner.which("kiro-cli"), and KiroStatusProbe launches that result, so KIRO_CLI_PATH=/nonexistent can still discover and spawn an ambient kiro-cli (and a valid override is ignored). Route Kiro availability and execution through BinaryLocator.resolveKiroCLIBinary using the fetch context environment, or narrow the all-override guarantee.
        if let override = env[overrideKey] {
            return fileManager.isExecutableFile(atPath: override) ? override : nil

Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift:236

  • This fold is only used to update lastAvailableError; ProviderFetchPipeline.fetch still returns the current error immediately when shouldFallback is false. Antigravity's OAuth strategy does that when no offline data exists, and the offline strategy is terminal too, so an OAuth/offline error can still mask an earlier app/CLI/IDE failure and bypass the new per-source debug log. Apply the resolved error on terminal returns (and log that path), with a regression test using the real terminal strategy behavior.
        guard (previous as? AntigravityStatusProbeError) == .notRunning else {
            return previous

Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift:795

  • This wrapper makes the skip visible in the CLI text and debug log, but the diagnose export maps each attempt to only errorCategory, and errorCategoryLabel has no case for this new error. For example, the timed-out exclusion is exported as unknown, so codexbar diagnose still cannot tell that the identity-free report was intentionally skipped, contrary to the stated visibility goal. Add a stable redacted category/flag for this case (and pin it in the export tests) rather than relying on the raw description.
        case let .identityFreeReportExcluded(underlyingDescription):
            "\(underlyingDescription) Identity-free CLI usage report skipped: "
                + "it cannot prove which Google account the quota belongs to."

Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift:295

  • The new exclusion reason is discarded when attempts are converted for codexbar diagnose: this initializer keeps only the coarse errorCategory derived from errorDescription, so the exported CLI attempt still says only failed/api (or network) and does not reveal that the identity-free report was skipped. Preserve a non-sensitive exclusion code/field in the diagnostic payload (without exporting raw error text) and add a regression test so the diagnose export actually shows this boundary.
            outcome: attempt.outcome.rawValue,
            wasAvailable: attempt.wasAvailable,
            errorCategory: attempt.errorDescription.map(Self.errorCategoryLabel))

Tests/CodexBarTests/AntigravityBinaryLocatorTests.swift:34

  • The test name promises that no ambient lookup runs, but both injected lookup closures merely return nil, so a regression that calls either closure would still pass. Make the closures record a test failure (or count calls and assert zero) so the new no-fallthrough guarantee is actually covered.
        let commandV: (String, String?, TimeInterval, FileManager) -> String? = { _, _, _, _ in nil }
        let aliasResolver: (String, String?, TimeInterval, FileManager, String) -> String? = { _, _, _, _, _ in nil }
  • Files reviewed: 17/17 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +23 to +27
if let override = environment["CODEX_CLI_PATH"] {
// A set-but-unusable override is authoritative: fail instead of falling
// through to ambient resolution, which would launch a real binary the
// override was meant to suppress.
guard FileManager.default.isExecutableFile(atPath: override) else { return nil }

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98df78cc66

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +235 to +236
guard (previous as? AntigravityStatusProbeError) == .notRunning else {
return previous

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Surface the folded error when OAuth is terminal

In Auto mode with OAuth credentials but no offline database, AntigravityOAuthFetchStrategy.shouldFallback returns false when OAuth fails. ProviderFetchPipeline then immediately returns the current OAuth error rather than the lastAvailableError produced by this fold, so an earlier substantive app/CLI failure is still replaced by the less-authoritative OAuth failure in this common all-sources-failed path. Return the folded error on terminal failures, or allow this pipeline to exhaust before returning.

Useful? React with 👍 / 👎.

Comment on lines +415 to +417
let detail = switch attempt.outcome {
case .failed:
"failed: \(attempt.errorDescription ?? "unknown error")"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Sanitize provider errors before writing debug logs

When debug logging is enabled, every exhausted provider pipeline now writes raw localizedDescription values to persistent logs. These descriptions are not safe diagnostic fields: for example, Factory parse failures include the first 200 characters of response JSON, and the Claude OAuth code explicitly avoids logging localized descriptions because server bodies can contain identifying information. LogRedactor only covers a limited set of patterns, so log the already-derived safe error category/outcome instead of attempt.errorDescription and surfacedError.localizedDescription.

Useful? React with 👍 / 👎.

Comment on lines +369 to +370
if let override = env[overrideKey] {
return fileManager.isExecutableFile(atPath: override) ? override : nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve empty Claude overrides as authoritative

When CLAUDE_CLI_PATH is set to an empty or whitespace-only value, ClaudeCLIResolver.resolvedBinaryPath removes the key before calling this shared resolver, so the new authoritative-override branch is bypassed and Claude is still discovered through PATH or well-known locations. This leaves the same unwanted background-spawn behavior that fail-fast overrides are intended to prevent for one of the listed override keys; retain the normalized empty value so resolution returns nil rather than treating it as unset.

Useful? React with 👍 / 👎.

…guard

# Conflicts:
#	CHANGELOG.md
#	Tests/CodexBarTests/AntigravityCLIHTTPSFetchStrategyTests.swift
#	docs/antigravity.md
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. label Sep 17, 2026
@hhh2210 hhh2210 changed the title fix(antigravity): fail fast on unusable CLI overrides + visible identity-free exclusion fix(antigravity): honor CLI overrides and explain excluded reports Sep 18, 2026
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Sep 18, 2026
…guard

# Conflicts:
#	CHANGELOG.md
#	Tests/CodexBarTests/CLIEntryTests.swift
#	Tests/CodexBarTests/ProviderArchitectureGatekeeperTests.swift
#	Tests/CodexBarTests/ProviderDiagnosticExportTests.swift
steipete added a commit that referenced this pull request Sep 22, 2026
Treat an unusable ANTIGRAVITY_CLI_PATH as authoritative so background
refreshes cannot discover and launch a different agy. Preserve other
providers' lookup behavior and simplify the final optional fallback.

Adopt the scoped override fix from #3689, with synthetic red-to-green
regressions, documentation, and the 0.64.1 release note. Document current
CLI-only quota behavior separately from desktop-free OAuth setup (#3146).

Co-authored-by: hhh2210 <hzy2210@gmail.com>
(cherry picked from commit b275fcd)
steipete added a commit that referenced this pull request Sep 22, 2026
Treat an unusable ANTIGRAVITY_CLI_PATH as authoritative so background
refreshes cannot discover and launch a different agy. Preserve other
providers' lookup behavior and simplify the final optional fallback.

Adopt the scoped override fix from #3689, with synthetic red-to-green
regressions, documentation, and the 0.64.1 release note. Document current
CLI-only quota behavior separately from desktop-free OAuth setup (#3146).

Co-authored-by: hhh2210 <hzy2210@gmail.com>
(cherry picked from commit b275fcd)
@steipete

Copy link
Copy Markdown
Owner

Adopted the Antigravity-specific explicit-path guard and resolver regression coverage in #3847 (b275fcd). An unusable ANTIGRAVITY_CLI_PATH stops discovery before PATH, install locations, shell lookup, or aliases; removing the override restores normal discovery. Thanks @hhh2210. The extra diagnostic category is not included. All four invalid-override cases failed before the fix and pass afterward; 590 focused Swift tests, make check, independent review, and CI passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants