Skip to content

Test context bridge parser regressions#72

Merged
TraderSamwise merged 2 commits into
masterfrom
test/chat-parser-snapshot-regressions
Jun 6, 2026
Merged

Test context bridge parser regressions#72
TraderSamwise merged 2 commits into
masterfrom
test/chat-parser-snapshot-regressions

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add context bridge regression coverage for mined parser fixtures.
  • Ensure Codex startup suggestion loops do not become response history turns.
  • Ensure Claude tool/action rows stay out of captured response history while real responses still append.

Verification

  • /Users/sam/cs/aimux/node_modules/.bin/vitest run src/context/context-bridge.test.ts src/agent-output-parser-fixtures.test.ts
  • /Users/sam/cs/aimux/node_modules/.bin/tsc --noEmit
  • PATH=/Users/sam/cs/aimux/node_modules/.bin:$PATH yarn lint
  • PATH=/Users/sam/cs/aimux/node_modules/.bin:$PATH yarn test

Summary by CodeRabbit

  • Tests
    • Added and refined parser fixture utilities to simplify test inputs.
    • Expanded continuity tests to validate response capture excludes extraneous tool/output rows and correctly records single responses.
    • Adjusted parser fixtures used in tests to cover varied live-output scenarios.

Note: Internal testing improvements only; no user-visible changes.

@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jun 6, 2026 9:39am

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Too much diff to scan? Review this PR in Change Stack to start with the highest-impact changes.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1de618b1-29b7-45b5-aac5-a247bdffa793

📥 Commits

Reviewing files that changed from the base of the PR and between 369f149 and 190d9be.

📒 Files selected for processing (3)
  • src/agent-output-parser-harness.test.ts
  • src/agent-output-parser-test-utils.ts
  • src/context/context-bridge.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/context/context-bridge.test.ts

📝 Walkthrough

Walkthrough

Adds a shared parser-fixture helper and updates tests to use named fixtures; introduces two ContextWatcher tests validating that Codex startup suggestion loops are not recorded and Claude tool-action rows are excluded from captured response turns.

Changes

ContextWatcher response exclusion tests

Layer / File(s) Summary
Parser fixture helper
src/agent-output-parser-test-utils.ts
Adds exported getParserFixture(name) that looks up fixtures in AGENT_OUTPUT_PARSER_FIXTURES and throws if missing.
Test harness updates
src/agent-output-parser-harness.test.ts
Replaces prior fixture helper usage with getParserFixture(...) and updates fixture identifiers used by two harness tests.
ContextWatcher tmux continuity tests
src/context/context-bridge.test.ts
Imports getParserFixture and adds two tests: one feeding codex-live-startup-suggestion-loop asserting empty readHistory, and one feeding claude-live-tool-action-rows asserting a single response turn whose content excludes multiple tool-action substrings.

Sequence Diagram(s)

sequenceDiagram
  participant Test
  participant getParserFixture
  participant ContextWatcher
  participant Assertion
  Test->>getParserFixture: fetch fixture by name
  getParserFixture->>Test: return raw fixture output
  Test->>ContextWatcher: feed raw output to capture
  ContextWatcher->>Assertion: provide readHistory for session
  Assertion->>Test: verify recorded turns / exclusions
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • TraderSamwise/aimux#69: Introduced a similar switch to using a shared getParserFixture(...) helper in parser harness tests.
  • TraderSamwise/aimux#71: Adds or exercises the same mined live-pane fixtures (codex-live-startup-suggestion-loop, claude-live-tool-action-rows) used by these tests.
  • TraderSamwise/aimux#66: Introduced AGENT_OUTPUT_PARSER_FIXTURES that the new helper and tests rely on.

Poem

🐰 I fetched a fixture, soft and neat,
fed ContextWatcher its mined heartbeat.
Codex loops tucked away, Claude's tools kept from sight —
my rabbit heart nods: the responses are right. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 accurately summarizes the main objective of the PR: adding regression test coverage for the context bridge parser using mined fixtures.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/chat-parser-snapshot-regressions

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/context/context-bridge.test.ts`:
- Around line 20-24: Extract the duplicated parserFixture logic into a shared
test utility function (e.g., getParserFixture in a new fixture-helpers module)
that imports AGENT_OUTPUT_PARSER_FIXTURES and performs the same find/throw
behavior, then replace the local parserFixture implementation in both
context-bridge.test.ts (parserFixture) and agent-output-parser-harness.test.ts
with an import of the shared getParserFixture; ensure the error message and
behavior remain identical so tests keep the same semantics.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e6a1997f-94b5-441b-9a52-108d7b8d3766

📥 Commits

Reviewing files that changed from the base of the PR and between 1a9c23b and 369f149.

📒 Files selected for processing (1)
  • src/context/context-bridge.test.ts

Comment thread src/context/context-bridge.test.ts Outdated
@TraderSamwise
TraderSamwise merged commit b3097e9 into master Jun 6, 2026
3 checks passed
@TraderSamwise
TraderSamwise deleted the test/chat-parser-snapshot-regressions branch June 6, 2026 09:41
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.

1 participant