[PR #2137] [MERGED] test(mcp): ready providers before live prompt completion checks #5054

Closed
opened 2026-10-31 01:01:10 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2137
Author: @kaoru0822-kitauji
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @morluto

Base: main ← Head: fix/prompt-completion-ready-checks


📝 Commits (1)

  • 5d4fb61 test(mcp): ready providers before live prompt completion checks

📊 Changes

2 files changed (+16 additions, -10 deletions)

View changed files

📝 scripts/verify-package-mcp.mjs (+3 -5)
📝 tests/boundary/mcp/promptCompletion.test.ts (+13 -5)

📄 Description

Why

Main CI has failed since 07b36c148 (fix(mcp): keep prompt completion within ready provider sessions). Its own run was cancelled; the first completed run after it, at c22111eca, failed. The same two failures now appear on every open PR based on main (#2118, #2125, #2131). Tracked in #2123.

  • Test shard: tests/boundary/mcp/promptCompletion.test.ts fails with expected [] to deeply equal [ 'App', 'AppTests' ]
  • Native package baseline (darwin arm64 / x64): packaged MCP prompt completion lifecycle failed

Root cause

07b36c148 made document and procedure completion call BinarySession.executeIfProviderReady. That path returns nothing unless the provider client already exists and implements executeIfReady. CompositeProvider creates clients only on the first ordinary execute. The intended contract is that completion never cold-starts a provider. The commit updated promptMcp.test.ts but missed two checks that still completed straight after opening a target:

  1. promptCompletion.test.ts: the fixture client had no executeIfReady, and no ordinary operation ran before completion.
  2. scripts/verify-package-mcp.mjs: on non-Linux hosts it expected ["fixture"] immediately after open_binary, before current_document started the fake Hopper. Linux passed only because it expects [] there.

Change

Production code is untouched; only the two stale checks change. Each now:

  • asserts that completion on a cold session is [], which proves completion does not start the provider
  • readies the provider through an ordinary operation (list_documents in the test, current_document in the packaged smoke)
  • asserts the same live candidates as before (App/AppTests with the procedure set; ["fixture"] on non-Linux)

The fixture client gains executeIfReady because it is an in-process client that is ready as soon as the session opens. No assertion was removed or relaxed.

Validation

  • npm run test:focused -- tests/boundary/mcp/promptCompletion.test.ts tests/boundary/mcp/promptMcp.test.ts: 15 passed
  • npm run verify:package on macOS arm64 (the failing CI host): passed
  • npm run check:fast: passed
  • Not run locally: the darwin x64 and Linux package hosts, which CI covers.

Fixes #2123

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2137 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/prompt-completion-ready-checks` --- ### 📝 Commits (1) - [`5d4fb61`](https://github.com/morluto/rea/commit/5d4fb611a6442aca8e3df283e227eeb3caad9553) test(mcp): ready providers before live prompt completion checks ### 📊 Changes **2 files changed** (+16 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `scripts/verify-package-mcp.mjs` (+3 -5) 📝 `tests/boundary/mcp/promptCompletion.test.ts` (+13 -5) </details> ### 📄 Description ## Why Main CI has failed since `07b36c148` (fix(mcp): keep prompt completion within ready provider sessions). Its own run was cancelled; the first completed run after it, at `c22111eca`, failed. The same two failures now appear on every open PR based on main (#2118, #2125, #2131). Tracked in #2123. - `Test shard`: `tests/boundary/mcp/promptCompletion.test.ts` fails with `expected [] to deeply equal [ 'App', 'AppTests' ]` - `Native package baseline (darwin arm64 / x64)`: `packaged MCP prompt completion lifecycle failed` ## Root cause `07b36c148` made document and procedure completion call `BinarySession.executeIfProviderReady`. That path returns nothing unless the provider client already exists and implements `executeIfReady`. `CompositeProvider` creates clients only on the first ordinary `execute`. The intended contract is that completion never cold-starts a provider. The commit updated `promptMcp.test.ts` but missed two checks that still completed straight after opening a target: 1. `promptCompletion.test.ts`: the fixture client had no `executeIfReady`, and no ordinary operation ran before completion. 2. `scripts/verify-package-mcp.mjs`: on non-Linux hosts it expected `["fixture"]` immediately after `open_binary`, before `current_document` started the fake Hopper. Linux passed only because it expects `[]` there. ## Change Production code is untouched; only the two stale checks change. Each now: - asserts that completion on a cold session is `[]`, which proves completion does not start the provider - readies the provider through an ordinary operation (`list_documents` in the test, `current_document` in the packaged smoke) - asserts the same live candidates as before (`App`/`AppTests` with the procedure set; `["fixture"]` on non-Linux) The fixture client gains `executeIfReady` because it is an in-process client that is ready as soon as the session opens. No assertion was removed or relaxed. ## Validation - `npm run test:focused -- tests/boundary/mcp/promptCompletion.test.ts tests/boundary/mcp/promptMcp.test.ts`: 15 passed - `npm run verify:package` on macOS arm64 (the failing CI host): passed - `npm run check:fast`: passed - Not run locally: the darwin x64 and Linux package hosts, which CI covers. Fixes #2123 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:01:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5054
No description provided.