Skip to content

test(wework): verify official Codex plugin skill and MCP - #2288

Merged
qdaxb merged 2 commits into
mainfrom
test/wework-official-plugin-e2e
Jul 28, 2026
Merged

qdaxb merged 2 commits into
mainfrom
test/wework-official-plugin-e2e

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • initialize the Wework-managed Codex home from a truly blank state
  • install a pinned OpenAI official plugin through the real plugin marketplace flow
  • verify the official skill is injected and read through a real Codex tool loop
  • discover and invoke the official plugin MCP tool through Codex tool_search, then cleanly uninstall the plugin

Verification

  • pnpm --dir wework exec prettier --check e2e/desktop/task-flow.e2e.mjs
  • pnpm --dir wework exec eslint e2e/desktop/task-flow.e2e.mjs
  • node --check wework/e2e/desktop/task-flow.e2e.mjs
  • pnpm --filter wework e2e:desktop:plugins
  • pre-push Wework ESLint, TypeScript, and unit tests

Summary by CodeRabbit

  • Tests
    • Added end-to-end coverage for verifying the dedicated “official plugin” flow when running in plugins-only mode.
    • Validated plugin marketplace pinning, installation, and that the expected skill content and configuration are correctly applied.
    • Expanded coverage for MCP tool discovery and execution, including shell tool handling, tool search, and namespaced tool calls.
    • Updated the desktop E2E scenario wiring and model interactions to support the official plugin workflow end-to-end.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

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 Plus

Run ID: 226533e1-fa61-45eb-b02b-b94b1d875238

📥 Commits

Reviewing files that changed from the base of the PR and between 3e47016 and e5b3452.

📒 Files selected for processing (1)
  • wework/e2e/desktop/task-flow.e2e.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
  • wework/e2e/desktop/task-flow.e2e.mjs

📝 Walkthrough

Walkthrough

The desktop E2E flow now validates installation and execution of a pinned official plugin in PLUGINS_ONLY mode, including isolated Codex homes, marketplace provenance, skill materialization, MCP tool discovery, and completion behavior.

Changes

Official plugin E2E flow

Layer / File(s) Summary
Pinned plugin fixture and Codex bootstrap
wework/e2e/desktop/task-flow.e2e.mjs
Creates a marketplace from a pinned OpenAI plugins revision and prepares isolated/native Codex homes for PLUGINS_ONLY execution.
Official plugin lifecycle verification
wework/e2e/desktop/task-flow.e2e.mjs
Verifies marketplace installation, source provenance, materialized skill content, Codex configuration, and uninstall behavior.
Official plugin model and MCP scenario
wework/e2e/desktop/task-flow.e2e.mjs
Adds mock handling for shell execution, tool search, namespaced MCP selection, and official-plugin completion states.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DesktopApp
  participant DesktopE2EServer
  participant Codex
  participant OfficialPluginMCPServer
  DesktopApp->>DesktopE2EServer: start official_plugin scenario
  Codex->>DesktopE2EServer: request shell and tool-search responses
  DesktopE2EServer-->>Codex: return shell tool call and tool-search result
  Codex->>OfficialPluginMCPServer: invoke namespaced MCP tool
  OfficialPluginMCPServer-->>Codex: return validation text
  Codex-->>DesktopApp: return official plugin completion
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: E2E verification of the official Codex plugin skill and MCP flow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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/wework-official-plugin-e2e

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.

@qdaxb
qdaxb force-pushed the test/wework-official-plugin-e2e branch from 3e47016 to 29000a7 Compare July 28, 2026 19:20

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (6)
wework/e2e/desktop/task-flow.e2e.mjs (6)

2301-2305: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Assert the config exists before reading it so a missing file gives a clear failure.

If the initializer doesn't create config.toml, readFile throws an opaque ENOENT instead of the intended assertion message.

♻️ Suggested tweak
+  assert.equal(
+    await pathExists(configPath),
+    true,
+    'Creating a blank Codex home did not write config.toml'
+  )
   assert.equal(
     (await readFile(configPath, 'utf8')).includes('desktop-e2e-native-home-marker'),
🤖 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 `@wework/e2e/desktop/task-flow.e2e.mjs` around lines 2301 - 2305, Update the
assertion in the task-flow test around the configPath read to first assert that
config.toml exists, using a clear failure message, then read and inspect its
contents for the native-home marker. Preserve the existing migration assertion
and message.

396-410: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Fixture depends on a live network fetch with no retry, and git remote add fails on a re-used result dir.

Two reliability concerns for the desktop E2E job:

  • git fetch against github.com is a hard external dependency with no retry/backoff; a transient failure fails the whole plugin checkpoint. A single retry (or a WEWORK_E2E_OFFICIAL_PLUGIN_REPO override pointing at a pre-cloned mirror) would make this robust in CI.
  • If officialPluginRepositoryPath already contains the repo from a previous run in the same resultDir, git remote add origin exits non-zero and runChecked throws. Consider git remote set-url --add semantics or removing the directory first.
♻️ Suggested hardening
-  await mkdir(repositoryRoot, { recursive: true })
+  await rm(repositoryRoot, { recursive: true, force: true })
+  await mkdir(repositoryRoot, { recursive: true })
   await runChecked('git', ['init'], { cwd: repositoryRoot })
🤖 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 `@wework/e2e/desktop/task-flow.e2e.mjs` around lines 396 - 410, Harden
createOfficialPluginMarketplaceFixture for repeated and transient CI runs: honor
a WEWORK_E2E_OFFICIAL_PLUGIN_REPO override when selecting the fetch source,
retry the git fetch once with backoff, and make origin setup idempotent by
updating an existing remote or adding it only when absent. Preserve the pinned
OFFICIAL_PLUGIN_REVISION checkout and validation.

2324-2336: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Duplicated revision check and message-less assertions reduce diagnosability.

The git rev-parse HEAD equality is already asserted in createOfficialPluginMarketplaceFixture (Lines 406-410); repeating it here without a message adds no signal. Adding failure messages to the manifest assertions (name, author.name, skills, mcpServers, skill marker) would make pinned-plugin drift obvious from the log alone.

🤖 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 `@wework/e2e/desktop/task-flow.e2e.mjs` around lines 2324 - 2336, The
assertions in the official plugin validation flow should avoid duplicating the
revision check already performed by createOfficialPluginMarketplaceFixture.
Remove the local git rev-parse HEAD equality assertion, and add descriptive
failure messages to the pluginManifest name, author.name, skills, mcpServers,
and skill marker assertions so each pinned-plugin mismatch is identifiable from
the test output.

6035-6039: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Hoist the upstream validation string into an OFFICIAL_PLUGIN_* constant.

Every other pinned-plugin literal lives with the constants at Lines 334-346; keeping this one inline makes future pin bumps easy to miss.

🤖 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 `@wework/e2e/desktop/task-flow.e2e.mjs` around lines 6035 - 6039, Define an
OFFICIAL_PLUGIN_* constant alongside the existing pinned-plugin constants for
the upstream validation string, then update the assertion in the request
validation test to reference that constant instead of the inline literal.

2343-2350: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the unused workspacePath parameter.

workspacePath is destructured in verifyPluginLifecycle and still passed by the sole caller, but the function body never reads it. Drop it from the signature and call site to avoid passing unused API surface.

🤖 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 `@wework/e2e/desktop/task-flow.e2e.mjs` around lines 2343 - 2350, Remove the
unused workspacePath parameter from verifyPluginLifecycle and stop passing it
from its sole caller. Leave the remaining parameters and lifecycle behavior
unchanged.

Source: Coding guidelines


8270-8282: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Append the plugin-only config flag instead of rewriting the initializer’s config.

During --plugins-only, writeCodexConfig(codexHome, ...) overwrites the config.toml that initializeBlankCodexHome() exercised. Since later provider preservation checks read config.toml, they validate the harness write instead of the initializer output. Preserve a key written by the initializer and add [features]\nplugins = true non-destructively.

🤖 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 `@wework/e2e/desktop/task-flow.e2e.mjs` around lines 8270 - 8282, The
PLUGINS_ONLY setup currently overwrites the config produced by
initializeBlankCodexHome, bypassing its exercised contents. Update the
writeCodexConfig call in the blank-codex-home initialization flow to append or
merge the [features] plugins = true setting non-destructively, preserving the
initializer-written config keys for later provider checks.
🤖 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 `@wework/e2e/desktop/task-flow.e2e.mjs`:
- Around line 2453-2471: Make awaitScenarioRequestCount accept an optional
timeoutMs parameter and use it for its internal withTimeout, defaulting to
DEFAULT_STEP_TIMEOUT_MS when omitted. Update the official_plugin request-count
call to pass WORKBENCH_READY_TIMEOUT_MS directly and remove the ineffective
outer withTimeout wrapper.
- Around line 5963-5988: Initialize an official-plugin prewarm-tracking flag in
the test class constructor, then add a tool-less prewarm guard before the
official_plugin scenario branch, alongside the existing scenario guards. Ensure
prewarm requests are handled and excluded from official_plugin request numbering
so request 1 remains the real tool-bearing turn and the existing state-machine
assertions remain aligned.

---

Nitpick comments:
In `@wework/e2e/desktop/task-flow.e2e.mjs`:
- Around line 2301-2305: Update the assertion in the task-flow test around the
configPath read to first assert that config.toml exists, using a clear failure
message, then read and inspect its contents for the native-home marker. Preserve
the existing migration assertion and message.
- Around line 396-410: Harden createOfficialPluginMarketplaceFixture for
repeated and transient CI runs: honor a WEWORK_E2E_OFFICIAL_PLUGIN_REPO override
when selecting the fetch source, retry the git fetch once with backoff, and make
origin setup idempotent by updating an existing remote or adding it only when
absent. Preserve the pinned OFFICIAL_PLUGIN_REVISION checkout and validation.
- Around line 2324-2336: The assertions in the official plugin validation flow
should avoid duplicating the revision check already performed by
createOfficialPluginMarketplaceFixture. Remove the local git rev-parse HEAD
equality assertion, and add descriptive failure messages to the pluginManifest
name, author.name, skills, mcpServers, and skill marker assertions so each
pinned-plugin mismatch is identifiable from the test output.
- Around line 6035-6039: Define an OFFICIAL_PLUGIN_* constant alongside the
existing pinned-plugin constants for the upstream validation string, then update
the assertion in the request validation test to reference that constant instead
of the inline literal.
- Around line 2343-2350: Remove the unused workspacePath parameter from
verifyPluginLifecycle and stop passing it from its sole caller. Leave the
remaining parameters and lifecycle behavior unchanged.
- Around line 8270-8282: The PLUGINS_ONLY setup currently overwrites the config
produced by initializeBlankCodexHome, bypassing its exercised contents. Update
the writeCodexConfig call in the blank-codex-home initialization flow to append
or merge the [features] plugins = true setting non-destructively, preserving the
initializer-written config keys for later provider checks.
🪄 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 Plus

Run ID: e43c6c45-117a-4e43-9024-0e7fceffbca1

📥 Commits

Reviewing files that changed from the base of the PR and between d47f609 and 3e47016.

📒 Files selected for processing (1)
  • wework/e2e/desktop/task-flow.e2e.mjs

Comment thread wework/e2e/desktop/task-flow.e2e.mjs Resolved
Comment thread wework/e2e/desktop/task-flow.e2e.mjs Resolved
@qdaxb
qdaxb force-pushed the test/wework-official-plugin-e2e branch from 0cc2c7e to e5b3452 Compare July 28, 2026 19:51
@qdaxb
qdaxb merged commit eb1c3b9 into main Jul 28, 2026
33 checks passed
@qdaxb
qdaxb deleted the test/wework-official-plugin-e2e branch July 28, 2026 20:06
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