Skip to content

Add verify-sdk: an executable feature map of the in-process SDK - #5750

Merged
enyst merged 11 commits into
mainfrom
claude/verify-sdk-skill
Nov 9, 2026
Merged

enyst merged 11 commits into
mainfrom
claude/verify-sdk-skill

Conversation

@enyst

@enyst enyst commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

HUMAN:

This PR is part of agentic self-healing work for the SDK.


AGENT:

I'm an AI agent (Claude Code) helping Engel Nyst (@enyst) with project maintenance.

Requested by Engel · project thread

Why

The repository's server verification map (verify-agent-server) does not cover how an ordinary Python program uses the in-process SDK. Unit tests cover the pieces, but nothing regularly drives the public API end to end and checks what a program actually sees.

Summary

 verify-sdk: 21 families / 458 mapped sub-features
   sdk-map owners → changed source paths → affected families
   sdk-map run   → control-sdk → isolated SDK program / example
                                  ├─ scripted TestLLM
                                  ├─ live DeepSeek
                                  └─ missing prerequisite → blocked
   ledger + transcripts → sdk-map report → pass / fail / blocked

 per run: private HOME, persistence, conversations, workspace, tmux
  • .agents/skills/verify-sdk/: the feature map (S01..S21, so IDs never collide with the agent-server map's Fnn), recipes, the daily delta pass, and maintenance notes.
  • control-sdk, an isolated in-process driver, and short programs under programs/Snn/. Recipes drive the SDK through public APIs only and never rerun pytest (sdk-map check rejects that).
  • sdk-map: check, ids, owners, baseline, run, report. Tests in tests/cross/test_verify_sdk_skill.py and tests/cross/test_control_sdk.py.

Issue Number

Fixes #6437

How to Test

uv run pytest tests/cross/test_verify_sdk_skill.py tests/cross/test_control_sdk.py -q
export PATH="$PWD/.agents/skills/verify-sdk/scripts:$PATH"
sdk-map check
sdk-map run --file S05 --out /tmp/sdk-s05 && sdk-map report --runs /tmp/sdk-s05 --print-markdown
# with DEEPSEEK_API_KEY set, the same run also drives the live bullets

Results on 2026-11-03, on top of main c76d305:

  • 24 harness tests pass, sdk-map check reports no problems, and pre-commit (ruff, pycodestyle, pyright) is clean. CI is green on b8ca733.
  • First full run with live bullets (DeepSeek Flash): 415 sub-features pass, 14 blocked, 29 fail. Every failing bullet carries a Known failure note in the map, so the map is green apart from documented product bugs.
  • The first replay of the day, before updating the map, was 334 pass / 12 blocked / 112 fail. Most of that was drift since 2026-10-13 (ThinkTool now opt-in, settings schema v9 and profile schema v4, switch_llm and fork(title=) changes, the missing-event-file fix), plus two harness gaps that only live runs reach: the integration runner could not import tests.integration, and it needs LLM_BASE_URL. Both are fixed in control-sdk.

Update on 2026-11-08, on top of main 51ad223 (the map baseline now records this commit):

  • A full rerun after merging main showed drift in four families, all from changes on main rather than product bugs. Fixed here:
    • S19: profile resolution moved to openhands.sdk.launch (resolve / finalize / preview_launch, UnresolvedProfileReferences) in 1.60, and agent settings are at schema v10 (MCP servers with neither command nor url are dropped).
    • S09: with fastmcp 4 our test MCP server has to send tools/list_changed inside the request, or it is dropped; with the mcp 2 client a 503 surfaces as "Server returned an error response". The session-recovery known failure still reproduces, now as Session not found / Connection closed.
    • S04: fork(title=) no longer warns (1.60). S21: since fix(acp): emit agent text before the tool call it precedes #6452 the ACP agent emits thoughts said before a tool call as their own agent message, so the recipe checks them there.
  • Rerunning those four families plus S11 (whose example 42 had hit a one-off timeout), live bullets included: 65 bullets pass, 5 blocked, 6 fail, and all 6 failures are existing Known failure notes. Harness tests, sdk-map check and pre-commit pass.

Video/Screenshots

Not applicable; see the verification record above.

Type

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

Notes

What the run found about the SDK (none of it is fixed in this PR; fixes belong in their own PRs):

  • 18 of the 23 findings recorded on 2026-10-13 still reproduce. Five are fixed on main and their notes now say so (budget on the public Conversation factory, the two cached-tag plugin fetches, 100 glob matches, discriminated-union validation mutating its input). One moved: with the LiteLLM 1.93 → 1.105 upgrade the no-response retry now works on the chat path and fails on the Responses path.
  • New: example 51 (agent hooks) asks the model to describe "this repository" from an empty temp directory, so it wanders the machine and hits its 10-iteration cap; example 03_managing_installed_skills reads .installed.json with a stale skills key. Three of eight malformed-history patterns surface as LLMBadRequestError instead of LLMMalformedConversationHistoryError.
  • None of these is filed yet; filing waits on a maintainer's call.
  • Interim PR test(verify-sdk): exercise Jev threat classification through conversations #6035 (Jev security analyzer recipes) targets this branch.
  • Cross-repo dependencies: none.

Split from #5727, which carried the agent-server daily pass. Visual explanation by Codex using HumanLayer show-me.

🤖 Generated with Claude Code

https://claude.ai/code/session_013ArwwLKWzfpSTpRccheeWP

…ly pass

21 families (S01..S21, 458 sub-features) of what a program using
openhands.sdk sees, each with deterministic, example and integration
proofs, plus sdk-map (check, ids, owners, baseline, run, report).
run replays a family's sh blocks in their own process groups, judges
integration runs by results.json, and writes one ledger row per
sub-feature; report compares ledgers by attempt time.

The daily pass replays only the families changed since the maintenance
baseline and stops early when nothing merged. Split out of #5727.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0156LdhCQX5Un8928QWjHcST
@enyst enyst mentioned this pull request Oct 13, 2026
2 of 5 tasks
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result: ✅ PASSED

Action log

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0156LdhCQX5Un8928QWjHcST
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0156LdhCQX5Un8928QWjHcST
Every family's "Driving it" section now drives the SDK the way a program
does: scripted TestLLM conversations and short programs under programs/Snn,
plus live bullets (DeepSeek, examples, integration runs) that run when a key
is set. No recipe calls pytest. Bullets that hit a product bug keep the
correct-behavior checks and a "Known failure" note.

sdk-map: a "# no model" line lets a key-free example run without a key;
the blocked label ignores backticked IDs; control-sdk calls with quoted
operators parse; owners reports paths named under "Not mapped" separately.
control-sdk: --expect-output searches all of stdout, and `\.` escapes a dot
in a check path. redact.py and the conversation request models get owners.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0156LdhCQX5Un8928QWjHcST
Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
  ✅ **PR Artifacts Cleaned Up**

  This PR no longer adds or changes files under `.pr/`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ArwwLKWzfpSTpRccheeWP
Replaying the whole map on main with a DeepSeek key showed drift since
2026-10-13 and two harness gaps that only live runs reach:

- control-sdk: put the repo root on PYTHONPATH so recipes can run the
  integration runner (it imports tests.integration), and export
  LLM_BASE_URL with --model-env, which the runner requires.
- ThinkTool is opt-in since #6159: drop think from expected tool lists.
- Settings schema v9 and profile schema v4 (#6091): retired switches and
  ACPAgentSettings.llm are refused as input and dropped on migration;
  version pins in recipes are no longer exact package versions.
- switch_llm installs the posted LLM for a registered usage_id (#5779);
  fork(title=) is deprecated and ignored locally (#4814); a missing
  event file no longer stops a reload (#6197).
- Five October known failures now pass on main (#6257, #5685, #6342,
  #5770); their notes say so. The no-response retry bug moved from the
  chat path to the Responses path with the LiteLLM upgrade.
- Browser programs count the run's Chromium by HOME instead of by
  Playwright path, and the no-Chromium bullet exits 3 when a system
  Chrome cannot be hidden.
- Programs shorten long run paths before cutting output, the GPT-5
  example runs in a git-initialized workspace, the installed-skills
  example is a new known failure, and the planning preset is no longer
  driven through the integration runner, where it fails by design.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ArwwLKWzfpSTpRccheeWP
…d live findings

- New S02/api_compliance program: run_infer.py does not load the a*
  compliance tests and run_compliance.py knows only the proxy models, so
  the program runs the same test classes against the run's model. All
  eight patterns are rejected by DeepSeek; three surface as the generic
  LLMBadRequestError instead of LLMMalformedConversationHistoryError.
- S13 live risk: a model that never proposes the deletion exits 3
  instead of failing the confirmation checks.
- S10 example 51 and S07 installed-skills example: known failures in the
  examples themselves, reproduced on 2026-11-03.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ArwwLKWzfpSTpRccheeWP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ArwwLKWzfpSTpRccheeWP
- S19: drive profile resolution through openhands.sdk.launch
  (resolve/finalize/preview_launch); settings schema v10; moved unit test.
- S09: the test MCP server sends tools/list_changed inside the request
  (fastmcp 4 drops it afterwards); the mcp 2 client reports a 503 as
  "Server returned an error response"; refresh the session-recovery
  known failure's messages.
- S04: fork(title=) no longer warns (1.60); drop that check.
- S21: since #6452 pre-tool-call thoughts ride their own agent message;
  check them there.
- Map baseline c76d305 (2026-11-03).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ArwwLKWzfpSTpRccheeWP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ArwwLKWzfpSTpRccheeWP
@datadog-official

datadog-official Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 63de6bb | Docs | View more details | Give us feedback!

@enyst
enyst marked this pull request as ready for review November 8, 2026 15:57
@enyst
enyst requested a review from all-hands-bot November 8, 2026 15:57

@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. This PR is entirely additive: 153 files under a new self-contained .agents/skills/verify-sdk/ skill (feature map S01–S21, control-sdk driver, sdk-map tool, 122 recipe programs, references) plus two new test files under tests/cross/. No product code, schemas, examples, CI workflows, or dependency files change, so there is no compatibility surface and the cross-layer checklist in AGENTS.md does not apply. This mirrors the existing verify-agent-server skill already in this repository (same layout, Snn IDs deliberately disjoint from that map's Fnn), so the change belongs here and matches the repo's verification-skill direction. The linked issue #6437 (open, ready-for-dev) asks exactly for this.

Verified on head 63de6bb.

  • CI: all checks green on this head, including cross-tests, sdk-tests, pre-commit, and security.
  • Locally: uv run pytest tests/cross/test_verify_sdk_skill.py tests/cross/test_control_sdk.py -q → 24 passed; sdk-map check → ok: true (21 family files, 458 IDs, index counts consistent, baseline line main@51ad223 resolves and is an ancestor of main).
  • Replay spot-check: sdk-map run --file S05 and --file S14 (scripted bullets) work end to end; every failing bullet reproduced a failure the map already documents with a Known failure (reproduced <date>) note (S05 damaged-log ValidationError, S14 tmux pane-pool interactive/query/reset). That is the intended behavior — known product bugs stay visible as fail rows with notes, while daily.md keys regression detection on newly failing versus a baseline run. The remaining S14 misses in my sandbox traced to declared family preconditions (rg not installed here), not tool defects.

Security. control-sdk scrubs caller LLM_*/OH_*/OPENHANDS_*/LITELLM_* variables, gives each run a private HOME/OH_PERSISTENCE_DIR/workspace/tmux socket, redacts the model key from captured stdout/stderr before writing exec.log or returning output, and blocks (exit 3) instead of failing when a key is missing. Test programs bind only to loopback with ephemeral or dummy ports and use obviously fake key strings; no secrets are committed. Recipes run in their own process groups that are killed on exit/timeout (covered by a test), and per-block private SDK_VERIFY_HOMEs keep runs isolated. All reasonable for a developer-verification skill.

No material correctness, security, or compatibility finding on the current head. The documented product bugs the map records are findings about the SDK, not about this PR, and the PR correctly does not fix them here.

✅ APPROVED

This was referenced Nov 9, 2026
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.

verify-sdk: an executable feature map of the in-process SDK

3 participants