Skip to content

test(harness): green the harness suite and run it in CI - #323

Draft
KarthikAvinashFI wants to merge 5 commits into
devfrom
fix/TH-8768-harness-tests-ci
Draft

KarthikAvinashFI wants to merge 5 commits into
devfrom
fix/TH-8768-harness-tests-ci

Conversation

@KarthikAvinashFI

Copy link
Copy Markdown
Member

1. Why

The harness test suite (tests/test_harness.py and tests/harness/) runs in no CI job, so it drifted: a merge glued an old test body into another test, fakes fell behind the code they stand in for, and a few checks still describe a tool surface the harness no longer has. This PR makes the suite green again and adds a CI job that keeps it that way.

2. What changed

File Change
.github/workflows/harness-tests.yml (new) On every PR and on pushes to dev and main: uv sync --extra livekit --extra harness-stores --extra harness-ui --extra hosted-tracing, then uv run pytest -q -p no:cacheprovider tests/test_harness.py tests/harness
tests/harness/test_grade.py Splits the fan-out test a merge had glued into test_the_cap_holds_for_the_session_that_saves_too (the NameError on st); then drops that fan-out test: it drove the generate_suite tool, which sub-agent writers replaced, and write_in_parallel has no caller left
tests/harness/test_dispatch_ack.py The duck-typed report and failure fakes carry the fields the call runner now logs (run_id, test_case_id, failure.details, failure.stage) and the runner context it reads (usage_reporter, evidence_seam)
tests/test_harness.py test_a_skill_only_names_tools_its_stage_actually_has derives every field of the contract's nested models, the values Literal fields and the sub-goal contract offer, and the sub-agent name, instead of a hand list; it keeps the hand list only for the example tools the scenario skill uses to show a check going wrong. test_hosted_claude_session_uses_durable_resume_and_restricted_tools runs on a Gemini model (the harness refuses Claude models) and checks the current tool surface: allowed_tools is exactly the spec's builtins, no MCP server, strict config. test_the_system_prompt_stays_within_budget caps the prompts at today's size plus room

3. Behavior callouts

  • No product code changes; tests and CI only.
  • The prompt-size cap moves from 90,000 / 130,000 characters to 185,000 / 270,000: the write-scenarios skill alone is 124,000 characters today. The cap still fails a skill that keeps growing; shrinking the skill is its own work.
  • The session test no longer asserts options.tools == builtins or that AskUserQuestion stays out of allowed_tools: since the scenario-writers change, the Claude backend grants builtins through allowed_tools and restricts the rest with the gate hooks and permission callback.

4. Tests

Run Result
uv run pytest -q tests/test_harness.py tests/harness with the CI extras, on this head 5163 passed, 20 skipped
Same, before this PR, without the extras 18 failed, 36 errors; 46 of them were missing livekit / psycopg, which the CI job installs

Mutation check for the skill test: a skill naming a tool that does not exist (seed_the_wrold) fails it.

Not in this job: tests/test_cli_examples.py (11) and tests/test_config_and_facades.py (37) fail on dev too, back to at least 8 Oct (a0e2ef23); they exercise the SDK examples and optimizer scoring, not the harness.

5. Commands

uv sync --extra livekit --extra harness-stores --extra harness-ui --extra hosted-tracing
uv run pytest -q -p no:cacheprovider tests/test_harness.py tests/harness

Linear

Fix TH-8768

@KarthikAvinashFI KarthikAvinashFI self-assigned this Nov 14, 2026

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant