Skip to content

test(agent): give the turn-overrides fixture a hosted root authority - #6628

Merged
senamakel merged 1 commit into
tinyhumansai:mainfrom
M3gA-Mind:fix/6377-hosted-root-authority
Sep 25, 2026
Merged

senamakel merged 1 commit into
tinyhumansai:mainfrom
M3gA-Mind:fix/6377-hosted-root-authority

Conversation

@M3gA-Mind

@M3gA-Mind M3gA-Mind commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Gives tests/agent_turn_overrides_e2e.rs a hosted root authority of its own, via SessionHostBuilder::agent_definition, so its sessions can resolve the agent id they are stamped with.
  • Un-quarantines the two tests that this makes pass; leaves the other two quarantined, with markers that name what actually blocks them instead of a cause that no longer applies.
  • Test-only change. No product code is touched.

Problem

Every session turn is a hosted root invocation: it resolves its agent id against the host catalogue before composing a message and refuses the turn when the id is not there.

This fixture only ever set agent_definition_name("turn-overrides/orchestrator"). That stamps an id but does not put a definition behind it, and no built-in definition uses that id — deliberately, so a hit can only come from the fixture's own definition. After the hosted-TinyAgents cutover every turn in the file was unresolvable, and all four tests were quarantined under one marker: "fixture must use the hosted root authority".

The marker was right about the cause for half the file and, it turns out, incomplete for the other half.

Solution

agent_with now builds with .agent_definition(turn_overrides_definition()), a definition filed under the same id the session is stamped with (setters.rs:336 rejects a contradicting name, so the two must agree).

The tool scope is Wildcard, not a named list. The resolved definition's tools are the turn's allow-list, intersected with the belt the session was built with, and these tests assert what suppress_tools does to that belt — so the authority must not narrow it. Named would also work for the single tool in use, but it silently drops names missing from the parent registry, which would turn a future rename into an empty toolbelt and a failure two asserts away from its cause.

Un-quarantined (verified passing):

  • suppress_active_goal_keeps_the_thread_goal_out_of_the_prompt
  • thread_goal_complete_and_clear_stop_the_goal_reaching_later_turns

Still quarantined, markers re-aimed:

  • suppress_transcript_autoload_does_not_replay_a_prior_threads_transcript — fails in its own control, not its assertion: a fresh agent does not auto-load the prior transcript by agent name on the hosted path, so the test cannot prove the override prevents anything. Not isolated — either auto_save no longer writes where latest_for_agent looks, or the lookup key moved with the stamped session id. Deliberately not lifted by relaxing the control; the control is what makes the test non-vacuous.
  • turn_overrides_apply_to_exactly_one_turn_and_then_reset — turn 2 sets no overrides and must therefore carry the session's belt, but the upstream request's tool schema comes back empty. ToolScope is ruled out: Named(["turn_overrides_echo"]) and Wildcard produce the same empty schema. Turn 1's assertion cannot distinguish a suppressed belt from one that never arrives, so the open question is whether suppress_tools leaks past its one turn or the belt never reaches the model on this path at all.

Verified the way CI runs it — cargo test -p openhuman-cli --test agent_turn_overrides_e2e — 2 passed, 0 failed, 2 ignored.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy — this PR is the test change: two previously-disabled tests now run.
  • Diff coverage ≥ 80% — N/A: the diff is entirely test code and test-support code in tests/, which the coverage gate does not measure as changed product lines.
  • Coverage matrix updated — N/A: behaviour-only change — no feature row is added, removed or renamed; two existing tests move from disabled to running.
  • All affected feature IDs from the matrix are listed in the PR description under ## Related
  • No new external network dependencies introduced (mock backend used per Testing Strategy) — the fixture uses ScriptedModel and a local EchoTool; nothing leaves the process.
  • Manual smoke checklist updated if this touches release-cut surfaces — N/A: no product surface changes.
  • Linked issue closed via Closes #NNN in the ## Related section — N/A: deliberately NOT closing. Two of the four quarantined tests still fail, so this uses Refs — see below.

Impact

None at runtime. Test-only: no product code, no dependencies, no migrations. Two tests that were skipped now execute in the agent_turn_overrides_e2e target.

Related

  • Closes: (none — see below)
  • Refs Turn override E2E fixtures need hosted root authority #6377 — partially addressed. The hosted root authority was necessary but not sufficient: it fixes two of the four quarantined tests. The issue should stay open for the two remaining symptoms, which are described in the re-aimed #[ignore] markers and in ## Solution above. They may warrant splitting into their own issues, since neither is about the fixture's authority any more.
  • Matrix feature IDs: none — no row in docs/TEST-COVERAGE-MATRIX.md covers agent_turn_overrides_e2e.

Summary by CodeRabbit

  • Tests
    • Expanded end-to-end coverage for suppressing active goals and completing and clearing terminal goals.
    • Transcript autoload suppression and one-turn override reset scenarios remain skipped while their hosted-root failures are unresolved.

Every session turn is a hosted root invocation: it resolves its agent id
against the host catalogue before composing a message and refuses the turn
when the id is not there. This fixture only ever set
`agent_definition_name("turn-overrides/orchestrator")`, which stamps an id
without putting a definition behind it — and no built-in uses that id, by
design. Post-cutover every turn in the file was therefore unresolvable, and
all four tests were quarantined under one marker.

Bring the definition, via `SessionHostBuilder::agent_definition`, so the
fixture is its own catalogue. Scope is `Wildcard` rather than a named list:
these tests assert what `suppress_tools` does to the session's own belt, so
the authority must not narrow it, and `Named` silently drops any name missing
from the parent registry — a renamed tool would become an empty toolbelt and
a confusing failure two asserts later.

Two of the four now pass and are un-quarantined:

  suppress_active_goal_keeps_the_thread_goal_out_of_the_prompt
  thread_goal_complete_and_clear_stop_the_goal_reaching_later_turns

The other two still fail, so they stay quarantined — but their markers no
longer blame the authority, which is no longer what blocks them:

  suppress_transcript_autoload_... fails in its own CONTROL: a fresh agent
  does not auto-load the prior transcript by agent name on the hosted path,
  so the test cannot prove the override prevents anything. Not isolated:
  either `auto_save` no longer writes where `latest_for_agent` looks, or the
  lookup key moved with the stamped session id.

  turn_overrides_apply_to_exactly_one_turn_and_then_reset: turn 2 sets no
  overrides and must carry the belt, but the upstream request's tool schema
  is empty. Ruled out: `ToolScope` — `Named` and `Wildcard` behave the same.
  Turn 1's assertion cannot tell a suppressed belt from one that never
  arrives, so the open question is whether `suppress_tools` leaks past its
  one turn or the belt never reaches the model here at all.

Verified as CI runs it (`cargo test -p openhuman-cli --test
agent_turn_overrides_e2e`): 2 passed, 0 failed, 2 ignored.
@M3gA-Mind
M3gA-Mind requested a review from a team September 24, 2026 17:41
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 3ec51456-9fd8-49a6-887a-aed9d93e8325

📥 Commits

Reviewing files that changed from the base of the PR and between 7f50175 and cd90e69.

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

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


📝 Walkthrough

Walkthrough

The E2E fixture now registers and supplies a hosted orchestrator definition. The active-goal suppression and terminal-goal API tests are enabled. The transcript-autoload and one-turn-reset tests remain ignored with updated TODO notes.

Changes

Hosted agent turn override tests

Layer / File(s) Summary
Register hosted fixture definition
tests/agent_turn_overrides_e2e.rs
The fixture clones the built-in orchestrator, assigns its ID, allows wildcard tools, clears disallowed tools, and supplies the definition when building agents.
Update goal and transcript test status
tests/agent_turn_overrides_e2e.rs
The active-goal suppression and terminal-goal API tests are enabled. Transcript-autoload suppression and one-turn override reset remain ignored with updated TODO notes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: senamakel

Merge Risk: ⚪ Minimal · up to cd90e

The hosted fixture enables two goal tests while leaving the two tests with known blockers ignored. No merge-blocking issue is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 1 files. 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 describes the main change: adding a hosted root authority to the agent turn-overrides test fixture.
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.
  • Fix all pre-merge checks with AI

A rabbit checks the hosted gate,
Two goal tests now participate.
Two TODOs note what still won’t run,
The fixture brings its tools along.
Soft paws mark each changed test line,
Then hop away at review time.

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

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

@tinysweeper

tinysweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper reviewed this change across 6 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below.

State: Ready for maintainer review
Priority: none
Reviewed head: cd90e699eb2d
Updated: 1790272530 (Unix time)

Review snapshot

Change surface Files Review signal Count
Production 0 Active findings 0
Tests 1 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

The review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below.

Features

None identified with supported citations.

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

No active actionable findings.

Before merge

None.

How this fits together

flowchart LR
  n0["agent_with<br/>changed"]:::changed
  n1["...s_the_thread_goal_out_of_the_prompt_inner<br/>changed"]:::changed
  n2["..._to_exactly_one_turn_and_then_reset_inner<br/>changed"]:::changed
  n3["vec"]:::impacted
  n4["..._stop_the_goal_reaching_later_turns_inner"]:::impacted
  n5["...t_replay_a_prior_threads_transcript_inner"]:::impacted
  n6["...vious_handle_and_joins_successfully_inner"]:::impacted
  n7["context_config"]:::impacted
  n8["event_context"]:::impacted
  n0 -->|calls| n7
  n0 -->|tests| n7
  n0 -->|calls| n8
  n0 -->|tests| n8
  n1 -->|calls| n0
  n1 -->|calls| n3
  n1 -->|tests| n3
  n2 -->|calls| n0
  n2 -->|calls| n3
  n2 -->|tests| n3
  n4 -->|calls| n0
  n4 -->|calls| n3
  n4 -->|tests| n3
  n5 -->|calls| n0
  n5 -->|calls| n3
  n5 -->|tests| n3
  n6 -->|calls| n3
  n6 -->|tests| n3
  n6 -->|calls| n7
  n6 -->|tests| n7
  n6 -->|calls| n8
  n6 -->|tests| n8
  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
Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The change supplies the hosted root definition required by the enabled goal tests and keeps the transcript/tool-reset cases quarantined with explicit reasons. The fixture changes look safe to merge. _The code index is behind this pull request (indexed at `b17623827a7a`), so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The change supplies a session-owned hosted definition and removes the obsolete ignore from the tests that now exercise it. The remaining quarantined tests document unresolved hosted-path behavior rather than introducing a production security change; this test-only change looks safe to merge. _The code index is behind this pull request (indexed at `b17623827a7a`), so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._

tests

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: No behavioural change: nothing outside documentation, configuration and tests.

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Test-only change: adds a hosted root authority definition to the `turn_overrides_e2e` fixture so sessions can resolve their agent id, and re-enables two previously quarantined tests. The remaining two tests stay quarantined with updated markers describing the actual unresolved issues. No product code is touched. The diff looks sound and follows the project's testing patterns. _The code index is behind this pull request (indexed at `b17623827a7a`), so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._

e2e

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: No behavioural change: nothing outside documentation, configuration and tests.
Evidence and run details
  • Models: ladder/vectors, gpt-5.6-luna, deepseek-v4-flash
  • Spend: $0.001965
  • Tokens: 72012 input · 6908 output · 8422 cached · 549 embedding
Head State Pass summary
cd90e699eb2d ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 1790272530)

tinysweeper 0.1.0

@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.0020 · 72,012 in / 6,908 out · 8,422 cached (12%) · ladder/vectors, gpt-5.6-luna, deepseek-v4-flash · 549 embedded
critique:    $0.0008 · 31,334 in / 1,091 out · 2,029 cached (6%)  · gpt-5.6-luna
security:    $0.0008 · 30,846 in / 530 out   · 1,785 cached (6%)  · gpt-5.6-luna
description: $0.0001 · 6,291 in  / 1,353 out · 1,536 cached (24%) · deepseek-v4-flash

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Sep 24, 2026
@senamakel
senamakel merged commit f7abe91 into tinyhumansai:main Sep 25, 2026
41 of 43 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.

2 participants