Skip to content

Docs self-healing workflow improvements: Split into Haiku Router + Sonnet Drafter#3064

Merged
pwizla merged 3 commits intomainfrom
repo/self-healing-optimized-2step-haiku-sonnet
Apr 16, 2026
Merged

Docs self-healing workflow improvements: Split into Haiku Router + Sonnet Drafter#3064
pwizla merged 3 commits intomainfrom
repo/self-healing-optimized-2step-haiku-sonnet

Conversation

@pwizla
Copy link
Copy Markdown
Collaborator

@pwizla pwizla commented Apr 16, 2026

Summary

  • 2-step architecture: Haiku runs the Router ($0.02/run), Sonnet only invoked if targets found ($0.50-0.70/run)
  • When Router finds nothing: $0.02 instead of $0.21 (~10x cheaper for "nothing to do" nights)
  • Router writes /tmp/router-results.json, bash bridge checks results, Sonnet reads them via $ROUTER_RESULTS
  • Detailed summary: pre-filtering results + Router decisions + Drafter results (3-state)
  • Old single prompt replaced by docs-self-healing-router.md + docs-self-healing-drafter.md

Cost comparison

Scenario Before (Sonnet only) After (Haiku + Sonnet)
No targets found ~$0.21 ~$0.02
1 PR with targets ~$0.50-0.70 ~$0.52-0.72
All PRs pre-filtered (bash) $0.00 $0.00

Test plan

  • workflow_dispatch with no qualifying PRs → verify Haiku runs, Sonnet does NOT run, summary shows "Router found no targets"
  • workflow_dispatch with a qualifying PR → verify Haiku finds targets, Sonnet drafts content, PR created
  • Check /tmp/router-results.json format matches schema
  • Verify Haiku tools are restricted (no Write/Edit)

🤖 Generated with Claude Code

Haiku runs the Router for ~$0.02/run. If no targets are found,
Sonnet is never invoked — saving ~$0.20 per "nothing to do" run.

When targets exist, Sonnet handles the full Drafter pipeline.

- New: docs-self-healing-router.md (Haiku prompt)
- New: docs-self-healing-drafter.md (Sonnet prompt)
- Deleted: docs-self-healing.md (replaced by the two above)
- Workflow: two claude-code-action steps with bash bridge
- Summary: 3-state (no PRs / Router skip / Drafter results)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview, Comment Apr 16, 2026 8:30pm

Request Review

@github-actions github-actions Bot added internal PRs created by the Strapi core team pr: new content PRs for new product features or new documentation sections source: repo PRs/issues not targeting a specific documentation but rather affecting the whole repo labels Apr 16, 2026
Router now outputs a complexity field (micro/full). Micro-edits
(add_link, add_mention, add_tip) are executed by Haiku directly
including branch creation and PR. Sonnet is only invoked for
full-complexity targets (create_page, update_section, add_section).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pwizla pwizla self-assigned this Apr 16, 2026
@pwizla pwizla added pr: chore and removed pr: new content PRs for new product features or new documentation sections labels Apr 16, 2026
@pwizla pwizla added this to the 6.22.0 milestone Apr 16, 2026
Haiku routing is cheap enough to handle 5 PRs safely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pwizla pwizla marked this pull request as ready for review April 16, 2026 20:29
@pwizla pwizla requested a review from derrickmehaffy as a code owner April 16, 2026 20:29
@pwizla pwizla merged commit f765cce into main Apr 16, 2026
3 of 4 checks passed
@pwizla pwizla deleted the repo/self-healing-optimized-2step-haiku-sonnet branch April 16, 2026 20:29
@pwizla pwizla removed the request for review from derrickmehaffy April 17, 2026 13:42
@pwizla pwizla changed the title Split self-healing into Haiku Router + Sonnet Drafter Docs self-healing workflow improvements: Split into Haiku Router + Sonnet Drafter Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal PRs created by the Strapi core team pr: chore source: repo PRs/issues not targeting a specific documentation but rather affecting the whole repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant