chenhg5/cc-connect · error
session id is required
Error message
session id is required
What it means
A sentinel guard at the top of iflow Agent.DeleteSession: the provided session ID is an empty string. Deletion needs a concrete ID to locate the session file, so the request is rejected before any filesystem access.
Source
Thrown at agent/iflow/iflow.go:177
if m := a.providers[a.activeIdx].Model; m != "" {
model = m
}
}
a.mu.Unlock()
return newIFlowSession(ctx, cmd, extraArgs, workDir, model, mode, sessionID, extraEnv, toolTimeoutSec)
}
func (a *Agent) ListSessions(_ context.Context) ([]core.AgentSessionInfo, error) {
a.mu.RLock()
workDir := a.workDir
a.mu.RUnlock()
return listIFlowSessions(workDir)
}
func (a *Agent) DeleteSession(_ context.Context, sessionID string) error {
if sessionID == "" {
return fmt.Errorf("session id is required")
}
homeDir, err := os.UserHomeDir()
if err != nil {
return fmt.Errorf("iflow: cannot determine home dir: %w", err)
}
a.mu.RLock()
workDir := a.workDir
a.mu.RUnlock()
absDir := iflowResolvedWorkDir(workDir)
candidates := []string{
filepath.Join(homeDir, ".iflow", "projects", iflowProjectKey(absDir), sessionID+".jsonl"),
}
for _, p := range candidates {
if _, err := os.Stat(p); err == nil {
return os.Remove(p)View on GitHub (pinned to 4000b2338a)
Solutions
- Provide a session ID from /sessions
- Check that the command parsing passed the ID through correctly
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at agent/iflow/iflow.go:177 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/e9297e1b98eda952.
Report an issue: GitHub.