Repository navigation
Closed
Labels
Milestone
Description
Bug report form
- I have done a basic search of the issue tracker to find any existing issues that are similar.
- I have checked that my version is at least the latest stable release available via my installation method.
Describe the bug
When attempting to call EngineInterface::call_decl on a custom command in a plugin, the following error occurs:
Error: nu::shell::error
× Internal error: can't run custom command with 'run', use block_id
How to reproduce
I have a plugin with the following for a command call-foo.
fn run(
&self,
plugin: &Self::Plugin,
engine: &EngineInterface,
call: &EvaluatedCall,
input: PipelineData,
) -> Result<PipelineData, LabeledError> {
let decl_id = engine.find_decl("foo")?;
eprintln!("decl_id = {decl_id:?}");
match decl_id {
Some(decl_id) => engine
.call_decl(decl_id, EvaluatedCall::new(call.head), input, true, false)
.map_err(Into::into),
None => Ok(PipelineData::empty()),
}
}If foo is defined in another plugin, for example on that simply outputs FOO (or if it is replaced with a built-in command), the following happens:
> call-foo
decl_id = Some(DeclId(477))
FOOIf foo is instead defined as a custom command, the error occors:
> def foo [] { 'FOO' }
> call-foo
decl_id = Some(DeclId(592))
Error: nu::shell::error
× Internal error: can't run custom command with 'run', use block_idExpected behavior
Calling find_decl followed by call_decl on a custom command should just run the custom command.
Configuration
| key | value |
|---|---|
| version | 0.108.0 |
| major | 0 |
| minor | 108 |
| patch | 0 |
| branch | |
| commit_hash | da141be |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-musl |
| rust_version | rustc 1.88.0 (6b00bc388 2025-06-23) |
| rust_channel | 1.88.0-x86_64-unknown-linux-gnu |
| cargo_version | cargo 1.88.0 (873a06493 2025-05-10) |
| build_time | 2025-10-15 12:05:23 +00:00 |
| build_rust_channel | release |
| allocator | standard |
| features | default, network, plugin, rustls-tls, sqlite, static-link-openssl, trash-support |
| installed_plugins | |
| experimental_options | example=false, reorder-cell-paths=true, pipefail=false, enforce-runtime-annotations=false |
Activity
Run commands found by id through one IR call path (AST migration phas…