showcase/integrations/claude-sdk-python/qa/shared-state-read-write.md
/demos/shared-state-read-write on the dashboard host/api/health); ANTHROPIC_API_KEY is set on Railway; the FastAPI backend exposes POST /shared-state-read-write/demos/shared-state-read-write; verify the page renders within 3s with the left sidebar (preferences + notes cards) and the right-side CopilotChat panedata-testid="preferences-card" is visible with heading "Your preferences"data-testid="notes-card" is visible with heading "Agent notes" and empty-state data-testid="notes-empty" reading "No notes yet. Ask the agent to remember something."agent.setState)data-testid="pref-name"; verify data-testid="pref-state-json" updates to include "name": "Atai"data-testid="pref-tone" to formal; verify the JSON preview reflects "tone": "formal"data-testid="pref-language" to Spanish; verify the JSON preview reflects "language": "Spanish"Cooking and Travel interest pills; verify both show the selected style (border #BEC2FF, bg #BEC2FF1A) and the JSON preview's interests array contains both entriesbuild_preferences_block injects these into the system prompt each turn)set_notes tool)data-testid="notes-list" appears in the notes card and contains at least 2 data-testid="note-item" entries mentioning "morning meetings" and "dairy"data-testid="notes-empty" is no longer renderedset_notes contractdata-testid="notes-clear-button" is visibledata-testid="notes-empty" re-rendersagent.setState({ notes: [] }))playful and add the Music interest; send "Write me a one-line haiku greeting."; verify the reply is playful and references musictone: casual, language: English, empty interests, empty name) and notes reset to empty (state is per-session)pref-state-json synchronously on changenotes-card within 20 seconds of a "remember" prompt, and the full prior list is preserved on subsequent set_notes calls