Skip to content

verify-agent-server: a known bug reproduces only with its documented failure - #5728

Merged
enyst merged 5 commits into
mainfrom
claude/project-thread-run0wk
Oct 13, 2026
Merged

enyst merged 5 commits into
mainfrom
claude/project-thread-run0wk

Conversation

@enyst

@enyst enyst commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

HUMAN:
This PR adds improvements to how agents record bugs, so that they can compare them better across runs. It adds subcommands they can use, to save the exact error, so then they can check if the same reproduces twice or something else changed between baseline/current.


AGENT:

I'm an AI agent helping Engel Nyst (@enyst) with the verification work.

Why

map run reported a known bug bullet as xfail whenever the command marked # bug exited non-zero. It checked which command failed but not which failure it saw, so a new 401, 404 or 503 at that line counted as reproducing a documented 500. That undermines the twice-baseline/twice-fix proof from #5621 (#5726).

Summary

  • Marker contract. Every marker now names the bug's own symptom: # bug: PREDICATE, made of PATH OP [VALUE] clauses joined by &&. They are matched like --check against the JSON that the last control-agent-server call on that line printed. exit N is kept only as a last resort. Here is F08.secrets-bad-value before and after:
    # before
    control-agent-server api POST "/api/conversations/$KID/secrets" --json '{"secrets": {"QA_F08_NUMBER": 5}}' \
      --expect 422 --save F08.secrets-bad-value/number  # bug
    # after
    control-agent-server api POST "/api/conversations/$KID/secrets" --json '{"secrets": {"QA_F08_NUMBER": 5}}' \
      --expect 422 --save F08.secrets-bad-value/number  # bug: status eq 500 && response.body.exception contains "'int' object has no attribute 'pop'"
    The --expect 422 assertion of the correct behavior is unchanged.
  • assert verb. control-agent-server assert --value|--json FILE|stdin --check ... checks a value that the recipe computed and prints it. Comparison lines that used to say only "the jq was false" now name the value the bug produces. For example, jq -e '.status == 409' f # bug: exit 1 becomes control-agent-server assert --json f --check status eq 409 # bug: value.status eq 200 && value.response.body.message eq "Profile 'qa-alias.json' deleted".
  • map run:
    • xfail only when the marked command fails and its predicate holds. Any other failure at that line is fail, reported with the observed status and a hint.
    • xpass only when every command passed and the bullet's arrange ran. A known bug that passes after its Preconditions or a Requires: recipe failed earlier in the run (with --keep-going) is fail.
    • Each CLI call writes its output to a per-bullet observation file. The ERR trap snapshots that file, so a recipe's EXIT cleanup can't overwrite the evidence.
  • map check rejects:
    • a missing or malformed predicate;
    • a PATH OP predicate on a line with no CLI call;
    • negative shapes (if cmd; then false; fi, ! cmd, test !), because an unrelated error in cmd would read as a fix. The 8 such lines now assert the correct behavior positively.
  • Map. All 204 marked lines carry a predicate taken from the failure their prose documents.
  • Docs. mapping.md gains a known-bug contract, worded so the sibling skills (verify-openhands in feat(verify-openhands): executable known bugs and a repeatable fix proof OpenHands#18348, verify-automation) can keep the same rules. SKILL.md covers the twice-baseline/twice-fix proof. maintenance.md says a known bug failing in a different way is a finding, never a reason to widen the predicate.

Issue Number

Fixes #5726

How to Test

  • uv run pytest tests/cross/test_verify_agent_server_skill.py: 59 pass. The new tests cover:

    • the documented failure (xfail);
    • an unrelated 503 at the same marked command (fail);
    • correct behavior (xpass);
    • a pass after a broken arrange (fail);
    • test exiting 2 instead of 1 (fail);
    • an EXIT cleanup calling the CLI after the failure (still xfail);
    • the assert verb;
    • malformed, missing and negative bug lines rejected by map check.

    The existing setup-failure and timeout tests still report fail.

  • control-agent-server map check --no-routes: ok, 34 files.

  • Live replay of all 34 families at fbe39f1 (map run --fresh --keep-going). There was no DeepSeek key, so model-backed bullets fail before their marked lines.

    • 124 known-bug bullets reached their marked line, and all 124 reported xfail. That includes 37 of the rewritten assert and positive lines. No bullet failed on a predicate mismatch.
    • The other 29 known-bug bullets stopped earlier, at a model call or another missing prerequisite.
    • One of those, F10.ask-agent-unknown, used to read as xpass: its Preconditions had failed, so $NOPE was empty. It now reports fail.

Video/Screenshots

n/a

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes


🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)

• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python-slim amd64, arm64 python-node-runtime Link
python-minimal amd64, arm64 python-node-runtime Link
python amd64, arm64 python-node-runtime Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:c3b8af8-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-c3b8af8-python \
  ghcr.io/openhands/agent-server:c3b8af8-python

All tags pushed for this build

ghcr.io/openhands/agent-server:c3b8af8-golang-amd64
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-golang-amd64
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-golang-amd64
ghcr.io/openhands/agent-server:c3b8af8-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:c3b8af8-golang-arm64
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-golang-arm64
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-golang-arm64
ghcr.io/openhands/agent-server:c3b8af8-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:c3b8af8-java-amd64
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-java-amd64
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-java-amd64
ghcr.io/openhands/agent-server:c3b8af8-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:c3b8af8-java-arm64
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-java-arm64
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-java-arm64
ghcr.io/openhands/agent-server:c3b8af8-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:c3b8af8-python-amd64
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-python-amd64
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-python-amd64
ghcr.io/openhands/agent-server:c3b8af8-python-node-runtime-amd64
ghcr.io/openhands/agent-server:c3b8af8-python-arm64
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-python-arm64
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-python-arm64
ghcr.io/openhands/agent-server:c3b8af8-python-node-runtime-arm64
ghcr.io/openhands/agent-server:c3b8af8-python-minimal-amd64
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-python-minimal-amd64
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-python-minimal-amd64
ghcr.io/openhands/agent-server:c3b8af8-python-node-runtime-minimal-amd64
ghcr.io/openhands/agent-server:c3b8af8-python-minimal-arm64
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-python-minimal-arm64
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-python-minimal-arm64
ghcr.io/openhands/agent-server:c3b8af8-python-node-runtime-minimal-arm64
ghcr.io/openhands/agent-server:c3b8af8-python-slim-amd64
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-python-slim-amd64
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-python-slim-amd64
ghcr.io/openhands/agent-server:c3b8af8-python-node-runtime-slim-amd64
ghcr.io/openhands/agent-server:c3b8af8-python-slim-arm64
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-python-slim-arm64
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-python-slim-arm64
ghcr.io/openhands/agent-server:c3b8af8-python-node-runtime-slim-arm64
ghcr.io/openhands/agent-server:c3b8af8-golang
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-golang
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-golang
ghcr.io/openhands/agent-server:c3b8af8-golang_tag_1.21-bookworm
ghcr.io/openhands/agent-server:c3b8af8-java
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-java
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-java
ghcr.io/openhands/agent-server:c3b8af8-eclipse-temurin_tag_17-jdk
ghcr.io/openhands/agent-server:c3b8af8-python-minimal
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-python-minimal
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-python-minimal
ghcr.io/openhands/agent-server:c3b8af8-python-node-runtime-minimal
ghcr.io/openhands/agent-server:c3b8af8-python-slim
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-python-slim
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-python-slim
ghcr.io/openhands/agent-server:c3b8af8-python-node-runtime-slim
ghcr.io/openhands/agent-server:c3b8af8-python
ghcr.io/openhands/agent-server:c3b8af88bfd4a258f941ad6bf06e25b4db57f89c-python
ghcr.io/openhands/agent-server:claude-project-thread-run0wk-python
ghcr.io/openhands/agent-server:c3b8af8-python-node-runtime

About Multi-Architecture Support

  • Each variant tag (e.g., c3b8af8-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., c3b8af8-python-amd64) are also available if needed

A `known bug` bullet was reported xfail whenever its `# bug` line failed,
for any reason, so an unrelated 401/404/503 at the marked command passed
for a reproduction of the bug. Each marker now names the documented
failure, `# bug: PREDICATE`:

- `exit N` for lines with no CLI call (`test`, `jq -e`, ...);
- `PATH OP [VALUE]` clauses joined by `&&`, matched like --check against
  the JSON the last control-agent-server call on the line printed.

map run reports xfail only when the marked command fails and the
predicate holds; any other failure is `fail`, with the observed status
and a hint. map check rejects a missing or malformed predicate. Every CLI
call writes its printed object to a per-bullet observation file, which
the ERR trap snapshots before a recipe's EXIT cleanup runs.

All 204 marked lines in the map get a predicate for the failure their
prose documents.

Fixes #5726

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YEJjVG4YeJMcv4nG4kfTb
@enyst enyst self-assigned this Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result: ✅ PASSED

Action log

Two holes found by comparing with verify-openhands (OpenHands/OpenHands#18348):

- `# bug: exit 1` on a comparison (`jq -e '.status == 409'`, `test "$N" =
  ...`) accepted any wrong value as the bug. A new `assert` verb checks a
  value the recipe computed (--value, --json FILE or stdin) and prints it,
  so those 53 lines now name the value the bug produces
  (`# bug: value.status eq 200`). Only lines with exec output fields keep
  their own predicate.
- Negative bug lines (`if cmd; then false; fi`, `test !`) exited 0 when cmd
  broke for an unrelated reason, which read as xpass. map check now
  rejects those shapes; the 8 such lines assert the correct behavior
  positively, so xpass means it was observed.

mapping.md states the known-bug contract to keep in step with the sibling
verification skills.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YEJjVG4YeJMcv4nG4kfTb
With --keep-going, a known-bug recipe whose Preconditions or Requires:
recipe failed can pass on empty variables (a replay without a model key
showed F10.ask-agent-unknown passing against /api/conversations//ask_agent).
Such a pass is now fail, with a hint naming what failed earlier.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YEJjVG4YeJMcv4nG4kfTb
@enyst
enyst marked this pull request as ready for review October 12, 2026 22:22
@enyst
enyst requested a review from all-hands-bot October 12, 2026 22:22
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YEJjVG4YeJMcv4nG4kfTb

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

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).

Scope

The change belongs in this repository: it modifies the in-repo .agents/skills/verify-agent-server/ skill (its control CLI, feature map, and docs) plus tests/cross/test_verify_agent_server_skill.py. The linked issue #5726 explicitly keeps the sibling OpenHands/automation runner port out of this repo, so there is no misplaced scope.

Verification

  • Re-fetched head 6048c5bad8cfe51393a9892cb09153f1b988c9f3; it still matches the review request. PR is open, not draft, no labels, no prior reviews/comments from this account.
  • All GitHub Actions check runs for the head are success (only cleanup-after-merge/cleanup-on-approval are skipped); no failing or pending required checks.
  • uv run pytest tests/cross/test_verify_agent_server_skill.py → 59 passed.
  • control-agent-server map check --no-routes → ok, 34 files, 935 ids, no problems.
  • Inspected every changed branch against the base classifier: bug_ranges → bug_marks/BugMark now carry the predicate; parse_bug_predicate and bug_predicate_matches gate xfail on the documented failure; assert verb added; NEGATIVE_BUG_RE and the CLI-presence check added to map check; the ERR trap snapshots OBSERVATION_ENV before EXIT cleanup can overwrite it.

Assessment

The classifier now distinguishes the documented failure from an unrelated error at the same marked command, which is exactly the defect #5726 describes. I confirmed by reading the code and running the map that:

  • xfail requires the marked command to fail and its PATH OP/exit N predicate to hold against the observation the marked line's CLI call printed; a different 401/404/503 is fail with the observed status and a hint.
  • xpass only when every command passed and no failed Preconditions/Requires: recipe preceded it, so a pass over a broken arrange is fail.
  • map check rejects a missing/malformed predicate, a PATH OP predicate on a line with no CLI call, and the negative shapes (if cmd; then false; fi, ! cmd, test !), and all 204 marked lines carry a predicate (only 2 use exit N as the documented last resort).
  • The observation file is per-bullet and refreshed on every CLI call, and the ERR trap copies it at the failing command before any EXIT trap runs; cmd_helper_start deliberately strips OBSERVATION_ENV from detached helpers.

I found no material correctness, security, or compatibility defect in the current head, and each acceptance criterion in #5726 (retained correct-behavior assertion, xfail/xpass/fail semantics, malformed-predicate rejection, docs, and the F08.secrets-bad-value predicate) is addressed. The added tests cover the documented failure, an unrelated 503, correct behavior, a pass after a broken arrange, test exiting 2, the EXIT-cleanup case, the assert verb, and the rejected-bug-line cases.

✅ APPROVED

…full Requires closure

A `# bug:` clause other than `missing` now needs its path present in the
observed output (a stored null counts), so an error object without
`checks` no longer matches `checks.0.actual eq null`. A predicate made only
of `missing` clauses is rejected. The arrange guard now walks the whole
`Requires:` closure, so a known bug whose indirect prerequisite failed
cannot read as fixed. F10.fork-keeps-credentials also anchors on the
stored agent.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YEJjVG4YeJMcv4nG4kfTb

@neubig neubig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Architecture looks good: the runner retains the correct-behavior assertion, matches the documented failure separately, captures observations before cleanup, and guards missing paths and transitive prerequisites. Current-head CI and the controlled-server regression coverage support the classifier change. This addresses a worthwhile medium-priority verification-integrity issue.

Non-blocking suggestion: add one representative real baseline/fixed replay pair (for example F08.secrets-bad-value), showing xfail on the unfixed server and xpass on the fixed server with the same commands and prerequisites. That would complete the strongest acceptance evidence beyond the partial live replay and controlled HTTP tests.

Reviewed head c3b8af8. No independent test execution was performed in this review.

[RISK ASSESSMENT] Medium: shared verification classification changes, but no production API change. Approved; the representative pair is a suggestion, not a merge blocker.

This review was created by an AI agent (OpenHands) on behalf of Graham Neubig.

@enyst enyst mentioned this pull request Oct 13, 2026
2 of 5 tasks
@enyst

enyst commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

Thanks for the review. Here is the baseline/fixed pair you suggested for F08.secrets-bad-value, run with this PR's CLI at c3b8af8 and the same recipe, flags and Preconditions on both sides (the 2+2 rule in SKILL.md, "Verify an existing fix"):

control-agent-server map run --file F08 --only F08.secrets-bad-value --fresh --repeat 2 --checkout <unfixed checkout>   # baseline
control-agent-server map run --file F08 --only F08.secrets-bad-value --fresh --repeat 2                                # fixed
server attempt 1 attempt 2 marked call observed
unfixed (this branch, server code as on main) xfail xfail 500, "exception": "'int' object has no attribute 'pop'"
fixed (scratch patch below) xpass xpass 422, value_error at body.secrets

Preconditions passed in all four runs. The "fixed" server is a throwaway patch that only exists for this check; it is not part of this PR:

             else:
-                # Keep other types as-is (will likely fail validation later)
-                converted[key] = value
+                raise ValueError(
+                    f"secret {key!r} must be a string or a secret object"
+                )

(in UpdateSecretsRequest.convert_string_secrets, openhands-agent-server/openhands/agent_server/models.py). One caveat: these runs used a placeholder DeepSeek key with llm preset deepseek --no-validate, which this recipe doesn't depend on since it never calls the model.


Generated by Claude Code

@enyst
enyst merged commit dfd8fe8 into main Oct 13, 2026
54 checks passed
@enyst
enyst deleted the claude/project-thread-run0wk branch October 13, 2026 20:28
enyst added a commit to OpenHands/automation that referenced this pull request Oct 20, 2026
…re (#582)

* verify-automation: known-bug xfail must match the documented failure

A `known bug` bullet was reported xfail whenever its `# bug` line failed,
for any reason, so an unrelated 401/404/503 at the marked command passed
for a reproduction of the bug. This ports the known-bug contract from
verify-agent-server (OpenHands/software-agent-sdk#5728), shared with
verify-openhands (OpenHands/OpenHands#18348):

- Each marker names the documented failure, `# bug: PREDICATE`:
  `PATH OP [VALUE]` clauses joined by `&&`, matched like --check against
  the JSON the last control-automation call on the line printed, with
  `exit N` as a last resort. Paths must be present (a stored null counts).
- map run reports xfail only when the marked command fails and the
  predicate holds; any other failure is fail, with the observed status
  and a hint. Every CLI call writes its printed object to a per-bullet
  observation file, which the ERR trap snapshots before an EXIT cleanup.
- xpass needs the correct behavior observed: map check rejects negative
  bug lines (`if cmd; then false; fi`, `! cmd`, `test !`), and a pass
  after a failed Preconditions or Requires: closure is fail.
- A new `assert` verb checks a value a recipe computed, so a predicate
  can name the bug's value instead of a bare exit status.

All 8 marked lines get a predicate; a live replay of F05, F06, F09, F10
and F12 reports each of them xfail. mapping.md states the contract.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VG2xJHeFL935pKEFRsFpsu

* verify-automation: reserve `exit` in known-bug predicates

`# bug: exit eq 2` parsed as a PATH clause on the CLI's own `exit` field,
which only its usage and environment errors set, so a CLI usage error
could read as the documented bug. A clause on `exit` is now rejected
unless it is `exit N`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VG2xJHeFL935pKEFRsFpsu

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

[Bug]: Verification xfail can accept an unrelated error at the marked command

4 participants