affaan-m/ECC · error
Session not found: {from_id}
Error message
Session not found: {from_id} What it means
Runtime error from the Start command handler in ecc2/src/main.rs. When --from-session is supplied, the handler resolves the session id (resolve_session_id) and then calls db.get_session(&from_id); if that returns None it bails with "Session not found: {from_id}". The session is used as the source for a new session, so its absence is fatal to the operation.
Source
Thrown at ecc2/src/main.rs:1521
);
}
},
Some(Commands::Dashboard) | None => {
tui::app::run(db, cfg).await?;
}
Some(Commands::Start {
task,
agent,
profile,
worktree,
from_session,
}) => {
let use_worktree = worktree.resolve(&cfg);
let source = if let Some(from_session) = from_session.as_ref() {
let from_id = resolve_session_id(&db, from_session)?;
Some(
db.get_session(&from_id)?
.ok_or_else(|| anyhow::anyhow!("Session not found: {from_id}"))?,
)
} else {
None
};
let grouping = session::SessionGrouping {
project: source.as_ref().map(|session| session.project.clone()),
task_group: source.as_ref().map(|session| session.task_group.clone()),
};
let session_id = if let Some(source) = source.as_ref() {
session::manager::create_session_from_source_with_profile_and_grouping(
&db,
&cfg,
&task,
agent.as_deref().unwrap_or(&cfg.default_agent),
use_worktree,
profile.as_deref(),
&source.id,
grouping,View on GitHub (pinned to 01e15490f0)
Solutions
- List sessions for the current database and copy the exact id.
- Confirm you are operating in the same project/workspace where the session was created.
- If using a prefix, ensure it is unambiguous and resolves to an existing session.
- Recreate the source session if it was deleted but is still needed.
Example fix
# before $ ecc start --from-session abc123 Error: Session not found: abc123 # after $ ecc sessions list SESSION_ID TASK abc12345... fix auth $ ecc start --from-session abc12345
Defensive patterns
Strategy: validation
Validate before calling
// Confirm the session exists before starting from it.
if db.get_session(&from_id)?.is_none() {
eprintln!("session {from_id} not found; known sessions:");
for s in session::manager::list_sessions(&db)? { eprintln!(" {}", s.id); }
return Ok(());
} Type guard
fn session_exists(db: &Db, id: &str) -> bool {
db.get_session(id).map(|o| o.is_some()).unwrap_or(false)
} Try / catch
let source = match db.get_session(&from_id)? {
Some(s) => s,
None => {
eprintln!("tip: run `ecc sessions list` to see valid ids");
anyhow::bail!("Session not found: {from_id}");
}
}; Prevention
- Always list sessions before copying an id by hand.
- Prefer full ids over truncated prefixes.
- Confirm you are in the correct project/workspace database.
- Wrap scripted invocations in a check that the session exists.
When it happens
Trigger: Invoking `start --from-session <id-or-prefix>` where the resolved id does not exist in the session database (db.get_session returns None). A prefix that resolves but then misses also triggers this.
Common situations: Typo or truncation in the session id; the session was deleted; running against the wrong project/workspace database; the id was copied from a different environment; stale entry in a script.
Related errors
- Session not found: {resolved_id}
- No sessions found
- Session not found: {value}
- Missing value for --db
- {label} must be a regular file
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/5fc55bd537f8836a.
Report an issue: GitHub.