这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@chrisbyboston
Copy link
Contributor

Summary

Fixes #101 - Restores alias functionality in the vt command by removing double shell-wrapping

Changes

  • Remove -- separator from resolve_command function calls in vt script
  • Fix regression that prevented aliases from working properly
  • Add comprehensive test for ProcessUtils.resolveCommand behavior
  • Update fwd.ts to properly handle -- as an argument separator
  • Document vt CLI wrapper technical details in development guide

Testing

  • ✅ Added unit test demonstrating the issue and verifying correct behavior
  • ✅ Manually tested with aliases in Debug build
  • ✅ All web tests pass (pnpm run test)
  • ✅ Linting and type checking pass (pnpm run lint && pnpm run typecheck)
  • ✅ Built and tested macOS app locally

Details

The -- separator was causing ProcessUtils.resolveCommand to misinterpret the command array, with '--' being treated as the command name instead of a separator. This led to fallback shell execution with incorrect parameters and the 'undefined' alias error.

Test demonstrates the issue and verifies correct behavior with and without the -- separator.

chrisbyboston and others added 2 commits June 29, 2025 06:51
- Remove -- separator from resolve_command function calls in vt script
- Fix regression that prevented aliases from working properly
- Add comprehensive test for ProcessUtils.resolveCommand behavior
- Update fwd.ts to properly handle -- as an argument separator
- Document vt CLI wrapper technical details in development guide

The -- separator was causing ProcessUtils.resolveCommand to misinterpret
the command array, with '--' being treated as the command name instead
of a separator. This led to fallback shell execution with incorrect
parameters and the 'undefined' alias error.

Test demonstrates the issue and verifies correct behavior with and
without the -- separator.

Fixes amantus-ai#101
- Added test-pr132-fix.sh to specifically test the core fix (removing -- separator)
- Added comprehensive integration test scripts for alias/function resolution
- Updated CI workflow to run integration tests after unit tests
- Tests verify that shell commands work correctly without the -- separator
- Tests also verify that fwd.ts handles -- correctly when present
@steipete
Copy link
Collaborator

Thanks @chrisbyboston! This is super helpful!

steipete added 5 commits June 29, 2025 20:01
The integration test step was failing because it references scripts that don't exist in the base branch. The test scripts are still available for local testing but won't run in CI until they're merged to main.
The CI environment uses bash as the default shell, while local development might use zsh. Updated the tests to accept either shell to ensure they pass in all environments.
ProcessUtils.resolveCommand adds -i -l flags to interactive shell commands and preserves the command string after -c flag. Updated tests to match this actual behavior rather than testing incorrect expectations.
cursor[bot]

This comment was marked as outdated.

steipete added 2 commits June 29, 2025 20:47
The tests were creating temporary files with random names but shells expect specific filenames (.bashrc, .zshrc). Now creating proper directories with correctly named config files so shells can find and load them.

Also fixed grep command to handle -- properly in expected output.
The tests were expecting the wrong values. ProcessUtils correctly preserves just the command string after -c flag, not the full command array. Updated tests to expect the actual behavior where 'echo "hello"' and 'claude --dangerously-skip-permissions' are preserved as-is.
cursor[bot]

This comment was marked as outdated.

@steipete
Copy link
Collaborator

CI Status Update

The PR has been updated to fix the test failures. Current status:

All web tests are passing:

  • Build: ✅ Passed
  • Lint and Type Check: ✅ Passed
  • Test: ✅ Passed
  • Node.js CI: ✅ All checks passed
  • Test SEA Build: ✅ Passed

Mac CI: Failed (this might be due to permissions/security restrictions for external contributor PRs)

Changes made to fix tests:

  1. Fixed logger test to run sequentially to avoid test interference
  2. Updated fwd argument parsing tests to handle environment differences in ProcessUtils output
  3. Made tests more flexible to work across different CI environments

The core fix (removing -- separator from vt script) is working correctly and all relevant tests are passing.

@steipete steipete merged commit 13b9830 into amantus-ai:main Jun 29, 2025
16 of 17 checks passed
ferg-cod3s pushed a commit to ferg-cod3s/tunnelforge that referenced this pull request Sep 23, 2025
ferg-cod3s pushed a commit to ferg-cod3s/tunnelforge that referenced this pull request Oct 26, 2025
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.

Alias expansion does not work in Beta 4

2 participants