R4 review P2-6: moving the Copilot ACP provider out of core deleted the e2e
and unit tests that guarded the public agent.acp_client.ACPClient base
(permission never granted, fs reads confined to cwd + redacted, no agent
process outliving the CLI, per-session process reaping, tool-call round
trip, compaction, retry semantics, long-reasoning progress).
Re-home them in core against a vendor-neutral fake ACP agent
(tests/fakes/providers/fake_acp_agent.py) and a generic `fake-acp`
external_process user plugin written into the temp HERMES_HOME, with the
same assertions as the deleted tests. Known open gaps stay xfail behind
their existing KnownSymptom gates (#65788, #120550, #101507, #121290).
Red proof: breaking each invariant in agent/acp_client.py (auto-grant
permission, drop cwd confinement, drop redaction, no-op terminate, reap a
sibling's process, drop tool extraction, crash-as-timeout, ...) turns the
matching tests red.
Delete the in-tree model-provider plugins plugins/model-providers/copilot/
(provider `copilot`: Copilot API via the GitHub->Copilot token exchange) and
plugins/model-providers/copilot-acp/ (provider `copilot-acp`: Copilot CLI over
ACP). Both ship as ONE plugin, `github-copilot`, in
NousResearch/hermes-labs-plugins; the LEFT_CORE row added before this commit
installs it for every profile that routes through copilot/copilot-acp, and
every "unknown provider" surface names `hermes plugins install
github-copilot`. Core keeps no Copilot code: the generic seams the plugins
fill stay, and agent/copilot_acp_client.py stays as the deprecated alias the
kimchi-acp catalog plugin subclasses (agent.acp_client.ACPClient is the
public base). This commit is revertible on its own: reverting it restores the
bundled providers (the labs plugin stays inert on a core that bundles them).
Test files that only tested the plugins move to the labs plugin's tests:
tests/plugins/model_providers/test_copilot_acp_client.py
tests/plugins/model_providers/test_copilot_acp_deprecation.py
tests/plugins/model_providers/test_copilot_auth.py
tests/plugins/model_providers/test_copilot_catalog_oauth_fallback.py
tests/plugins/model_providers/test_copilot_context.py
tests/plugins/model_providers/test_copilot_custom_model_ids.py
tests/plugins/model_providers/test_copilot_hosts.py
tests/plugins/model_providers/test_copilot_pool_exchange.py
tests/plugins/model_providers/test_copilot_profile.py
tests/plugins/model_providers/test_copilot_refresh_notice.py
tests/plugins/model_providers/test_copilot_setup.py
tests/plugins/model_providers/test_copilot_token_exchange.py
tests/agent/test_copilot_initiator.py
tests/agent/test_copilot_native_vision_headers.py
tests/hermes_cli/test_copilot_in_model_list.py
tests/hermes_cli/test_copilot_model_api_mode.py
tests/hermes_cli/test_copilot_runtime_api_mode.py
tests/hermes_cli/test_copilot_runtime_api_mode_stale.py
tests/hermes_cli/test_model_switch_copilot_api_mode.py
tests/e2e/core/providers/test_native_copilot_acp.py
tests/e2e/core/providers/test_native_copilot_acp_errors.py
tests/e2e/core/providers/test_native_copilot_acp_streaming.py
tests/fakes/providers/copilot_acp.py
Copilot-behaviour cases extracted from generic test files (same move):
test_credential_pool (Copilot pool seeding / gh / env suppression),
test_reasoning_carriers (Copilot carriers), test_run_agent (Copilot gpt-5
reasoning, xhigh), test_run_agent_codex_responses (Copilot 401 refresh),
test_codex_transport (Copilot reasoning), test_auxiliary_main_first (vision
headers), test_private_credential_writers (JWT store row),
test_provider_client_seam (copilot-acp client), test_provider_wire_snapshot
+ its fixture (copilot / github-models cells), test_api_key_providers,
test_auth_commands, test_credential_pool_off_loop (exchange single-flight),
test_external_process_auth_status (Copilot CLI token stores),
test_external_process_provider_seam, test_model_cache_fallback_rows,
test_model_validation, test_models_relay_base_url (copilot row),
test_multiplex_cli_cache_scope, test_provider_catalog, test_cold_start_gil_stall.
Tests that used Copilot only as an example provider now use a fake
ProviderProfile (or another in-tree provider) with the same assertions:
test_auxiliary_client, test_auxiliary_named_custom_providers,
test_init_fallback_on_exhausted_pool, test_intent_ack_continuation,
test_models_dev, test_turn_retry_state, test_one_turn_route_publish,
test_mcp_catalog_env_boundary, test_plugin_provider_picker_residue,
test_delegate_external_provider, test_delegation_profile_route,
test_overlay_slug_resolution, test_installed_plugin_discovery, plus the
generic halves of test_run_agent_codex_responses, test_codex_transport,
test_api_key_providers, test_external_process_auth_status and
test_model_cache_fallback_rows.
Two more ways a held turn (hold_stream=True transform_llm_output) left history
out of step with what the user got:
- When verify-on-stop or pre_verify sent the answer back on the last allowed
call, _append_interim_answer had already flushed it as a hidden row. The
finalizer reused it as the budget fallback and transformed it, but the row
was settled: _store_rewrite_on_tail skipped it and _close_transcript_tail
added nothing (the tail already held assistant text), so reopening the
session lost the reply. A held turn's sent-back answer now flushes with the
turn instead of at once (the user never saw it), and when the turn ends on
it _store_rewrite_on_tail publishes that row: visible, content = the
rewrite, api_content = the bytes the model wrote and already saw, so the
wire and the cached prefix stay unchanged. One row, so role alternation
holds.
- A codex_responses reply can carry commentary and the final answer in
codex_message_items. Publishing the held final unhid the whole row, and
project_history_commentary rebuilt display_commentary from those items on
reload. publish_held_final_row now stamps display_metadata
commentary_withheld on such a row; the projection then shows no
commentary for it, while the items stay for model replay.
Also: the plugin-reload hold test waited 0.5 s for a negative check; it now
signals that the read started and waits 2 s (tests/AGENTS.md).
Tests (red on 72fd611fef): a pre_verify fallback ending a held turn (history
shows the rewrite, the resumed request replays the original bytes), and a
held codex_responses final with a commentary item (FakeResponsesServer
Message gains an optional phase).
Review: https://github.com/NousResearch/hermes-agent/pull/144266#discussion_r4370905634
Review: https://github.com/NousResearch/hermes-agent/pull/144266#discussion_r4370905635
Review: https://github.com/NousResearch/hermes-agent/pull/144266#discussion_r4370905636
When a plugin loaded in the session's profile registered transform_llm_output
with hold_stream=True, the reply is not streamed on any surface:
- agent: no text delta, post-tool-call text or interim commentary leaves the
agent's display/TTS callbacks for the turn (resolved per turn), so messaging,
local viewers (TUI, Desktop, classic CLI, ACP), the API server and managed
workers all fall through to their existing "nothing streamed" path and
deliver the rewritten final once.
- gateway: TurnRunner builds no stream consumer for a held turn, so no draft,
edit, native stream frame (WeCom's empty seed + closing frame) or commentary
bubble is sent; the final is one plain send (split like any long reply) while
the typing indicator runs.
Commentary is model text the hook never sees, so a held turn drops it; tool
progress and reasoning keep their own display settings.
openai 2.54.0 (128b101efd) made InputTokensDetails.cache_write_tokens a
required field. The fake Responses server builds its usage block from the
SDK's pydantic types, so every response.completed raised ValidationError in
the server thread, the socket closed mid-stream, and the Hermes child saw
APIConnectionError: oneshots retried until the 150 s timeout, the
rejected-replay cases fell through to the fallback, and the TUI gateway
turn never finished.
Turn gains cache_write_tokens (default 0) and the fake emits it, matching
the current Responses wire.
FakeIdP can serve https with a throwaway CA (make_test_ca gains IP SANs) and bind a fixed
address, so the https-only rule is exercised for real; the fake browser runs in its own thread
like a real one. Folds the auth_commands routing test into the lifecycle test and the two re-pin
delta tests into one. New invariants, red on the PR head: errors reach the plugin without a
credential, a revoked grant keeps no tokens, uninstall drops the grant, unattended sign-in is
refused, http/loopback endpoints and Hermes-owned client variables fail validation.
An attempt claimed before or in the same second as another run's output
doc (a manual `hermes cron run` overlapping a tick) became the doc's
newest candidate. When it failed without a session, the doc rendered as
an extra cron_output row with that attempt's status, and the attempt's
own failed row stayed hidden because representation was decided before
reconciliation.
_list_cron_output_runs now returns docs and terminal ledger attempts
separately; _reconcile_cron_runs pairs each doc with its likeliest
writer once every attempt's session is known (an attempt closed before
the doc only reaches it through the grace; one whose session spans the
doc beats an overlapping one without; then the newest claim), so each
attempt gets exactly one row: its session, else its doc, else its
ledger row. The internal _execution_candidates/_execution_id row keys
are gone.
Also: the cron request partial index is built from CRON_PRINCIPAL_ID;
the admission SQL derives its substr offsets from CRON_REQUEST_PREFIX;
a prefix_range() helper replaces three hand-rolled half-open bounds;
the two cron run-history suites share tests/fakes/cron_owner.py.
Refs #134889 (CRON-1)
Refs #139162
Refs #138812
Addresses review by @kshitijk4poor on #139273.
17 conflicts, all from main's lint sweep (ruff UP007/UP017/UP022/UP028/UP031/UP037/UP041,
FURB188/FURB192); no other main commit touches a conflicted file. Resolution: the branch side
of each file plus main's exact autofix (ruff 0.15.10, main's ruff.strict.toml, --fix
--unsafe-fixes). ruff.strict.toml takes main's copy. The pool-retirement live fixture stays
deleted with the pooled backend this branch retires.
8 conflicts, all from main's lint sweep (#135281 "Harder linter fixes" + the RUF series:
implicit-Optional, unused-unpacked-variable, next(...) for [...][0]). No other main commit touches
a conflicted file. Resolution: the branch side of each file plus main's exact autofix
(ruff 0.15.10, main's ruff.strict.toml, --fix --unsafe-fixes) on it. ruff.strict.toml takes main's
copy (the newly enabled rules). tests/cron/test_bot_chat_delivery_child_env.py stays deleted
(1cc9cb9199 retired its lane).
45 conflicts, all from #135177 (lefthook + `ruff check --fix` over 2,366 files). No other main commit
touches a conflicted file. Resolution: the branch side of each file, then main's exact autofix
(ruff 0.15.10, `--config ./ruff.strict.toml --fix`) on it — rewrites only (typing generics, noqa
drops, import forms), no import removed. tests/cron/test_bot_chat_cli_home.py stays deleted
(1cc9cb9199 retired its lane).
The Windows crash cells share one FakeLLMServer whose script is FIFO. When
a launch is refused before reaching the provider (mid_fetch, handoff), its
pushed reply stays queued and answers the NEXT cell's prompt, so every later
cell printed the previous cell's REPLY id and failed "ran no turn" although
its turn ran (tree_moved, orphaned_update, mid_git, mid_git_bootstrap on
326aacfbcf: prompt reached provider=True, reply printed=<earlier id>).
one_shot_turn now drops unconsumed script entries before pushing its own.
(cherry picked from commit d485643808cb1f5ea34a841f33d0b3d74cf11abb)
12 conflicted files, resolved in three lanes:
- gateway/run.py: take the branch split; main's tirith removal and spool-replay
ordering ported into run_runtime_init.py / run_bootstrap.py.
- config migrations: main keeps v50 (tirith); the branch's bot-chat timeout removal
becomes v51 (_config_version 51, template + test updated).
- hermes_state_usage.py: main's voice_chat task route threaded through the branch's
owner transaction; worker.persist usage allowlist accepts task.
- tui_gateway/server.py: branch side; main's edits applied where the code now lives
(agent_factory, session_registry). Desktop sessions get the catalog toolset on the
authority path; daemon-run finite CLI turns are not watched turns; lazy session info
reports nous/welcome on the free tier.
- Desktop/Ink: one branch-child spinner fix (main's route-token check); main's
uninstall i18n keys kept, pool keys stay removed; voice_turn forwarded and accepted
by the authority submit (surface_v1.voice_turn).
- chat_ws / PTY keepalive test: main's stricter test kept.
#134320 registered ProviderProfiles for lmstudio and tencent-tokenhub without env_vars. That put
both into the provider-catalog E2E matrix for the first time with key_env=None. The shard fixture
then died on keys[""] (KeyError, every row of the shard errored), TokenHub turns could not find a
key, and LM Studio's /model switch could not reach the native /api/v1/models listing the fake
never served.
The profiles now name the same env vars their hermes_cli/auth.py registry rows use (that row stays
the lookup source of truth). The catalog fake also answers LM Studio's native listing.
Since #133571 (b5025017d5, teknium1, 2026-10-05) a shared-metrics "No thanks" without
`offer_version` reads as `reask` and the interactive CLI/TUI offers the prompt once more. The
fake-provider home every e2e suite builds (`write_hermes_home`) wrote exactly that shape
(`enabled: false` only), so every PTY/tmux scenario now opens on the consent picker, never
reaches its ready status bar and times out: 61 failures in the e2e lane, the Windows unicode
CLI test, and the e2e-upgrade interactive-CLI entrypoint on main since the merge.
The fixture now records a complete current answer (`send: false`, `offer_version` imported
from the consent module so the next version bump cannot strand it again).
An interactive chat on an undecided profile now stops on the one-time
offer; the shared e2e home writer records an answer like a real user
who already decided, so PTY/console drivers reach the composer.
An interactive `hermes --tui` attached to the gateway lost the codex
app-server's commentary AND final answer whenever an agentMessage reached
item/completed without item/agentMessage/delta frames: the screen showed
the tool card and nothing else.
Root cause: the codex bridge hands every completed agentMessage to the
interim-commentary callback. With no deltas it arrives already_streamed=False,
goes to the stream consumer, and on the local route lands in
LocalSessionAdapter.send, which publishes nothing yet reports success. The
consumer records the text as delivered, the final send is suppressed
("Suppressing normal final send ... streamed=True") and message.complete
carries "". When codex does stream deltas the viewer already has the text
via message.delta, so the common case rendered fine.
Fix: on the local viewer route, unstreamed commentary is published as
message.interim (the contract the in-process tui_gateway already emits and
both the TUI and Desktop render), and it is handed to the consumer's
delivery accounting only when a viewer/observer actually took it.
Messaging platforms and already-streamed commentary are unchanged.
Test: tests/e2e/core/providers/test_native_codex_app_server_tui.py drives a
real `hermes --tui` on a PTY against the fake codex app-server with
deltas disabled (new `deltas: False` message-step option); red before
(final on screen 0x), green after. PtyHermes accepts llm=None for a home
the caller already wrote.
(cherry picked from commit c323f548e8f4ec57a9587635ca943defe5beaaba)
- KNOWN cells use tests.e2e.core._pending_fixes.known_failure (Rig.gate) around the final
assertions only; no strict xfail (merge-order safe)
- streaming scenarios: private chat per scenario (Rig.fresh_user), same-chat barrier re-sent
when dropped in the #121393 window; wait_idle docstring corrected; TURN_TIMEOUT 90->30
- stream_finalize_rejected now faults the real finalize per transport (Telegram draft final
sendMessage / group editMessageText, Slack closing appendStream/stopStream, Discord edit) and
asserts the fault fired; + stream_finalize_rejected_group, stream_reply_once
- Telegram stand-in: sendMessageDraft/sendRichMessageDraft, unknown methods 404, empty/too-long
text and MarkdownV2 parse errors; Slack unknown_method + users.conversations; Discord empty
content 50006, handler 4xx recorded as faulted
- approval_click: stranger clicks Deny and must be refused (answered) before the owner approves
- redelivery_one_reply asserts the inbound reached the transcript once
- dm_one_reply asserts no formatting rejection (plain-text fallback) for a punctuated reply
- rig: model.supports_vision so the heic control PNG reaches the model as an image
- Slack stream_finalize_rejected(_group) KNOWN #95430 (partial stream left beside re-post)
Local stand-ins implement only the endpoints the real adapters call, reached through each
SDK's own base URL (PTB base_url; discord.py Route.BASE + DEFAULT_GATEWAY and slack_sdk
base_url via sitecustomize shims), recording every call and accepting per-method faults.
Review fixes on the provider-catalog matrix:
- KNOWN bugs go through tests.e2e.core._pending_fixes.known_failure again (strict_known and the
"now green -> drop KNOWN" asserts are gone), so a fix PR landing first simply turns its cells
green. Each KNOWN is gated on the bug's OWN observed signature via a dedicated CatalogGap raised
only at the gated assertion: xai = no inference at the fake + api.x.ai CONNECT; listing = vendor
host hit with no probe error; nebius switch = vendor-host validation error; fallback = fallback
fake untouched + its vendor host CONNECTed; OAuth patterns anchored. Unlisted red cells still fail.
- CatalogFake answers only exact routes (configured base path + dialect endpoint / listing path),
404 otherwise; reached_own_endpoint and the listing cells assert the exact path.
- Turns run with agent.auto_recovery_cycles: 0 (the documented post-exhaustion ladder parked the
xai/fallback rows for minutes: 14 CONNECTs over 118 s, bounded by design, not a retry bug) and a
watchdog kills a child 8 s after a vendor-host CONNECT with no inference at its fake.
- An unknown api_mode fails the row instead of skipping; only explicit auth types and the named
keyless provider skip.
- Usage cell asserts the exact sum the fake reported for answered main-turn calls.
- Listing 404 / hang degradation cells for the rows that already list from the configured endpoint.
- Shard body moved into the helper; fallback key check uses the dialect's auth header; the three
unconditional-skip OAuth params dropped (kept under NOT COVERED).
Review fixes for #121345.
- Every strict xfail in tests/e2e/core/providers now uses raises=KnownSymptom (a shared
AssertionError subclass in _native_helpers) and raises it only at the tracked bug's
symptom. Preconditions (exit codes, request counts, the approval exchange, the
descendant pid) are plain asserts, so harness failures - StopIteration from next(...),
tuple-unpack errors, process death, fixture teardown errors - fail for real instead of
counting as the known bug. pytest applies xfail to setup/teardown reports too; the
codex faults file's "5 xfailed" for 4 xfail tests was the teardown error being eaten.
Verified with --runxfail: all 19 KNOWN cells fail with KnownSymptom.
- Codex fake: the own-session grandchild (#121298) now lives until CodexRun.cleanup()
drops a release file, so teardown retires the orphan without signalling a process that
was reparented to init (the live-system guard blocked that kill and leaked a
sleep(600) per run on dev boxes). Both codex modules carry live_system_guard_bypass
for the SIGKILL fallback, matching tests/agent/test_shell_hooks_tree_kill.py.
- Copilot ACP resume test no longer asserts session/load is never sent (not a documented
contract); it keeps the new-agent-process, in-order history and no-duplicate asserts.
- Copilot teardowns tolerate a pid exiting between the liveness check and the kill.
Summarizer runs through the ACP agent itself; the post-compaction prompt must carry the summary, the
user's ask and the latest tool result, drop the summarized tool output, and pass schema validation.
The request TypeAdapter accepts replayed assistant blocks through the SDK's
response BaseModels (ThinkingBlock, ToolUseBlock, TextBlock), which allow
extra keys, and the unknown-key walk stopped at a BaseModel. A bogus key on a
replayed thinking block therefore reached the wire with schema_errors() == []
while the real API answers 400 "Extra inputs are not permitted".
validate_request now re-validates every messages[].content[] and system[]
block against the request-side *Param TypedDict picked by its type literal
(derived from the SDK's MessageParam / BetaMessageParam content union) and
diffs the sent keys. test_anthropic_oracle.py proves it can fail: bogus keys
in assistant thinking/text/tool_use, user tool_result and system blocks are
reported (GA + beta), a response-only type is rejected, a clean body is [].
Also: records carry bearer/x_api_key, cassette_dir override, and a cheap
record-mode probe against a second local fake (cassette written, no auth
header values in it).
Review findings on the OpenAI provider suite, fixed in place:
- Pricing decoy now takes the custom:<key> slug path: a relay keyed `deepseek`
(a built-in, non-aggregator name) renders as `custom:deepseek`, so mapping any
custom*-normalized slug to the aggregator in get_pricing_for_provider now turns
the decoy red ("custom:deepseek (upstream: the relay) borrowed prices"). The old
`myrelay`-only decoy stayed green under that sabotage.
- Ollama strict-endpoint test fails in ~30 s naming the requests that lost the
user turn, instead of a 150 s subprocess timeout: auto_recovery_cycles is 0 for
this test (a 500 is a transient outage to Hermes, retried for minutes by design),
each turn is bounded, and the recorded-requests assertion runs before a harness
overrun is re-raised.
- Responses dialect faults the fake already supported are now exercised: a stream
that dies mid-function_call (half arguments, no terminal event) and a 429 with
Retry-After. Unused fake branches deleted (Cassette replay + record mode, push(),
CStreamError.partial_text, the `reasoning` delta alias).
- Fallback test runs 2 turns and asserts the fallback request carries the system
prompt, turn 1's prompt and answer, and turn 2's prompt, equal to what the
primary was last asked.
- KNOWN hygiene: strict xfails accept only KnownBugError, raised solely from
bug_assertions() around each known bug's final assertions; TuiGateway call/
wait_event/turn, wait_until and bounded_turn raise HarnessError (RuntimeError),
so a harness break inside a KNOWN test is a real failure, not an xfail.
- The sitecustomize vendor-boundary shims chain-import the interpreter's original
sitecustomize instead of shadowing it.
Class C11 (provider/model routing + credential resolution). One real
loopback OpenAI-compatible host per provider identity, each accepting only
its own key; every scenario configures all identities and only changes the
selection, and one invariant runs after every leg: requests land only on the
selected hosts, each with only that host's key, the user sees that host's
answer, and nothing egresses to a real inference API (CONNECT trap).
Real `hermes chat -q` / `hermes -z` subprocesses cover custom base_url
(key_env / literal), bare custom fail-fast, named providers: and legacy
custom_providers entries, startup -m aliases (#103933/#107191/#109440),
fallback after 401/429, credential pool rotation / single-key exhaustion,
per-profile routing, aux title + delegation routing. The real stdio
tui_gateway walks mid-session /model switches incl. pool recovery without
restart.
fake_llm_provider: api_key may be a list of accepted keys (pool on one
host) and opt-in record_get; defaults unchanged.
(cherry picked from commit bf1f07571d7777fe91b16f386e026c12bdbfe73b)
Independent review of #120171 found checks that could not fail. Each is now
proven red by a mutation that the old version reported as XFAIL or pass.
- chaos/test_tui_gateway_turn_liveness: the orphaned-tool xfail used
raises=AssertionError and RpcError subclasses it, so a gateway crash counted
as the expected failure. Every invariant is now asserted normally; only the
known leftovers (surviving tool tree and the tool_call it leaves without a
result, both fixed by #120306) raise ToolOutlivedGateway, the only exception
the xfail accepts. The DB check used to sit behind the orphan assert and
never ran; running it exposed the dangling tool_call half of the same bug.
- history/test_prefix_stability: surface_switch's strict xfail tripped at the
first prefix break, before usage and integrity. Messages/system prompt,
usage and integrity are asserted first; the tools-array drift is checked
last and raises ToolsArrayDrift, the only exception the xfail accepts.
- history/test_transcript_ledger: scripted steer/interrupt callables run on
the fake provider's handler thread, where an assert only dropped the
connection. Script records those failures and the test re-raises them after
every turn; steer must land and the interrupted turn must report
interrupted=True within 30 s.
- fakes/fake_llm_provider: Hang drops the connection at its deadline instead
of leaving a kept-alive client waiting past it.
- parity: the API server port was picked, released, then bound by the child.
Readiness now requires our child's pid from authenticated /health/detailed
and retries on a fresh port when the child reports it in use. The fixture
guard refused any HERMES_HOME under ~/.hermes, failing all parity tests
whenever TMPDIR is Hermes's scratch dir; it now refuses only the live root
or a real profile.
- chaos/_gateway_harness: the gateway stays in pytest's process group, so
the runner's kill of a timed-out file reaches it.
- sqlite: a DELETE-mode open can fail with SQLITE_BUSY reported as "vtable
constructor failed: messages_fts"; the delete arm's busy tolerance keys on
the result code. A failed episode's roles are stopped so the shared chamber
and rig no longer fail every later episode.
- chaos, compaction, parity homes: updates.check=false (history already had
it). The passive update check made a GitHub round-trip from every test
surface, and on a blobless clone whose objects lag upstream its
`git merge-base --is-ancestor <upstream tip> HEAD` starts a lazy fetch that
the 5 s timeout orphans; the orphan scans then failed on git processes.
- chaos/test_agent_turn_liveness: a PROBE failure now carries the provider
call counts and the agent's stale-kill log, so a cross-turn breaker trip
can be told apart from a slow probe.
- tests.yml e2e: HERMES_TEST_FILE_RETRIES=0 so a race detector's red is never
retried into green; own uv cache entry (cache-suffix: e2e).
Class C3 (conversation-history persistence & replay integrity). A real AIAgent + SessionDB
runs a scenario matrix (plain turns, parallel tool batches, /steer mid-turn, interrupt,
stream drop + 500 retry, manual /compress, /compress here N, auto compaction, opt-in
micro-compaction) against the recording fake provider. After EVERY step it asserts:
exactly-once at the storage layer and in the model view, next request replays the
persisted view, nothing the model saw ever leaves the durable/display history, each typed
input shown once, rows monotonic, usage == provider-billed; then a FRESH
'hermes chat --resume' process must replay a byte-identical request prefix.
Red-proofs: reverting 526d135a96 (compress-here tail) and 91df54184d (micro-compaction
rewind flags) and an injected double row insert all go red. A strict xfail documents a live
micro-compaction bug (merged user row duplicates both inputs in the resumed display).
The fake provider now records the usage it billed per request (record['usage']).
Backward compatible: FakeLLMServer(prompt_tokens_fn=...) reports usage.prompt_tokens
computed from each request body (token-driven logic such as compaction triggers sees a
realistic, growing count instead of a constant 100), and Text(finish_reason=...) lets a
scripted reply end with e.g. 'length' (truncated summaries). Defaults are unchanged.
Chaos lane (C8 agent-turn liveness) needs an upstream that opens the SSE
stream and then goes silent without closing, arbitrary malformed bodies,
and truncated/malformed tool-call argument JSON. All additions are new
response types or accept a str where a dict was required, so existing
scripts are unchanged.
One real OpenAI-compatible server (JSON + SSE) that records every request
and scripts tool calls, reasoning, long streams and provider faults, so E2E
tests drive the real client stack instead of mocking the agent loop.
Change-detectors, tautologies, source-reading tests, redundant duplicates,
mock-echo tests and dead/unrunnable tests. Per-test rationale in the lane
ledger (category + reason for every removal).