Skip to content

fix: fix wework tsc - #1521

Merged
qdaxb merged 1 commit into
mainfrom
codex/fix-wework-runtime-device-workspace-id
Jun 22, 2026
Merged

qdaxb merged 1 commit into
mainfrom
codex/fix-wework-runtime-device-workspace-id

Conversation

@qdaxb

@qdaxb qdaxb commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Enhanced workspace selection logic and improved type safety for device workspace handling and runtime message creation.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f9f88a85-c050-49dc-8f86-97f2015823d0

📥 Commits

Reviewing files that changed from the base of the PR and between dd6f020 and 3ef4f75.

📒 Files selected for processing (1)
  • wework/src/features/workbench/WorkbenchProvider.tsx

📝 Walkthrough

Walkthrough

WorkbenchProvider.tsx introduces a SelectableProjectDeviceWorkspace type alias (intersection of RuntimeDeviceWorkspace with a non-null id), updates two workspace filter helpers to return this stricter type, and refactors sendPreparedRuntimeMessage to build runtimeTaskTarget through an explicit projectId/non-projectId branch with blocking guards, then spreads the target into the create request.

Changes

Workspace Type Safety and Runtime Task Targeting

Layer / File(s) Summary
SelectableProjectDeviceWorkspace type and filter helpers
wework/src/features/workbench/WorkbenchProvider.tsx
Adds SelectableProjectDeviceWorkspace as an intersection type with a guaranteed non-null id. Updates getSelectableProjectDeviceWorkspaces with a workspace.id != null type guard, and changes findProjectDeviceWorkspace to return SelectableProjectDeviceWorkspace | null.
sendPreparedRuntimeMessage target branching refactor
wework/src/features/workbench/WorkbenchProvider.tsx
Replaces the previous ternary-based RuntimeTaskCreateRequest construction with an explicit projectId ? ... : ... branch that builds a runtimeTaskTarget object. Each branch has a dedicated blocking guard before resolving the target, and the final request is assembled via object spread.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A workspace must have an id, it's true,
Or the selectable type won't let it through!
With guards in the branch and a spread in the call,
No null shall creep past the WorkbenchProvider's wall.
Hop hop, the types are tight — no loose ends at all! 🎉

✨ 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 codex/fix-wework-runtime-device-workspace-id

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 and usage tips.

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