libnyanpasu/clash-nyanpasu · critical

unimplemented!()

Error message

unimplemented!()

What it means

Runner::process_honey is a default trait method for in-memory script execution ('honey' replacement) and is deliberately left unimplemented!() because some embedded engines cannot load-and-exec code from a string. Panics if a script type's runner does not override it but honey processing is requested.

Source

Thrown at backend/tauri/src/enhance/script/runner.rs:45

    };
}

pub(super) use wrap_result;

#[async_trait]
pub trait Runner: Send + Sync {
    fn try_new() -> Result<Self, Error>
    where
        Self: std::marker::Sized;
    #[allow(dead_code)]
    /// Process profiles by script file path
    async fn process(&self, mapping: Mapping, path: &str) -> ProcessOutput;

    /// Honey replacement - use in memory code str to load module and exec it!
    /// It might not be implemented - due to some embeded engine is not support.
    async fn process_honey(&self, mapping: Mapping, script: &str) -> ProcessOutput {
        tracing::debug!("mapping: {:?}\nscript:{}", mapping, script);
        unimplemented!()
    }
}

pub struct RunnerManager {
    runners: HashMap<ScriptType, Box<dyn Runner>>,
}

impl RunnerManager {
    pub fn new() -> Self {
        Self {
            runners: HashMap::new(),
        }
    }
    // If the script runner is not exist, it should be created.
    pub fn get_or_init_runner(&mut self, script_type: &ScriptType) -> anyhow::Result<&dyn Runner> {
        if !self.runners.contains_key(script_type) {
            let runner = match script_type {
                ScriptType::JavaScript => Box::new(js::JSRunner::try_new()?) as Box<dyn Runner>,

View on GitHub (pinned to f7dbce2997)

Solutions

  1. Do not use honey-script enhancement with this script type; use the standard script mode
  2. Implement process_honey for the runner's engine
  3. Switch the script type to one whose runner supports honey execution
Defensive patterns

Strategy: validation

Validate before calling

if matches!(script_type, ScriptType::HoneyOnly) {
  return Err(anyhow::anyhow!("honey scripts unsupported for this runner"));
}

Try / catch

// process_honey panics rather than returning Result; guard at call site
if runner.supports_honey() {
  runner.process_honey(mapping, script).await
} else {
  ProcessOutput::default()
}

Prevention

When it happens

Trigger: Enhance pipeline requests honey-style script processing on a runner that only implemented process() and inherited the default process_honey.

Common situations: Using a script (JS honey) enhancement with a script type/engine whose runner lacks an embedded exec-capable engine.

Related errors


AI-assisted analysis of libnyanpasu/clash-nyanpasu@f7dbce2997 (2026-09-08). Data as JSON: /api/errors/85b1da4ec5206cec. Report an issue: GitHub.