Skip to content

fix(doctor): gate TUI plugin advice on package exports#4667

Merged
code-yeongyu merged 2 commits into
devfrom
fix/4598-tui-plugin-export-detection
Jun 2, 2026
Merged

fix(doctor): gate TUI plugin advice on package exports#4667
code-yeongyu merged 2 commits into
devfrom
fix/4598-tui-plugin-export-detection

Conversation

@code-yeongyu
Copy link
Copy Markdown
Owner

@code-yeongyu code-yeongyu commented Jun 2, 2026

Summary

Fixes #4598 and #4303 by preventing doctor from recommending or blessing oh-my-openagent/tui when the actually registered installed package does not export ./tui.

This supersedes #4655. That PR fixed the main symptom but Cubic found an actionable issue: package detection could choose the wrong package when canonical and legacy package folders both exist. This PR resolves that by deriving the package export status from the actual server plugin entry in opencode.json.

Changes

  • Read package.json exports for the registered server plugin entry (oh-my-openagent, oh-my-opencode, or file entry).
  • If the package has no ./tui export and tui.json lacks the TUI entry, pass with a clear “TUI subpath not shipped” message instead of recommending a broken entry.
  • If the package has no ./tui export and tui.json already contains the broken entry, warn and tell the user to remove it.
  • Preserve legacy warning behavior when package metadata cannot be located.
  • Add regression coverage for the mixed canonical/legacy install case from the fix(doctor): skip TUI entry advice when package does not export ./tui (fixes #4643) #4655 review.

QA

  • Red repro: PATH="$HOME/.bun/bin:$PATH" bun test src/cli/doctor/checks/tui-plugin-config.test.ts --bail failed before the fix because doctor still warned to add an unshipped TUI entry.
  • PATH="$HOME/.bun/bin:$PATH" bun test src/cli/doctor/checks/tui-plugin-config.test.ts --bail — 10 pass / 0 fail
  • PATH="$HOME/.bun/bin:$PATH" bun run typecheck — pass
  • PATH="$HOME/.bun/bin:$PATH" bun run build — pass

Related


Summary by cubic

Doctor now checks the server plugin package’s exports and only suggests or validates .../tui when ./tui is shipped. Adds support for file: TUI entries and fixes wrong advice in mixed canonical/legacy installs; fixes #4598 and addresses #4303.

  • Bug Fixes
    • Read exports from the package behind the registered server plugin in opencode.json (oh-my-openagent, oh-my-opencode, or file:).
    • If ./tui isn’t exported and no TUI entry exists, pass with “TUI subpath not shipped”.
    • If ./tui isn’t exported but a named TUI entry exists, warn and suggest removing it.
    • Treat file: TUI entries pointing to our package as valid when they export ./tui; avoid false warnings.
    • Resolve canonical vs legacy folder conflicts by using the registered package; preserve legacy behavior when metadata is missing; add regression tests.

Written for commit 8fe5af7. Summary will update on new commits.

Review in cubic

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 2 files

Confidence score: 4/5

  • This PR looks safe to merge overall, with risk centered on doctor messaging rather than core runtime behavior.
  • The highest-impact issue is in src/cli/doctor/checks/tui-plugin-config.ts: the check can warn for any registered TUI entry, so valid file:-based configs may be incorrectly flagged and create user-facing false positives.
  • The "unresolvable" branch text in src/cli/doctor/checks/tui-plugin-config.ts appears too specific to named oh-my-openagent/tui entries, which can mislead users when tui.registered is true because of a file: entry.
  • Pay close attention to src/cli/doctor/checks/tui-plugin-config.ts - warning conditions and fix guidance should distinguish named package entries from valid file: registrations.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/cli/doctor/checks/tui-plugin-config.ts
Comment thread src/cli/doctor/checks/tui-plugin-config.ts Outdated
@code-yeongyu
Copy link
Copy Markdown
Owner Author

[sisyphus-dev] Cubic found a valid false-positive case here: the doctor check was treating valid file: TUI registrations like broken named oh-my-openagent/tui subpath entries. I reproduced it with a focused regression and am pushing the scoped fix now.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Auto-approved: All existing tests still pass, new tests cover the edge cases, and the logic correctly gates TUI plugin advice on actual package exports without altering unrelated behavior.

Re-trigger cubic

@code-yeongyu
Copy link
Copy Markdown
Owner Author

[sisyphus-dev] Verified this PR against #4598: doctor now gates oh-my-openagent/tui advice on the actual registered package exports, including the mixed canonical/legacy install case and file: TUI registration case. Isolated PR worktree verification passed with bun test src/cli/doctor/checks/tui-plugin-config.test.ts --bail: 11/11 tests. Remote CI is green and cubic reports no issues. Merging with a merge commit now.

@code-yeongyu code-yeongyu merged commit 31c46b5 into dev Jun 2, 2026
16 checks passed
@code-yeongyu code-yeongyu deleted the fix/4598-tui-plugin-export-detection branch June 2, 2026 07:04
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.

[Bug]: { "plugin": ["oh-my-openagent/tui"] }

1 participant