[BUG] /deep-research fails with misleading parse error when feature flag is absent — should surface a clear availability message
Summary
/deep-research (and Workflow({name: "deep-research"})) fails 100% of the time in the CLI with a misleading parse error. The GrowthBook feature flag tengu_sorrel_avocet — observable in ~/.claude.json under cachedGrowthBookFeatures — appears to gate the deep-research bundled workflow. This flag is not present in our account's cached features, even after a confirmed successful cache refresh. General workflows and custom workflow scripts work perfectly.
The core bug is the error message: when a bundled workflow is unavailable due to a missing feature flag, the user sees a confusing parse error instead of a clear availability message.
Environment
- Claude Code: 2.1.220 (native install, macOS, Apple Silicon)
- Plan: Max
tengu_workflows_enabled: true (general workflows work)tengu_sorrel_avocet: not present incachedGrowthBookFeatures
Steps to reproduce
- Open a CLI session (standalone, not desktop Code tab).
- Invoke
/deep-research "any question"— or have the model callWorkflow({name: "deep-research", args: "any question"}). - Observe the error:
````
Error: Invalid workflow script: 'export const meta = { name, description, phases }'
must be the FIRST statement in the script
- Run any custom
Workflow({script: "export const meta = {...}; ..."})— it succeeds, confirming the workflow engine itself is fine.
Analysis
Behavioral testing suggests that named-workflow resolution for deep-research is keyed to the tengu_sorrel_avocet feature flag:
- Inspecting
~/.claude.jsonshowstengu_workflows_enabled: truebuttengu_sorrel_avocetis absent - Temporarily removing
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1and launching a fresh subprocess caused the flag cache to refresh (observed flag count: 278 → 442), buttengu_sorrel_avocetremained absent — indicating the flag is not assigned server-side to this account - Without the flag, the workflow script is apparently never registered, so the name lookup passes an empty/invalid payload to the parser, producing the misleading
export const metaerror - Reproduced consistently: 0/8 attempts succeeded across 4 separate sessions on v2.1.220
Impact
/deep-researchis completely unusable on this account- Zero tokens are consumed per attempt (fails at the parse phase before any agents launch)
- The error message is actively misleading — it blames script syntax when the actual cause is the workflow not being registered. Users waste significant debugging time chasing a non-existent syntax problem.
- Workaround: hand-writing an equivalent workflow script works, confirming the issue is isolated to name-based resolution
Related issues
- #65206 — Same symptom pattern (deep-research unavailable despite workflows being enabled) on desktop Code tab; this report covers the CLI
- #63540 — Same category of misleading error framing: workflow parse errors unconditionally blame "TypeScript syntax" regardless of actual cause
Suggested improvements
- Error message (the actionable bug): When a named workflow's gate flag is absent, surface a clear message — e.g., "Workflow 'deep-research' is not available for your account" — instead of the misleading parse error. This aligns with the concern raised in #63540 about misleading error attribution.
- Availability question: Is the
tengu_sorrel_avocetgating intentional for certain accounts/plans, or is this an unintended gap in the rollout? If intentional, documenting the eligibility criteria would save users from debugging a non-bug.