Repository navigation
fix(workflow): resolve stale greeting and race condition in startup prompt - #846
jeremyeder wants to merge 2 commits into
Conversation
…de startup prompt Clear workflowGreeting state unconditionally when activating a workflow, preventing stale greetings from persisting when switching to a workflow without a startupPrompt. Also gate queued workflow activation on ootbWorkflows being loaded and add it to the useEffect dependency array, preventing a race condition where the greeting could silently be dropped. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests that precisely validate the Critical fix from the PR #780 review: 1. Switching from a workflow WITH startupPrompt to one WITHOUT must clear workflowGreeting to null (not leave stale greeting displayed). 2. Empty-string startupPrompt must also clear the greeting. 3. Failed activation must not set any greeting. All 3 tests FAIL on the pre-patch code (conditional setWorkflowGreeting) and PASS on the fix (unconditional setWorkflowGreeting). Adds vitest + @testing-library/react as devDependencies and a minimal vitest.config.ts, matching the test infrastructure from PR #834. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude Code ReviewSummaryPR #846 delivers two targeted bug fixes to the workflow management system: (1) a stale greeting that persisted when switching from a workflow with a Issues by SeverityBlocker IssuesNone Critical IssuesNone Major Issues1.
Minor Issues1.
2. Redundant
3.
Positive Highlights
Recommendations
🤖 Reviewed by Claude Code using the Amber review system 🔍 View AI decision process (logs available for 90 days) 📋 View memory system files loaded (click to expand)What Amber Loaded for Code ReviewAmber automatically loaded these repository standards from the memory system:
Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines. |
|
Closing as stale/superseded. Reopen if still needed. |
Summary
Addresses Critical and Major review feedback from code review of #780:
Critical — Stale greeting persists when switching workflows:
setWorkflowGreetingwas only called whenstartupPromptwas truthy, so switching from a workflow with a greeting to one without left the old greeting displayed. Now clears unconditionally withsetWorkflowGreeting(workflow.startupPrompt || null).Major — Race condition drops greeting silently: The
useEffectthat activates queued workflows referencedootbWorkflowsbut didn't include it in the dependency array. If the OOTB workflows API response hadn't resolved when the session reached "Running" phase,fullWorkflowwould beundefinedandstartupPromptsilently lost. Now gates onootbWorkflows.length > 0and includesootbWorkflowsin the dependency array.Test plan
startupPrompt— greeting appears immediatelystartupPrompt— previous greeting is clearedGenerated with Claude Code