chenhg5/cc-connect · error
cloud_web: no reply context for session %q
Error message
cloud_web: no reply context for session %q
What it means
RefreshCard needs a stored reply context (chat_id/message_id pairs captured when the session last replied) to know which card to update. If lookupReplyCtx finds nothing for the given sessionKey, the card cannot be refreshed and this error is returned. Cards can only be refreshed for sessions that previously produced a message.
Source
Thrown at platform/cloud-web/cloudweb.go:523
if !p.hasCap(capCard) {
return p.Reply(ctx, rc, card.RenderText())
}
return p.sendWire(ctx, map[string]any{
"type": "card",
"session_key": rc.SessionKey,
"reply_ctx": rc.ReplyCtx,
"card": serializeCard(card),
})
}
func (p *Platform) ReplyCard(ctx context.Context, replyCtx any, card *core.Card) error {
return p.SendCard(ctx, replyCtx, card)
}
func (p *Platform) RefreshCard(ctx context.Context, sessionKey string, card *core.Card) error {
replyCtx, ok := p.lookupReplyCtx(sessionKey)
if !ok {
return fmt.Errorf("cloud_web: no reply context for session %q", sessionKey)
}
if !p.hasCap(capCard) {
return p.Reply(ctx, replyContext{SessionKey: sessionKey, ReplyCtx: replyCtx}, card.RenderText())
}
return p.sendWire(ctx, map[string]any{
"type": "card",
"session_key": sessionKey,
"reply_ctx": replyCtx,
"card": serializeCard(card),
})
}
func (p *Platform) UpdateMessage(ctx context.Context, replyCtx any, content string) error {
rc, err := parseReplyCtx(replyCtx)
if err != nil {
return err
}
if !p.hasCap(capUpdateMessage) {View on GitHub (pinned to 4000b2338a)
Solutions
- Only call RefreshCard after the session has sent at least one message that captured a reply context (e.g. after the first reply)
- Fall back to p.Send / SendCard for sessions without a stored context instead of refreshing
- Handle the error by logging and sending a normal message card rather than an in-place update
- Persist reply contexts if updates must survive restarts, or accept the loss and start a new message
Example fix
// before
if err := p.RefreshCard(ctx, key, card); err != nil { return err }
// after
if err := p.RefreshCard(ctx, key, card); err != nil {
log.Warn("no reply ctx, sending new card", "err", err)
return p.SendCard(ctx, fallbackCtx, card)
} Defensive patterns
Strategy: fallback
Try / catch
if err := p.RefreshCard(ctx, key, card); err != nil {
log.Warn("refresh failed, sending new card", "err", err)
return p.SendCard(ctx, freshCtx, card)
} Prevention
- Only refresh cards after the session has an established reply
- Fall back to sending a new message when refresh fails
- Consider persisting reply contexts across restarts if streaming updates must resume
When it happens
Trigger: Calling p.RefreshCard(ctx, sessionKey, card) with a sessionKey that has never replied through this platform instance, or whose reply context was evicted/lost after restart.
Common situations: Streaming card updates started before the first assistant message established a reply context; process restart wiping the in-memory reply-context map while the engine still holds the old sessionKey; a session key typo or mismatched key format between agent and platform.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- cloud_web: no stored reply context for session %q
- invalid remote image URL
- acp: session/new: %w
- acp: session/new: empty sessionId
- acp: no agent session id
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/b99036c04328ef91.
Report an issue: GitHub.