Skip to content

fix(ccusage): harden PATH enrichment and add regression tests - #220

Merged
robinebers merged 1 commit into
mainfrom
fix/ccusage-path-hardening
Feb 24, 2026
Merged

fix(ccusage): harden PATH enrichment and add regression tests#220
robinebers merged 1 commit into
mainfrom
fix/ccusage-path-hardening

Conversation

@robinebers

@robinebers robinebers commented Feb 24, 2026

Copy link
Copy Markdown
Owner

Description

  • Rework ccusage PATH enrichment to use OS-safe path handling via split_paths + join_paths.
  • Unify runner probe/execution command setup so both use the same PATH override contract.
  • Add regression tests for PATH ordering, deduplication, split/join round-trip behavior, and command PATH wiring.

Related Issue

  • N/A

Type of Change

  • Bug fix
  • New feature
  • New provider plugin
  • Documentation
  • Performance improvement
  • Other (describe below)

Testing

  • I ran bun run build and it succeeded
  • I ran bun run test and all tests pass
  • I tested the change locally with bun tauri dev
  • I ran cargo test in src-tauri (45 passing)
  • I ran cargo test ccusage --lib in src-tauri (16 passing)
  • I ran bun run test:coverage (tests passed; command failed on existing unrelated coverage thresholds in app hooks/components)

Screenshots

  • Not applicable (no UI changes)

Checklist

  • I read CONTRIBUTING.md
  • My PR targets the main branch
  • I did not introduce new dependencies without justification

Made with Cursor


Note

Cursor Bugbot is generating a summary for commit 914ae10. Configure here.


Summary by cubic

Hardened ccusage PATH handling with OS-safe split/join and a shared command configuration so runner detection and execution behave consistently across environments. Adds focused regression tests to lock in ordering, deduplication, and PATH wiring.

  • Bug Fixes

    • Build PATH using split_paths/join_paths; preserve order and dedupe entries.
    • Prepend home bin dirs (~/.bun/bin, ~/.nvm/current/bin, ~/.local/bin) and defaults (/opt/homebrew/bin, /usr/local/bin).
    • Use one configure_ccusage_command and enriched PATH for both runner probing and execution.
  • Tests

    • Validate PATH ordering, deduplication, and split/join round-trip.
    • Verify PATH is correctly set for commands when provided, and skipped when absent.

Written for commit 914ae10. Summary will update on new commits.

Use OS-safe PATH construction and shared command configuration so runner probing and execution behave consistently across environments. Add focused tests for PATH entry ordering, deduplication, split/join behavior, and PATH env wiring to prevent regressions.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

@davidarny davidarny left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@davidarny davidarny mentioned this pull request Feb 24, 2026
@robinebers
robinebers merged commit 35a921f into main Feb 24, 2026
4 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.

2 participants