Skip to content

fix(healing): escape stray {variable} placeholders that crash every LLM workflow generation - #167

Open
Sangaibisi wants to merge 1 commit into
browser-use:mainfrom
Sangaibisi:fix/healing-prompt-format-crash
Open

fix(healing): escape stray {variable} placeholders that crash every LLM workflow generation#167
Sangaibisi wants to merge 1 commit into
browser-use:mainfrom
Sangaibisi:fix/healing-prompt-format-crash

Conversation

@Sangaibisi

@Sangaibisi Sangaibisi commented Aug 11, 2026

Copy link
Copy Markdown

Bug

workflow_use/healing/prompts/workflow_creation_prompt.md lines 26/29 contain single-braced {variable} while every other placeholder in the file is correctly escaped as {{...}}. The template is rendered with str.format(goal=..., actions=...) (healing/service.py:296), so every call raises KeyError('variable').

Reproduce without any LLM key:

from pathlib import Path
content = Path('workflows/workflow_use/healing/prompts/workflow_creation_prompt.md').read_text()
content.format(goal='g', actions='a')   # KeyError: 'variable'

Impact

create_workflow_definition crashes after the browser agent has fully run — this is the default path of generate_workflow_from_prompt (HealingService(use_deterministic_conversion=False), used by the CLI), so every generation attempt burns a complete agent session + LLM cost and then dies.

Fix

Escape the two stray placeholders to {{variable}}. After rendering, the LLM still sees the intended single-braced {variable} example text.

Note

Found while auditing the replay/generation pipeline (see #165 for the recording-side findings). Happy to split or adjust if you'd like this folded into something larger.

🤖 Generated with Claude Code


Summary by cubic

Escaped two stray {variable} placeholders in workflow_use/healing/prompts/workflow_creation_prompt.md to {{variable}} to stop KeyError from str.format. This fixes workflow generation crashes after the browser agent completes and avoids wasted sessions and cost.

Written for commit cf7d6bf. Summary will update on new commits.

Review in cubic

… LLM generation

workflow_creation_prompt.md lines 26/29 contained single-braced {variable}
while the file is rendered with str.format(goal=..., actions=...) - every
call raised KeyError('variable') AFTER the browser agent had fully run,
so each generation attempt burned a complete agent session + LLM cost and
then died. This is the default path of generate_workflow_from_prompt.

After rendering, the LLM still sees the intended single-braced example.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

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