openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Update glm_style streaming coverage test to the on_progress contract (on_delta retired)

Open oxoxDev opened this issue 5 months ago • 1 comments

Context

Follow-up split out of the #4261 (agent_graph) regression repair in PR #4372.

The raw-coverage test glm_style_tool_call_executes_then_final_streams_in_chunks_and_progress (tests/agent_turn_toolloop_round22_raw_coverage_e2e.rs) asserts streaming via the retired on_delta Sender<String> channel. That channel was intentionally superseded by on_progress text deltas (src/openhuman/agent/bus.rs — on_delta is "intentionally unused"), so the deltas.len() >= 2 assertion (:328) can never fire.

What is already fixed in #4372

The other two assertions in this test are product regressions and are fixed:

  • :256 — varied-failure no-progress backstop ("N tool calls in a row failed").
  • :286 — hard-policy repeat halt ("blocked by the security policy … re-issued").

What remains (this issue)

Update the streaming assertions to the on_progress contract:

  • Replace the on_delta chunk-count assertion with an AgentProgress::TextDelta count on on_progress.
  • Verify the per-iteration delta attribution the bridge now produces (the existing TextDelta { iteration: 1, delta: "draft from provider" } expectation at :339/:355 needs to match what the tinyagents event bridge actually emits — confirm the iteration cursor value, don't assume).

This is a test-update to a deliberately-changed contract, not a product regression — verify the bridge's real emission before rewriting the assertions (do not weaken).

Acceptance

GGML_NATIVE=OFF cargo test --test agent_turn_toolloop_round22_raw_coverage_e2e -p openhuman is green (currently 1 failing test: glm_style_…).

Refs: #4261, #4372.

oxoxDev avatar Jul 01 '26 13:07 oxoxDev

Already resolved by #4372 (commit 4c98a3100).

That PR did not defer the streaming assertions — the same commit rewrote them to the on_progress contract:

  • dropped the retired-on_delta deltas.len() >= 2 check
  • added on_delta_chunks.is_empty() (retired channel stays empty)
  • added an AgentProgress::TextDelta count on on_progress (text_deltas >= 2)
  • kept the per-iteration attribution TextDelta { iteration: 1, delta: "draft from provider" }

Acceptance criteria verified green on current main:

GGML_NATIVE=OFF cargo test --test agent_turn_toolloop_round22_raw_coverage_e2e -p openhuman
test result: ok. 3 passed; 0 failed

No product regression and no remaining work — closing as completed by #4372.

oxoxDev avatar Jul 02 '26 08:07 oxoxDev