Releases: casterkay/RAGStack-Lambda
Releases · casterkay/RAGStack-Lambda
Release list
v2.5.0
[2.5.0] - 2026-03-20
Breaking Changes
- Chat API is now async (mutation + polling):
queryKnowledgeBasemoved fromQuerytoMutation. Returns immediately withPENDINGstatus. Clients must pollgetConversationfor results. The old synchronous query no longer exists. All consumers must redeploy their backend stack. - conversationId and requestId must be UUID v4: The backend validates both IDs. Non-UUID conversation IDs stored in localStorage from previous versions are automatically regenerated by the web component. Custom
conversationIdprops that aren't valid UUIDs are silently replaced (with a console warning). - ChatResponse type removed from schema: Replaced by
ChatRequest(mutation response) andConversationTurn(withinConversationtype).
Added
- Async chat pattern:
queryKnowledgeBasemutation writes a PENDING record to DynamoDB, async-invokesQueryKBFunction, and returns immediately. Bypasses AppSync's 30-second resolver timeout for Bedrock Converse API calls that take 30-50s. getConversationquery: Returns all turns for a conversation from DynamoDB. Used by the client for polling and will support future conversation listing/search.- New schema types:
ChatRequest,ChatStatus,ConversationTurn,Conversation. - Polling with step backoff: Client polls at 1s initial interval, 1.5x growth, 5s cap. Progressive timeout UX: 30s "taking longer than usual" indicator, 90s hard timeout.
- AbortController support: Polling cancels on component unmount or new message send. In-flight fetch requests are aborted via
AbortSignal. - User-scoped conversations:
userIdpersisted on conversation turns.getConversationdenies access when the turn'suserIddoesn't match the requester (or requester is unauthenticated). - Conversation ID validation: Web component validates localStorage and prop values, auto-regenerates invalid (non-UUID) IDs with console warning.
Fixed
- Race condition in turn number assignment: Concurrent requests could assign the same
turnNumber. Now uses conditionalput_itemwithattribute_not_exists(turnNumber)and retry on conflict. - PENDING turns contaminate LLM context:
get_conversation_historynow filters out PENDING turns so in-progress requests don't inject empty assistant responses into the Bedrock Converse context. - Orphaned PENDING records: If async Lambda invoke fails after writing the PENDING record, the record is cleaned up via
delete_item. - Polling swallowed HTTP errors: Non-OK poll responses now track consecutive failures; 4xx errors surface immediately; 5 consecutive failures trigger an error.
- CONVERSATION_TABLE_NAME not guarded: Both resolvers now raise a clear error if the env var is missing.
- DynamoDB type safety:
turnNumber,status,sourcesvalues normalized from DynamoDB attribute unions to concrete Python types. Passes mypy strict mode. - Chat prompts logged to CloudWatch:
queryKnowledgeBasearguments now redact thequeryfield in resolver logs. - Stale callback refs:
onSendMessageandonResponseReceivedcallbacks useuseRefpattern to avoid stale closures. except (ClientError, Exception)simplified: Redundant catch clause replaced withexcept ClientError.
Changed
getConversationadded to access_requirements: Public access gate now enforced before reading conversations.store_conversation_turnincludes status and userId: Sync code path now writesstatus: "COMPLETED"anduserIdfor consistency with async path.getConversationpaginates DynamoDB results: IteratesLastEvaluatedKeyto handle conversations exceeding the 1 MB page limit.- CSS design token: Slow response indicator uses
var(--chat-spacing-xs)instead of hardcoded4px. - Removed unused
isSlowResponsefromChatMessagetype: Only used as component state andMessageListPropsprop.
Docs
- API reference updated: Documents async mutation + polling pattern with GraphQL and curl examples.
- ragstack-chat docs updated:
conversationIdprop documented as UUID (auto-generated if omitted or invalid). Non-UUID examples removed.