aaif-goose/goose · error

Editor helper not set

Error message

Editor helper not set

What it means

The rustyline Editor only yields a helper (and thus the tab-completion cache) when one was installed via set_helper(). input.rs reads editor.helper() to obtain the completion cache before the inline prompt loop; if no helper was installed it errors with 'Editor helper not set'. In shipped goose the helper is set unconditionally (session/mod.rs), so this is an internal invariant failure, not a user misconfiguration.

Source

Thrown at crates/goose-cli/src/session/input.rs:153

            if !editor_cmd.is_empty() {
                let messages = extract_recent_messages(conversation_messages);
                let message_refs: Vec<&str> = messages.iter().map(|s| s.as_str()).collect();
                let (message, has_meaningful_content) =
                    crate::session::editor::get_editor_input(&editor_cmd, &message_refs, None)?;

                if has_meaningful_content {
                    editor.add_history_entry(message.as_str())?;
                    return Ok(InputResult::Message(message));
                }
                // Empty editor content — fall through to inline prompt
            }
        }
    }

    let completion_cache = editor
        .helper()
        .map(|h| h.completion_cache.clone())
        .ok_or_else(|| anyhow::anyhow!("Editor helper not set"))?;

    let paste_state = Arc::new(std::sync::RwLock::new(PasteState::default()));

    editor.bind_sequence(
        rustyline::Event::Any,
        rustyline::EventHandler::Conditional(Box::new(PasteCaptureHandler::new(
            paste_state.clone(),
        ))),
    );

    editor.bind_sequence(
        rustyline::KeyEvent(rustyline::KeyCode::Enter, rustyline::Modifiers::NONE),
        rustyline::EventHandler::Conditional(Box::new(PasteAwareEnterHandler::new(
            paste_state.clone(),
        ))),
    );

    editor.bind_sequence(

View on GitHub (pinned to 3810898a74)

Solutions

  1. Ensure set_helper is called before the interactive loop: editor.set_helper(Some(completer))
  2. Update to a released goose version where the helper is installed unconditionally

Example fix

// before
let mut editor = Editor::<CustomHelper, DefaultHistory>::new()?;
// helper never set
// after
let mut editor = Editor::<CustomHelper, DefaultHistory>::new()?;
editor.set_helper(Some(completer));
Defensive patterns

Strategy: type-guard

Type guard

fn has_helper<H: Helper, I: History>(ed: &Editor<H, I>) -> bool {
    ed.helper().is_some()
}

Try / catch

let completion_cache = match editor.helper() {
    Some(h) => h.completion_cache.clone(),
    None => {
        tracing::warn!("editor helper missing; continuing without completion cache");
        default_cache()
    }
};

Prevention

When it happens

Trigger: Reaching the inline-prompt branch of input.rs with a rustyline Editor constructed without set_helper — only possible in custom builds or refactors that skip helper installation.

Common situations: Custom forks or in-progress PRs restructuring session input; essentially unseen in released binaries.

Related errors


AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16). Data as JSON: /api/errors/65800455a970b30b. Report an issue: GitHub.