Skip to content

[test] Carry the v0.115.3 test suites onto the v0.115.4 structure - #6731

Closed
mmabrouk wants to merge 1 commit into
release/v0.115.4from
fix/release-v0.115.4-merge-gaps
Closed

[test] Carry the v0.115.3 test suites onto the v0.115.4 structure#6731
mmabrouk wants to merge 1 commit into
release/v0.115.4from
fix/release-v0.115.4-merge-gaps

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Sep 9, 2026

Copy link
Copy Markdown
Member

run-web-unit-tests is red on release/v0.115.4: a17ae79a75

Four suites pass on release/v0.115.3 and on release/v0.115.4 separately, and fail only once the two are merged, because a v0.115.3 test now meets the surface v0.115.4 rebuilt under it. This carries them onto that structure.

What was red, and why

Package Suite Failing Cause
@agenta/chat tests/unit/hooks/useServerSessionInputs.test.ts 4 The test replaces @agenta/entities/session wholesale. The composer's file palette, which v0.115.4 added, reads a real export of it (sessionMountsQueryFamily).
@agenta/oss markdownLinkGate.test.tsx 4 MD_REHYPE_PLUGINS is module-private inside ChatMarkdown, so the test's gate helper imports undefined and silently drives Streamdown's stock pipeline instead of ours.
@agenta/oss useChatSlashCommands.test.tsx 0 run It sits beside a hook that moved into @agenta/chat, cannot resolve ./useChatSlashCommands, and fails to collect. Its one test has not run since the merge.
@agenta/oss permissions.test.tsx 3 Two Next versions resolve in this workspace, so the app's RouterContext.Provider is a different module from the one a package component's useRouter reads.

Eleven failing tests, plus one that never runs.

The link-gate row is not a product bug

Worth stating plainly, because "keeps the working-directory-relative path (#6659)" failing looks like agent file links are broken. They are not.

ChatMarkdown builds the plugin list and passes it to Streamdown, so a bare relative path in a reply still gets the pre-harden respelling and still resolves. Only the test's view of that list broke. The cost is that the four assertions which prove #6659 works currently prove nothing about the real pipeline, which is why they are worth repairing rather than deleting.

What this changes

Five files. Everything is test-side except one line.

  • The one non-test line. MD_REHYPE_PLUGINS in web/packages/agenta-chat/src/components/ChatMarkdown.tsx gains the export keyword. The constant, its value and its use are untouched; the desktop surface re-exports it so the link-gate test keeps its import path.
  • The admission suite spreads the original module rather than replacing it.
  • The slash-command test moves into @agenta/chat, beside the hook, and drops the host stubs the hook now takes as props. Nothing is deleted.
  • web/oss/vitest.config.ts pins one next/router for the run, so every copy of Next shares the router context the tests provide.

Source is otherwise untouched.

After

Package Result
@agenta/chat 1019 passed, 89 files
@agenta/oss 517 passed, 1 skipped, 59 files
@agenta/entity-ui 729 passed, 53 files
@agenta/mobile 185 passed, 26 files
@agenta/sessions-ui 25 passed, 4 files

Typecheck clean on chat, sessions-ui, entity-ui, home-ui, oss, ee and mobile. Lint clean per package; mobile keeps five pre-existing warnings and no errors, in files this branch does not touch. Prettier clean.

All four pass on either branch alone and fail only once the two meet.
None of them changes what the product does.

- The admission suite replaced `@agenta/entities/session` wholesale, and
  the composer's file palette reads a real export of it. Spread the
  original.
- The link-gate test drives the rehype list directly, so the list has to
  be reachable: `MD_REHYPE_PLUGINS` is exported from `ChatMarkdown` and
  re-exported from the desktop surface. Without it the helper fell back
  to Streamdown's defaults and reported the stock pipeline's verdict,
  which is "[blocked]" for every bare relative path. The renderer itself
  was always correct.
- The slash-command test sat beside a hook that moved into
  `@agenta/chat`. It could not resolve its import and never ran at all.
  It moves to the package and drops the host stubs the hook now takes as
  props.
- Two Next versions resolve in this workspace, so a test that mounts a
  package component cannot satisfy its `useRouter`; the app's own
  RouterContext is a different module. Pin one copy per vitest run.
@mmabrouk

mmabrouk commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
agenta-documentation Ready Ready Preview Sep 9, 2026 1:46pm UTC

Request Review

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Mahmoud Mabrouk seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 3dd6346d-d5e8-496e-895b-84d40c7018c0

📥 Commits

Reviewing files that changed from the base of the PR and between a17ae79 and b011264.

📒 Files selected for processing (5)
  • web/oss/src/components/AgentChatSlice/assets/markdown.tsx
  • web/oss/vitest.config.ts
  • web/packages/agenta-chat/src/components/ChatMarkdown.tsx
  • web/packages/agenta-chat/tests/unit/hooks/useChatSlashCommands.test.tsx
  • web/packages/agenta-chat/tests/unit/hooks/useServerSessionInputs.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Tests

    • Improved automated test reliability for chat interactions, session handling, Markdown rendering, and navigation.
    • Updated test environments and shared configuration to better reflect real application behavior.
  • Refactor

    • Standardized access to shared Markdown processing capabilities across chat interfaces without changing their behavior.

Walkthrough

The change exports MD_REHYPE_PLUGINS from shared and desktop markdown modules. Vitest now aliases next/router. Chat tests use jsdom, pass host concerns through props, and preserve original session exports in mocks.

Changes

Markdown test integration

Layer / File(s) Summary
Markdown plugin exports
web/packages/agenta-chat/src/components/ChatMarkdown.tsx, web/oss/src/components/AgentChatSlice/assets/markdown.tsx
MD_REHYPE_PLUGINS is exported from the chat package and re-exported by the desktop markdown asset.
Vitest and chat test setup
web/oss/vitest.config.ts, web/packages/agenta-chat/tests/unit/hooks/useChatSlashCommands.test.tsx, web/packages/agenta-chat/tests/unit/hooks/useServerSessionInputs.test.ts
Vitest aliases next/router to one module path. The slash-command test uses jsdom and the source hook import. The session mock preserves original module exports.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to b0112

This change exposes the existing markdown plugin configuration and repairs chat test setup without changing product behavior. The updated tests, typechecks, linting, and formatting checks are clean, so the change is ready to merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5…
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.
Description check ✅ Passed The description clearly explains that the pull request carries v0.115.3 test suites onto the v0.115.4 structure and repairs the listed test failures without changing product behavior.
Title check ✅ Passed The title clearly summarizes the primary change: adapting the v0.115.3 test suites to the v0.115.4 structure.
✨ 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 fix/release-v0.115.4-merge-gaps

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-pr-6731.up.railway.app/w
Project agenta-oss-clone-spike
Image tag pr-6731-583169c
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-09-09T13:59:28.781Z

@mmabrouk mmabrouk closed this Sep 10, 2026
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