{"record":{"id":"43b8e2a61385c368","repo":"sigoden/aichat","slug":"unable-to-continue-the-response","errorCode":null,"errorMessage":"Unable to continue the response","messagePattern":"Unable to continue the response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/repl/mod.rs","lineNumber":628,"sourceCode":".file https://example.com/file.txt -- summarize\n.file https://example.com/image.png -- recognize text\n.file `git diff` -- Generate git commit message\n.file jina:https://example.com\n.file %% -- translate last reply to english\"#\n                ),\n            },\n            \".continue\" => {\n                let LastMessage {\n                    mut input, output, ..\n                } = match config\n                    .read()\n                    .last_message\n                    .as_ref()\n                    .filter(|v| v.continuous && !v.output.is_empty())\n                    .cloned()\n                {\n                    Some(v) => v,\n                    None => bail!(\"Unable to continue the response\"),\n                };\n                input.set_continue_output(&output);\n                ask(config, abort_signal.clone(), input, true).await?;\n            }\n            \".regenerate\" => {\n                let LastMessage { mut input, .. } = match config\n                    .read()\n                    .last_message\n                    .as_ref()\n                    .filter(|v| v.continuous)\n                    .cloned()\n                {\n                    Some(v) => v,\n                    None => bail!(\"Unable to regenerate the response\"),\n                };\n                input.set_regenerate();\n                ask(config, abort_signal.clone(), input, true).await?;\n            }","sourceCodeStart":610,"sourceCodeEnd":646,"githubUrl":"https://github.com/sigoden/aichat/blob/82976d349ad97ac9aae0655ad631dace5e2a6385/src/repl/mod.rs#L610-L646","documentation":"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'.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before: unconditional .continue\n.continue\n// after: only continue when the previous reply was truncated\n// (observe '...continuing' indicator or response length before issuing .continue)","handlingStrategy":"try-catch","validationCode":"// only .continue right after a truncated reply\nlet should_continue = session.last_message.as_ref()\n    .map(|m| m.continuous && !m.output.is_empty())\n    .unwrap_or(false);\nif should_continue { repl(\".continue\")?; }","typeGuard":"fn can_continue(last: Option<&LastMessage>) -> bool {\n    last.map(|m| m.continuous && !m.output.is_empty()).unwrap_or(false)\n}","tryCatchPattern":"match repl(\".continue\") {\n    Err(e) if e.to_string() == \"Unable to continue the response\" => {\n        eprintln!(\"No truncated response to continue; ask a new question\");\n    }\n    other => other?,\n}","preventionTips":["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"],"tags":["repl","session","state"],"backgroundTag":"invalid-state-transition","analyzedSha":"82976d349ad97ac9aae0655ad631dace5e2a6385","analyzedAt":"2026-09-09T18:33:06.139Z","contentChangedAt":"2026-09-09T18:33:06.139Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}