Skip to content

test(coding-agent): consolidate session integration coverage - #499

Merged
snimu merged 2 commits into
mainfrom
test/consolidate-session-integration
Jul 22, 2026
Merged

snimu merged 2 commits into
mainfrom
test/consolidate-session-integration

Conversation

@snimu

@snimu snimu commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Why

Three older AgentSession files either rebuilt their own lower-level harness or used credential-gated provider calls that are skipped in required CI. The current deterministic suite harness already covers the broader retry, runtime, and compaction lifecycles.

What changes

  • moves the exact transient-provider error classification table into the current retry integration suite
  • adds one deterministic middle-conversation fork scenario covering selection metadata and retained history
  • adds one deterministic normal-summarizer compaction scenario covering events, persisted metadata, rewritten context, and post-compaction usability
  • removes the three older retry, branching, and compaction files

Coverage and cost

Unique assertions were moved before deletion; existing broader lifecycle tests remain unchanged.

Focused added coverage:

  • six retry classification cases: 27 ms
  • middle-prompt runtime fork: 290 ms
  • normal-summarizer compaction lifecycle: 155 ms
  • npm run check

The previous retry file took 38 ms for seven tests. The branching and compaction files were credential-gated and all eight tests were skipped in normal CI. Net reduction: 544 lines.


Note

Low Risk
Test-only refactor with no production code changes; minor risk that a dropped assertion (e.g. persistent content_filter retry cap) is no longer explicitly covered if not duplicated elsewhere.

Overview
Consolidates AgentSession integration coverage into the existing test/suite harness so CI no longer depends on API-key-gated real LLM runs or one-off runtime setup.

Deletes standalone agent-session-branching, agent-session-compaction, and agent-session-retry test files (~645 lines) and adds targeted cases to agent-session-retry-events, agent-session-compaction, and agent-session-runtime: a parameterized table of six transient provider error strings that should auto-retry; a full manual compaction path through the model summarizer (persisted compaction entry, compaction_start/compaction_end, post-compaction prompt); and fork scenarios for middle-of-thread history plus in-memory first-prompt forks with selectedText metadata.

Refactors runtime suite setup with an inMemory option on createRuntimeForTest, reusing it for the in-memory fork-at-position test instead of duplicating faux/runtime boilerplate.

Reviewed by Cursor Bugbot for commit 84b6a6c. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Consolidate AgentSession integration tests into suite directory

  • Removes three standalone test files (agent-session-branching.test.ts, agent-session-compaction.test.ts, agent-session-retry.test.ts) and replaces them with consolidated coverage under test/suite/
  • Adds compaction characterization tests verifying model-generated summaries, persistence, emitted events, and session reusability after compaction
  • Adds parameterized retry tests covering network errors, content-filter, empty responses, and policy flags, asserting correct retry events and state
  • Extends forking tests in agent-session-runtime.test.ts to cover forking before a middle prompt (with persistence) and before the first prompt in-memory, and refactors existing in-memory fork test to use the shared createRuntimeForTest helper

Macroscope summarized 84b6a6c.

@snimu
snimu merged commit 43738d5 into main Jul 22, 2026
11 checks passed
@kevinjosethomas
kevinjosethomas deleted the test/consolidate-session-integration branch July 24, 2026 20:00
zhengr pushed a commit to zhengr/prime-agent that referenced this pull request Aug 8, 2026
…tellect-ai#499)

* test(coding-agent): consolidate session integration coverage

* test(coding-agent): preserve consolidated coverage

fixes PrimeIntellect-ai#499

---------

Co-authored-by: Kevin Thomas <kevin.jt2007@gmail.com>
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.

2 participants