Skip to content

fix(openhands-automation): stop steering agents away from deterministic scripts - #686

Open
enyst wants to merge 1 commit into
mainfrom
fix/automation-skill-preset-balance
Open

enyst wants to merge 1 commit into
mainfrom
fix/automation-skill-preset-balance

Conversation

@enyst

@enyst enyst commented Sep 24, 2026

Copy link
Copy Markdown
Member
  • A human has tested these changes.

Why

The skill's rule 0 tells the agent to prefer a no-LLM custom script for deterministic tasks, but the rest of the text pulls toward the prompt preset: the prompt examples model deterministic tasks, the custom-automation reference opens with a "do not use unless explicitly requested" warning, there is no complete no-LLM example in the body, and custom scripts carry an extra consent step that presets do not. An agent follows the weight of the document, not the rule.

Summary

  • Replace prompt-preset examples that model deterministic tasks (hourly health check, run tests on push, weekly temp-file cleanup) with tasks that need judgment: Sentry error triage, bug-ticket reproduction, weekly dependency review, flagging risky pushes to main.
  • Delete the stop-sign warning at the top of references/custom-automation.md and list deterministic tasks as a first-class reason to use the custom path.
  • Add a complete no-LLM worked example (hourly health check with a Slack alert: script, tarball, upload, create) next to the prompt-preset examples.
  • Collapse rules 2 to 4 into one symmetric rule: present prompt preset, plugin preset, and custom script side by side and build what the user picks. The existing "ready to deploy?" confirmation applies to every path. Matching one-sided sentences in "Choosing the Right Preset" and "Reference Files" are rewritten, and a duplicated references/security.md bullet is removed.
  • Regenerate skills/index.js.

Issue Number

Fixes #685

How to Test

uv sync --group test
uv run python scripts/sync_extensions.py --check
uv run pytest -q tests/test_skills_catalog.py tests/test_catalogs.py tests/test_sync_extensions.py tests/test_skill_plugin_loading.py tests/test_sdk_loading.py

All pass locally (179 tests). The new example script was extracted from the Markdown and run directly: it compiles, exits 0 on a 200 response, and takes the failure path with exit 1 on an unreachable URL.

To check the behavioral change, load the skill into a conversation and ask for "post a reminder to Slack every 5 minutes". The agent should present the custom-script option next to the presets with a cost note, rather than defaulting to the prompt preset or asking for extra permission to write a script.

Video/Screenshots

Not applicable; Markdown and generated catalog changes only.

Notes

Text only; no change to the automation API or to what the presets do. The regenerated skills/index.js diff is the updated content string for this one skill.

🤖 Generated with Claude Code

…ic scripts

The skill's rule 0 tells agents to prefer a no-LLM custom script for
deterministic tasks, but the rest of the text pulled the other way:

- Prompt-preset examples modelled deterministic tasks (hourly health
  check, run tests on push, weekly temp-file cleanup). Replace them with
  tasks that need judgment: error triage, bug reproduction, dependency
  review, flagging risky pushes.
- references/custom-automation.md opened with "Do NOT use this reference
  unless the user has explicitly requested a custom automation", which
  contradicted rule 0 and the Reference Files section. Remove it and list
  deterministic tasks as a first-class reason to use the custom path.
- Add a complete no-LLM worked example (hourly health check with Slack
  alert) next to the prompt-preset examples, so both paths are equally
  concrete.
- Make consent symmetric: present the options side by side and build the
  one the user picks. The "ready to deploy?" confirmation applies to
  every path; custom scripts no longer need an extra permission step.

Also drops a duplicated references/security.md bullet and regenerates
the skills catalog.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@all-hands-bot all-hands-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.

This review was posted by an AI agent (OpenHands).

Summary

The change does what the linked issue (#685, ready-for-dev, priority:low) asks for: the deterministic prompt examples are replaced with agent-shaped ones (Sentry triage, bug reproduction, dependency review, risky-push review), the stop-sign warning at the top of references/custom-automation.md is gone and deterministic tasks are now a first-class reason to use the custom path, a complete no-LLM worked example is added, and rules 2-4 are collapsed into one symmetric rule. I verified in the workspace that skills/index.js is regenerated (node scripts/build-skills-catalog.mjs produces no further diff), uv run python scripts/sync_extensions.py --check passes, and the focused suite is green (179 passed). All check runs on the head are green. Scope is correct for this repository: it is a skill-content change only, with no API or preset behavior change.

Two non-blocking but real defects remain, both caused by incomplete follow-through on this same edit.

1. Dangling rule cross-reference after the renumbering (inline)

Collapsing rules 2-4 shifts the webhook-reachability rule from 5 to 4, but the in-body pointer near Polling as a Webhook Alternative still reads (see rule 5). There is no rule 5 any more, so an agent following that pointer lands nowhere. Anchored inline at the renumbered rule.

2. README.md was not updated, contrary to the issue's acceptance criteria and the repo convention

skills/openhands-automation/README.md is untouched by this PR (git diff HEAD~1 HEAD -- .../README.md is empty). It still frames the prompt preset as (recommended) in the Features list and describes custom automations as being For advanced users who need full control - exactly the imbalance this PR removes from SKILL.md. The issue's triage acceptance criteria explicitly require the README to stop presenting the prompt preset as the recommended default, and AGENTS.md states: "If you change a skill's behavior or scope, update its README.md (if present) accordingly." The README also still calls /preset/prompt "(recommended)" in prose while SKILL.md moved to an even-handed framing, so the two artifacts now disagree. This is the one acceptance criterion the PR does not meet; adding a short README edit closes it.

Everything else I checked holds up: the new example script compiles, the references/custom-automation.md "when to use" list names deterministic tasks first, the duplicated references/security.md bullet is removed, and no remaining preset example matches a rule 0 instant-recognition pattern (the residual "Generate a weekly status report" / "Daily Report" string is generic enough to be judgment-based and is pre-existing).

🔄 CHANGES REQUESTED

>
> Do not silently fall back to either side. The "ready to deploy?" confirmation in the creation process applies to every path equally; a custom script needs no extra permission beyond it, and a preset gets no pass on it.
> 3. **Building a custom script:** follow `references/custom-automation.md` for tarball packaging, validation, and upload. The *Custom Script Example (No LLM)* below shows the whole flow end to end.
> 4. **Before suggesting event-triggered (webhook) automations, check whether the deployment is publicly reachable.** Check `RUNTIME_URL`. Webhooks require an internet-accessible URL so that external services (GitHub, Slack, Linear, etc.) can deliver events to the automation service. If `RUNTIME_URL` is unset, empty, or resolves to a local or private address (`localhost`, `127.0.0.1`, `0.0.0.0`, or any RFC 1918 range: `10.x.x.x`, `192.168.x.x`, `172.16–31.x.x`), the service cannot receive inbound webhook traffic from the public internet. In that case:

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.

This rule was renumbered from 5 to 4 by this PR, but the cross-reference near Polling as a Webhook Alternative further down still says (see rule 5). Rule 5 no longer exists, so the pointer is dangling. Update that sentence to (see rule 4).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openhands-automation skill steers agents toward prompt presets even for deterministic tasks

2 participants