Skip to content

Test chat transcript parser rendering - #74

Merged
TraderSamwise merged 1 commit into
masterfrom
test/chat-parser-corpus-audit
Jun 6, 2026
Merged

Test chat transcript parser rendering#74
TraderSamwise merged 1 commit into
masterfrom
test/chat-parser-corpus-audit

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • add app transcript conversion regressions for mined Codex suggestion loops
  • verify mined Claude tool/action rows stay out of rendered chat messages
  • cover image prompt rendering after parser classification

Verification

  • app parsed transcript test with app dependency layout
  • app typecheck with app dependency layout
  • app eslint on parsed transcript test
  • tsc --noEmit
  • eslint src/ --max-warnings=0
  • vitest run
  • yarn build

Summary by CodeRabbit

  • Tests
    • Improved test coverage for transcript parsing with fixture-based test cases to ensure correct rendering behavior.

@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 10:12am

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Complex PR? Review this PR in Change Stack to move by importance, not file order.

Review Change Stack

📝 Walkthrough

Walkthrough

This PR enhances test coverage for the parsed transcript module by updating imports and adding fixture-driven test cases that validate the parser correctly filters out non-message content—such as mined Codex startup blocks and Claude tool action rows—from rendered chat output.

Changes

Parser message filtering tests

Layer / File(s) Summary
Import updates and test infrastructure
app/lib/parsed-transcript.test.ts
Direct local imports of ParsedAgentOutput, parseAgentOutput, and getParserFixture replace previous aliased imports, establishing dependencies needed for fixture-driven test patterns.
Fixture-based test cases and helpers
app/lib/parsed-transcript.test.ts
New vitest cases validate that mined Codex startup/suggestion content and Claude tool action rows are correctly excluded from rendered messages. Helper functions messagesFromFixture construct messages from parser fixtures, and text extraction logic supports test assertions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • TraderSamwise/aimux#71: Both PRs add/adjust test coverage around live-mined Codex startup/suggestion content and Claude tool/action rows to ensure those mined/status-like blocks are not rendered as chat messages.
  • TraderSamwise/aimux#72: Both PRs add/adjust parser-fixture-based tests to ensure mined Codex startup content is not rendered as normal chat turns and Claude tool action rows are omitted from captured message text.
  • TraderSamwise/aimux#66: Both PRs expand fixture-driven parsing test coverage; the main PR's new assertions in parsed-transcript.test.ts align with the fixture contract for agent output parser (AgentOutputParserFixture).

🐰 A rabbit hops through test cases with care,
Filtering signals from the parsing air,
Mined Codex blocks and tool rows take flight,
Fixtures now prove the chat messages 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 'Test chat transcript parser rendering' accurately and specifically describes the primary change in the pull request - adding test coverage for how the chat transcript parser renders different types of content.
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-corpus-audit

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/lib/parsed-transcript.test.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


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.

🧹 Nitpick comments (1)
app/lib/parsed-transcript.test.ts (1)

236-241: ⚖️ Poor tradeoff

Consider consolidating ParsedAgentOutput type definitions.

The double cast as unknown as ParsedAgentOutput suggests that parseAgentOutput returns a type structurally compatible with but nominally distinct from the ParsedAgentOutput imported from ./events. This typically indicates the type is defined in both src/ and app/ directories.

While this works, maintaining duplicate type definitions can lead to drift over time. Consider either:

  1. Exporting the canonical type from src/ and re-exporting it in app/lib/events.ts, or
  2. Defining the type in a shared location accessible to both contexts.
🤖 Prompt for 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.

In `@app/lib/parsed-transcript.test.ts` around lines 236 - 241, The double-cast in
messagesFromFixture hides a duplicate type definition for ParsedAgentOutput;
locate the canonical ParsedAgentOutput type (used by parseAgentOutput) and
export/re-export it so both modules share the same definition rather than
redefining it. Update imports so messagesFromFixture uses the single exported
ParsedAgentOutput (remove the "as unknown as" cast), or move the type to a
shared module and import that type in both the parser (parseAgentOutput) and the
consumer (messagesFromFixture / messagesFromParsedAgentOutput) to eliminate the
nominal mismatch.
🤖 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.

Nitpick comments:
In `@app/lib/parsed-transcript.test.ts`:
- Around line 236-241: The double-cast in messagesFromFixture hides a duplicate
type definition for ParsedAgentOutput; locate the canonical ParsedAgentOutput
type (used by parseAgentOutput) and export/re-export it so both modules share
the same definition rather than redefining it. Update imports so
messagesFromFixture uses the single exported ParsedAgentOutput (remove the "as
unknown as" cast), or move the type to a shared module and import that type in
both the parser (parseAgentOutput) and the consumer (messagesFromFixture /
messagesFromParsedAgentOutput) to eliminate the nominal mismatch.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1709dfeb-59bd-46c5-b4c7-89d1be4e6810

📥 Commits

Reviewing files that changed from the base of the PR and between ae047dd and 5ae88d4.

📒 Files selected for processing (1)
  • app/lib/parsed-transcript.test.ts

@TraderSamwise
TraderSamwise merged commit fd9dbf4 into master Jun 6, 2026
3 checks passed
@TraderSamwise
TraderSamwise deleted the test/chat-parser-corpus-audit branch June 6, 2026 10:16
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