Skip to content

test(e2e): backfill coverage for migration guard, prompt placement, redirects and the privacy sheet - #5975

Merged
M3gA-Mind merged 3 commits into
tinyhumansai:mainfrom
M3gA-Mind:test/backfill-e2e-coverage
Sep 2, 2026
Merged

test(e2e): backfill coverage for migration guard, prompt placement, redirects and the privacy sheet#5975
M3gA-Mind merged 3 commits into
tinyhumansai:mainfrom
M3gA-Mind:test/backfill-e2e-coverage

Conversation

@M3gA-Mind

@M3gA-Mind M3gA-Mind commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Backfills e2e coverage for five recently-merged PRs that shipped without it. Each test drives the changed code path and asserts the changed behaviour — not a symbol mention, which is all the domain e2e gate's string match would require.

Also fixes a test on main that asserts the opposite of shipped behaviour (§ /skills below).

Problem

An audit of six PRs merged in the last seven days found zero with e2e coverage of what they changed. Three of them shipped tests their authors reasonably believed were sufficient:

Solution

PR Lane Test
#5799 tests/json_rpc_e2e.rs json_rpc_migrate_hermes_refuses_null_driver_without_naming_openclaw
#5821 tests/raw_coverage/agent_prompts_subagent_raw_coverage_e2e.rs system_prompt_appends_the_tool_policy_boundary_after_the_body, two_agents_differing_only_in_policy_share_a_leading_prefix
#5939 app/test/playwright/specs/connections-tab-deeplinks.spec.ts /webhooks?tab= survives BOTH hops of its redirect, /webhooks carries the fragment through as well as the query
#5845 app/test/playwright/specs/privacy-what-leaves-sheet.spec.ts 3 tests (new file)
#5858 not covered — see below

Revert-check

Every Rust test was run with the fix in place, with the specific hunk reverted, and restored. All three failed on my assertion, not a compile error or an unrelated panic.

test with fix reverted restored
json_rpc_migrate_hermes_refuses_null_driver_without_naming_openclaw 1 passed FAILED json_rpc_e2e.rs:14219!message.contains("OpenClaw"), quoting the restored text: "refusing to import OpenClaw memory into the null driver — memory is disabled by configuration…"
system_prompt_appends_the_tool_policy_boundary_after_the_body passed FAILED agent_harness_e2e.rs:3210 — "the boundary must not open the prompt", with Prompt begins: "## Tool Policy Boundary\n- Agent: main\n- Channel: boundary-channel…" passed
the_tool_policy_boundary_is_the_last_block_in_the_prompt passed FAILED agent_harness_e2e.rs:3248 — "the boundary block must be the prompt's FINAL block" passed

The two Playwright specs were NOT run locally, and I am not claiming they were. app/scripts/e2e-web-build.sh builds a full product-featured openhuman-core before any spec can run, and the fleet is under a disk and memory throttle that prohibits builds of that size. Their revert analysis was done by reading the reverted components:

CI's ci-full.yml "E2E (Playwright / web lane)" job runs them for real.

#5845 — three of my first four assertions were vacuous, and I restructured rather than shipping them. I assumed the Radix rewrite introduced role="dialog", Escape-to-close and overlay-click-to-close. Reading the pre-#5845 component (git show 663399655^:…/WhatLeavesMyComputerSheet.tsx) shows it already had all three: role="dialog" + aria-modal at lines 41-42, a document keydown listener at 19-24, a full-bleed close <button> at 33-37. The only thing the rewrite added is aria-describedby — the old markup rendered the subhead as a bare <p> with no id. The Escape and overlay cases are kept and labelled in-file as preserved behaviour, which a library swap can lose quietly.

#5858 cannot be revert-checked, structurally. It re-points ~5000 lines of imports after tinyagents was split upstream into five crates. Reverting that does not produce a failing assertion — it produces a tree that does not compile, because the single tinyagents crate no longer exists at that path. Any test attached to it would be either upstream-crate coverage or vacuous with respect to this PR. A mass re-point is verified by the compiler, and that is the only verification available. The real gap underneath — interrupt_orphaned_agent_runs has no e2e in any lane — is described in W12-test-findings.md §3, including why the existing harness cannot reach it (bootstrap_core_runtime vs build_core_http_router).

A lane that silently skips its own tests

My first draft put the #5821 tests in tests/raw_coverage/. They never ran:

error: target `raw_coverage_all` in package `openhuman` requires the features: `voice`, `inference`

Cargo.toml:117 declares those required features. Cargo does not fail a plain cargo test for a target whose required features are off — it skips it, and only the explicit --test <name> form reports why. So every test in that 73-file lane is invisible to any default-feature run, including a contributor's local cargo test. Moved both tests to tests/agent_harness_e2e.rs, which declares none.

Worth someone checking separately: whether any CI lane passes voice,inference. If none does, that lane is not a lane.

/skills — a test on main asserting the opposite of shipped behaviour

connections-tab-deeplinks.spec.ts:176 pinned pre-fix behaviour with the comment "Flip the two assertions below when that lands." It landed: d434f1e0f (#5924) moved /skills onto ForwardSearch, and it is an ancestor of main. The fix predates the spec that contradicts it by four hours. Flipped, as instructed, and the stale file header corrected.

What #5799's test does and does not reach

target_memory_backend distinguishes three null-driver causes. The third — "this build has no memory module compiled in" — only fires under #[cfg(not(feature = "modules"))]: both feature = "modules" variants of binding::module_provider return DriverClass::Module unconditionally (memory/binding.rs:356-404). It is unreachable from any default-feature lane and stays covered by its gates-off unit test. The e2e drives the arm that is reachable and asserts the half of #5799 that changed for every build: the headline stopped hard-coding "OpenClaw" in a message migrate_hermes also raises.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy
  • Diff coverage ≥ 80% — the diff is tests; every added line is executed by the test that contains it.
  • N/A: Coverage matrix updated — no feature row added, removed or renamed; this adds coverage of existing rows.
  • N/A: All affected feature IDs from the matrix are listed under ## Related — no matrix rows changed.
  • No new external network dependencies introduced (the Playwright specs use the existing mock backend and core RPC helpers).
  • N/A: Manual smoke checklist updated — no release-cut surface changed.
  • N/A: Linked issue closed via Closes #NNN — this is coverage backfill for already-merged PRs, not an issue fix.

Impact

Tests only. No production code changes.

Related

Summary by CodeRabbit

  • Tests
    • Added coverage for preserving Connections tab selections, URL parameters, and fragments during redirects.
    • Added accessibility and dismissal checks for the onboarding privacy sheet.
    • Added regression tests for model-call timeouts and tool-policy prompt placement.
    • Added migration safety checks to ensure unsupported configurations are rejected without modifying the source workspace.

@M3gA-Mind
M3gA-Mind requested a review from a team September 2, 2026 13:00

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tinysweeper found nothing blocking. Approving.

$0.0000 · 0 in / 0 out

@tinysweeper

tinysweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown

How this change flows

0 changed behaviours across 8 relationships. 4 surrounding behaviours are shown (60 graph nodes walked). 56 further behaviours left out to keep the diagram readable.

flowchart LR
  n0["format"]:::impacted
  n1["join"]:::impacted
  n2["boot_stack"]:::impacted
  n3["spawn_sse_collector"]:::impacted
  n2 -->|calls| n0
  n2 -->|tests| n0
  n2 -->|calls| n1
  n2 -->|tests| n1
  n3 -->|calls| n0
  n3 -->|tests| n0
  n3 -->|calls| n1
  n3 -->|tests| n1
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading

Green: changed behaviour. Grey: surrounding behaviour. Arrows name the call, use, implementation, or test relationship. Orange: has findings. Red: has a finding that blocks the merge.

tinysweeper 0.1.0

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Sep 2, 2026
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: b1e6e3ee-e760-4683-a56f-cc81bf7f9462

📥 Commits

Reviewing files that changed from the base of the PR and between 5a0e694 and a45feef.

📒 Files selected for processing (1)
  • tests/json_rpc_e2e.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The pull request adds end-to-end coverage for Connections redirects, onboarding privacy-sheet interactions, tool-policy prompt placement, and Hermes migration refusal.

Changes

Connections deep-link coverage

Layer / File(s) Summary
Redirect query and fragment assertions
app/test/playwright/specs/connections-tab-deeplinks.spec.ts
Tests verify query preservation, Channels tab selection, two-hop webhook redirects, and fragment retention.

Onboarding privacy-sheet coverage

Layer / File(s) Summary
Privacy-sheet interaction tests
app/test/playwright/specs/privacy-what-leaves-sheet.spec.ts
Tests verify dialog content, aria-describedby, Escape dismissal, and outside-overlay dismissal.

Backend safety coverage

Layer / File(s) Summary
Tool-policy boundary placement
tests/agent_harness_e2e.rs
Tests verify the timeout baseline and confirm that the tool-policy boundary follows non-empty prompt content and remains the final prompt block.
Hermes null-driver refusal
tests/json_rpc_e2e.rs
Tests verify null-driver refusal messaging and unchanged source-file contents.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to a45fe

This PR adds and updates end-to-end tests without changing production behavior, and no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: senamakel

Poem

A rabbit checks each redirect trail
Queries stay aboard through every rail
The privacy sheet closes with care
Tool rules settle at the prompt’s rear
Safe migrations leave sources where they were

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 3 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the pull request's main change: adding end-to-end coverage for the migration guard, prompt placement, redirects, and privacy sheet.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 15.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 3 files. (1 skipped: 1 too large.)

  • Fix all pre-merge checks with AI

Warning

Your free Security trial is over. An organization admin can upgrade to Advanced for continuous pull request security review or dismiss this notice.


Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56eb259e43

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread app/test/playwright/specs/connections-tab-deeplinks.spec.ts
coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 2, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 2, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 2, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 2, 2026
…ects, privacy sheet

An audit of six PRs merged in the last week found none with e2e coverage of
what they changed. Three shipped tests their authors reasonably believed were
sufficient: tinyhumansai#5799 added 62 lines to `tests/json_rpc_e2e.rs` that are a
determinism fix for a different test; tinyhumansai#5821's four unit tests exercise an
extracted pure helper and would pass if `build_system_prompt` stopped calling
it; tinyhumansai#5939's two tests are vitest, not an e2e lane.

Added, each driving the changed path and asserting the changed behaviour:

- tinyhumansai#5799 `json_rpc_migrate_hermes_refuses_null_driver_without_naming_openclaw`.
  Drives the Hermes migration RPC into a configured null driver and asserts the
  refusal, that it no longer hard-codes "OpenClaw" in a message both migrations
  raise, and that the source workspace really is byte-identical afterwards.
  The third arm tinyhumansai#5799 added is unreachable with modules on and stays with its
  gates-off unit test; the doc comment says so rather than faking it.

- tinyhumansai#5821 two tests on the real `Agent::build_system_prompt`, asserting the
  tool-policy boundary does not open the prompt and that it is the prompt's
  final block — the property a prefix cache keys on, and the one a revert to
  prepending destroys.

- tinyhumansai#5939 two cases on `/webhooks`, asserting the query and the fragment survive
  BOTH redirect hops. They assert the final destination, so a fix to only the
  first hop still fails them.

- tinyhumansai#5845 a new spec opening the privacy sheet, which no e2e had ever done.

Also flips `BUG: /skills?tab=channels drops the tab`, which pinned pre-fix
behaviour with the note "Flip the two assertions below when that lands". It
landed in d434f1e (tinyhumansai#5924), four hours before that spec was last touched, so
the test asserts the opposite of shipped behaviour.
`raw_coverage_all` declares `required-features = ["voice", "inference"]`
(Cargo.toml:117). Cargo does not fail a plain `cargo test` for a target whose
required features are off — it SKIPS it, silently. A test placed there is
invisible to any default-feature run, including a contributor's local one:

    error: target `raw_coverage_all` in package `openhuman` requires the
    features: `voice`, `inference`

`tests/agent_harness_e2e.rs` declares none, so the assertions execute.

Self-contained rather than built on `streaming_support::agent_with_s`: that
helper resolves a real memory store, which needs an `EmbeddingHost` seam a
`tests/` binary cannot install — `host_impls::install_for_tests` is
`#[cfg(test)]`, visible only to the crate's own unit tests. Both tests failed
in setup on that before, in every phase, which is a test that cannot fail for
the reason it claims. The prompt path under test never touches memory, so a
stub is sufficient and steadier.
The working tree was formatted but the commit was not — `cargo fmt --check`
run against the tree passed while CI, which checks the commit, reported
`Diff in tests/agent_harness_e2e.rs:3236`.
@M3gA-Mind
M3gA-Mind merged commit 0261e30 into tinyhumansai:main Sep 2, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant