Skip to content

feat: add skillopt plugin - #512

Open
Olszalsik wants to merge 1 commit into
agent0ai:mainfrom
Olszalsik:add-skillopt
Open

Olszalsik wants to merge 1 commit into
agent0ai:mainfrom
Olszalsik:add-skillopt

Conversation

@Olszalsik

@Olszalsik Olszalsik commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Plugin: skillopt v1.8.26

Repo: https://github.com/Olszalsik/a0-skillopt (public, MIT)
Version in this PR: 1.8.26

An auto-evolution engine for Agent Zero skill documents, wrapping
microsoft/SkillOpt (MIT, 17.5k stars).
Drafts rewrites from real usage trajectories, gates them, and applies them to
usr/skills/.

Disclosure: v1.8.23 could destroy a live skill

1.8.23 is not safe to enable unattended. In my own install it stripped the
YAML frontmatter from usr/skills/scheduled-tasks/SKILL.md, after which the
framework's validate_skill_md rejected the file and the skill silently
disappeared from the agent. Three defects combined:

  1. A completed gate verdict was read as no verdict. The harvest treated
    every ok=False as "could not run" and adopted. The offending sidecar was
    status: done with reason: insufficient_usable_pairs:1 usable - the
    worker ran to completion and returned a verdict that did not clear the bar.
  2. No stage validated the frontmatter. validate_proposal's nine stages
    check emptiness, headers, length, example block, byte equality and shrink
    ratio. None parse YAML frontmatter.
  3. The auto-adopt paths took no snapshot. Only /adopt snapshotted, so
    this was unrecoverable via /rollback.

Auditing staging/ afterwards, 32 of 32 existing proposals were missing
their frontmatter - the generator was systematically stripping it.

What 1.8.24 through 1.8.26 fixed

  • Gate fails closed on a completed negative verdict; fail-open reserved for a
    missing verdict. A framework skill-schema stage runs first. Snapshot +
    atomic write on every adopt path. The generator root cause (the optimizer
    prompt never mentioned frontmatter), plus a repair net.
  • Unauthenticated subprocess spawn. The hub-status route disabled auth and
    CSRF while being able to spawn a subprocess on a stale payload. POST removed,
    framework defaults inherited.
  • Path traversal via the skill name. 13 sites joined a caller-supplied
    name onto the skills directory, reachable from the adopt/staged/fragments
    endpoints and from LLM-written proposal files. Guarded, and scoped to path
    safety rather than to the framework's naming charset - an earlier attempt
    at the latter rejected legitimate internal names and broke 27 tests.
  • Ungated direct-path adoption. "The official package is absent, so fall
    back" was equivalent to "adopt ungated". New
    allow_ungated_direct_adopt (default false) refuses it and leaves the
    proposal staged for review.
  • Nested config sections were unreachable. A bare budget: header parsed
    to the empty string, so cfg.get("budget", {}).get(...) raised
    AttributeError - and the surrounding except fell through, silently
    disabling the daily budget cap in production.
  • The test suite was writing into the production logs. Found by live
    testing, not by the suite: the repo is bind-mounted into the container, so
    the suite and the running server share one logs/runs/ tree. 140 fixture
    rows landed in auto_loop.log - the log an operator reads to decide whether
    the loop is working - making a real stall indistinguishable from routine
    activity. Now sandboxed per test, and the guard inspects log content.
  • Snapshot pruning kept the wrong versions. fragment_max_history_per_id
    was declared since v1.6.0 and read by nothing, so snapshots grew unbounded.
    The first implementation sorted by file name, so v9 outranked v12 and a
    prune would have discarded the newest history and kept the oldest. Caught by
    the new test on its first run; the sort is now numeric.
  • Cadence bounds were declared but never applied. Both call sites invoked
    compute_next_run(new_n) with no arguments, silently using the defaults.
  • A dead extensions/python/hooks/ tree (not an extension point, and not an
    Extension subclass) deleted; AGENTS.md cut from 54 KB to 11 KB; two
    DOX statements that 1.8.25/26 made false corrected.

Live verification on Agent Zero v2.13

The container was restarted on v2.13 and the plugin verified against it:

  • health check PASSED in-container;
  • auto-loop running: true, 13 cycles completed, last_engine: direct;
  • the ungated-adopt refusal has fired 12 times in the live log;
  • 189/189 tests passing in the container on Linux.

v2.13 did not touch any framework file the plugin depends on
(agent.py, helpers/{skills,extension,api,settings}.py).

Tests

189 cases. On Linux, all pass. On Windows, 186/189: the
v1.8.5 SECURITY: apply ... atomic 0600 test asserts POSIX permission bits
and cannot pass there, and the two v1.8.16 judge-throttle tests are
wall-clock sensitive and flake independently of any change.

Ten new cases, including the two most important being the incident itself: the
schema gate asserted against the actual proposal that caused the damage, and
the full harvest decision matrix. The hub-status contract test was
inverted - it pinned requires_auth() is False, so it had been asserting
the vulnerable behaviour.

Known limitations, stated up front

  • The official skillopt_sleep engine is optional. Without it the plugin
    runs its own loop and the held-out gate is only as good as the local replay,
    which is advisory by default. With the default
    allow_ungated_direct_adopt: false, the safe behaviour is to stage rather
    than adopt. pip install skillopt enables the upstream monotonic gate.
  • 6 config keys are declared but not read, each with a reason in the test:
    official_target_model (no such upstream flag), log_level (a plugin must
    not own root logging), skill_target and sleep_schedule (superseded by
    per-skill governance and the A0 scheduler), and two cycle_history_*
    writer filters.
  • A production log row naming a real skill cannot be attributed to a test
    from the log alone, so the pollution guard reports it as a NOTE rather than
    failing. Its content is truthful. Rows with an unambiguous test signature
    still fail the run.
  • Not yet done: a multi-day unattended live run with the official engine
    installed. Everything above is component-suite plus a real reproduction of
    the incident.

@a0-bot

a0-bot Bot commented Sep 13, 2026

Copy link
Copy Markdown

Plugin submission validation failed

ERROR: PR must modify exactly one plugin folder under plugins/

Olszalsik pushed a commit to Olszalsik/a0-plugins that referenced this pull request Sep 19, 2026
SkillOpt Self-Evolution Engine - hub submission manifest for PR agent0ai#512.

Release line: v1.8.16 (https://github.com/Olszalsik/a0-skillopt).
Current version: 1.8.16 - judge burst protection (in-flight limiter,
reservation pacing, 429/5xx backoff retries with Retry-After).
Version is tracked in the plugin repository root plugin.yaml
(version: 1.8.16 at default branch), per hub schema: this manifest
carries only title/description/github/tags/screenshots.
@a0-bot

a0-bot Bot commented Sep 19, 2026

Copy link
Copy Markdown

Plugin submission validation failed

ERROR: Only files under plugins/ are allowed in plugin PRs: .github/workflows/generate-missing-thumbnails.yml

SkillOpt Self-Evolution Engine - hub submission manifest for PR agent0ai#512.

Release line: v1.8.16 (https://github.com/Olszalsik/a0-skillopt).
Current version: 1.8.16 - judge burst protection (in-flight limiter,
reservation pacing, 429/5xx backoff retries with Retry-After).
Version is tracked in the plugin repository root plugin.yaml
(version: 1.8.16 at default branch), per hub schema: this manifest
carries only title/description/github/tags/screenshots.

Rebased onto agent0ai/a0-plugins main so the PR diff vs base
contains only plugins/skillopt/.
@3clyp50

3clyp50 commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR. We already list SkillOpt Native for skill training and adoption. Is there a workflow your plugin covers that the existing one doesn't?

Alessandro

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.

2 participants