Skip to content

Initialize session state namespaces for reliable CEL evaluation#592

Merged
hardbyte merged 1 commit intomainfrom
feat/jokes-spelling-stale-collection
Feb 24, 2026
Merged

Initialize session state namespaces for reliable CEL evaluation#592
hardbyte merged 1 commit intomainfrom
feat/jokes-spelling-stale-collection

Conversation

@hardbyte
Copy link
Owner

Summary

  • Ensure context, temp, user, and system scopes always exist as empty dicts when creating a new conversation session
  • Fixes CEL expressions like has(context.experiments) throwing errors instead of returning false when no initial_state is provided (e.g. admin-ui preview without school context)
  • Merges initial_state values into the defaults rather than replacing them, preserving any caller-provided context

Test plan

  • All 443 unit tests pass
  • E2E tested admin-ui chatflow preview without school context — jokes and spelling sub-flows now work correctly
  • E2E tested with school context (huey-books-app) — no regression

Ensures context, temp, user, and system scopes always exist as
empty dicts so CEL expressions like has(context.experiments) evaluate
to false instead of throwing when no initial_state is provided.
Fixes chatflow preview working without school context.
@hardbyte hardbyte merged commit eabbc83 into main Feb 24, 2026
18 checks passed
@hardbyte hardbyte deleted the feat/jokes-spelling-stale-collection branch February 24, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant