chenhg5/cc-connect · error
%s
Error message
%s
What it means
summarizeIFlowError extracts a human-readable failure reason from iflow CLI output: it skips JSON-looking lines, truncates to 300 runes, and wraps the first plain-text error line in an error via fmt.Errorf("%s", line). The message is therefore raw CLI output, not a fixed string.
Source
Thrown at agent/iflow/session.go:866
}
func summarizeIFlowError(stderrText string, waitErr error) error {
if stderrText != "" {
for _, line := range strings.Split(stderrText, "\n") {
line = strings.TrimSpace(line)
if line == "" {
continue
}
if strings.HasPrefix(line, "<Execution Info>") || strings.HasPrefix(line, "</Execution Info>") {
continue
}
if strings.HasPrefix(line, "{") || strings.HasPrefix(line, "}") || strings.HasPrefix(line, "\"") {
continue
}
if utf8.RuneCountInString(line) > 300 {
line = string([]rune(line)[:300]) + "..."
}
return fmt.Errorf("%s", line)
}
}
if waitErr != nil {
return fmt.Errorf("iflow process failed: %w", waitErr)
}
return fmt.Errorf("iflow API request failed")
}
func (s *iflowSession) RespondPermission(_ string, _ core.PermissionResult) error {
return nil
}
func (s *iflowSession) Events() <-chan core.Event {
return s.events
}
func (s *iflowSession) CurrentSessionID() string {
v, _ := s.sessionID.Load().(string)View on GitHub (pinned to 4000b2338a)
Solutions
- Read the wrapped line in the error message — it is the actual CLI diagnosis — and fix that condition
- Re-authenticate or refresh iflow credentials if the line mentions auth/token
- Check quota/billing if the line mentions rate or quota
- Validate the requested model name against `iflow --help` / supported models
Defensive patterns
Strategy: try-catch
Try / catch
if err := session.Send(ctx, msg, nil); err != nil {
msgText := err.Error() // the raw CLI line
if strings.Contains(msgText, "auth") || strings.Contains(msgText, "token") {
reauthenticateIFlow()
} else if strings.Contains(msgText, "quota") {
backoffAndRetry(msg)
}
} Prevention
- Keep iflow credentials fresh; re-auth on auth-related lines
- Monitor quota/rate limits and back off before hitting them
- Validate model names against the installed CLI version
When it happens
Trigger: readLoop calls summarizeIFlowError after the iflow process fails, and the CLI's stderr/stdout contained a plain-text (non-JSON) error line, e.g. quota exhausted, invalid API key, or model not available.
Common situations: Expired/invalid iflow credentials; upstream API quota or rate limit; requesting a model name the CLI doesn't support; network failure reported as a text line by the CLI.
Related errors
- iflow process failed: %w
- iflow API request failed
- claudeSession: start: %w
- copilot: %q CLI not found in PATH, please install it first
- session is closed
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/fd05145c928ecb46.
Report an issue: GitHub.