Skip to content

fix: honor run cwd in command templates#235

Open
Bortlesboat wants to merge 1 commit into
CortexLM:mainfrom
Bortlesboat:fix/run-command-cwd-template
Open

fix: honor run cwd in command templates#235
Bortlesboat wants to merge 1 commit into
CortexLM:mainfrom
Bortlesboat:fix/run-command-cwd-template

Conversation

@Bortlesboat
Copy link
Copy Markdown

Summary

  • Make cortex run --cwd <dir> --command <name> pass the requested run cwd into custom command templates.
  • Preserve the previous process-current-directory fallback when --cwd is not provided.
  • Add an integration regression test for both code paths.

Why

This addresses PlatformNetwork/bounty-challenge#53357. The command registry already scans commands from --cwd, but {{cwd}} expansion used std::env::current_dir() instead of the run cwd override.

Verification

  • cargo test -p cortex-cli --test run_command_cwd
  • cargo check -p cortex-cli
  • cargo fmt --check --package cortex-cli
  • git diff --check

Note: cargo test -p cortex-cli run_cmd::tests::test_output_format_display is currently blocked on upstream main by an unrelated private import in src/cortex-cli/src/agent_cmd/tests.rs.

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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.

1 participant