sigoden/aichat · error
Unable to continue the response
Error message
Unable to continue the response
What it means
The `.continue` REPL command resumes the previous response; it requires the last message to be 'continuous' (a response that hit a continuation boundary) and non-empty. If no such last message exists, it bails with 'Unable to continue the response'.
Solutions
- Only use .continue immediately after a long response that was cut off mid-output
- Send a message that produces a truncated response first, then .continue
- Check with .last or session state that a continuous last message exists
Example fix
// before: unconditional .continue .continue // after: only continue when the previous reply was truncated // (observe '...continuing' indicator or response length before issuing .continue)
Defensive patterns
Strategy: try-catch
Validate before calling
// only .continue right after a truncated reply
let should_continue = session.last_message.as_ref()
.map(|m| m.continuous && !m.output.is_empty())
.unwrap_or(false);
if should_continue { repl(".continue")?; } Type guard
fn can_continue(last: Option<&LastMessage>) -> bool {
last.map(|m| m.continuous && !m.output.is_empty()).unwrap_or(false)
} Try / catch
match repl(".continue") {
Err(e) if e.to_string() == "Unable to continue the response" => {
eprintln!("No truncated response to continue; ask a new question");
}
other => other?,
} Prevention
- Issue .continue only immediately after a truncated response
- Do not empty/switch sessions between the truncated reply and .continue
- Remember .continue does not apply to completed short replies
When it happens
Trigger: Running `.continue` when the session has no last message, when the last message was not truncated/continuous, when its output is empty, or right after a completed short response.
Common situations: Typing .continue as the first command in a fresh session; using .continue after a response that finished normally; using it after .regenerate cleared the last continuous message; after switching sessions.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- Already in a session, please run '.exit session' first to…
- No session
- Unable to regenerate the response
- Cannot perform this operation because the session has…
- No chat response to copy
AI-assisted analysis of sigoden/aichat@82976d349a (2026-09-09).
Data as JSON: /api/errors/43b8e2a61385c368.
Report an issue: GitHub.
Appendix: source
Thrown at src/repl/mod.rs:628
.file https://example.com/file.txt -- summarize
.file https://example.com/image.png -- recognize text
.file `git diff` -- Generate git commit message
.file jina:https://example.com
.file %% -- translate last reply to english"#
),
},
".continue" => {
let LastMessage {
mut input, output, ..
} = match config
.read()
.last_message
.as_ref()
.filter(|v| v.continuous && !v.output.is_empty())
.cloned()
{
Some(v) => v,
None => bail!("Unable to continue the response"),
};
input.set_continue_output(&output);
ask(config, abort_signal.clone(), input, true).await?;
}
".regenerate" => {
let LastMessage { mut input, .. } = match config
.read()
.last_message
.as_ref()
.filter(|v| v.continuous)
.cloned()
{
Some(v) => v,
None => bail!("Unable to regenerate the response"),
};
input.set_regenerate();
ask(config, abort_signal.clone(), input, true).await?;
}View on GitHub (pinned to 82976d349a)