Skip to content

refactor(workbench): ♻️ remove runMode from frontend state management#225

Merged
jorben merged 1 commit into
masterfrom
refact/plan-mode
Jun 7, 2026
Merged

refactor(workbench): ♻️ remove runMode from frontend state management#225
jorben merged 1 commit into
masterfrom
refact/plan-mode

Conversation

@jorben

@jorben jorben commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove the runMode concept from frontend state management
  • Simplify composer store, thread surface state, and submission types
  • Backend now determines the run mode; frontend sends a fixed "default"

Changes

  • Remove newThreadRunMode from composer store and its setter
  • Remove runMode from ComposerSubmission, PendingThreadRun, NewThreadSubmission
  • Remove deriveSelectedRunMode function and selectedRunMode state
  • Remove runMode parameter from buildComposerSubmission
  • Remove runMode from InitialPromptRequest type
  • Clean up unused RunMode imports across 12 files

Test Plan

  • Existing unit tests updated and passing
  • Manual smoke test: new thread creation and message submission

🤖 Generated with TiyCode

Remove the runMode concept from composer store, thread surface state,
submission types, and helper functions. The backend now determines the
run mode, so the frontend no longer needs to track or pass it.

- Remove newThreadRunMode from composer store
- Remove runMode from ComposerSubmission, PendingThreadRun, NewThreadSubmission
- Remove deriveSelectedRunMode and selectedRunMode state
- Remove runMode parameter from buildComposerSubmission
- Remove runMode from InitialPromptRequest type
- Hardcode 'default' as the fixed run mode sent to backend
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

AI Code Review Summary

PR: #225 (refactor(workbench): ♻️ remove runMode from frontend state management)
Preferred language: English

Overall Assessment

No blocking issue was detected in the reviewed diff; keep focused regression testing before merge.

Major Findings by Severity

No major issues identified from the reviewed diff.

Actionable Suggestions

  • Address the highest severity findings first and add targeted tests for changed logic.

Potential Risks

  • Potential hidden risks remain in edge cases not covered by the current diff context.

Test Suggestions

  • Add happy-path + boundary + failure-path tests for touched modules.

File-Level Coverage Notes

  • src/modules/workbench-shell/model/composer-commands.ts: Clean removal of unused RunMode import and runMode field from ComposerSubmission and buildComposerSubmission. (Removed imports could break downstream consumers but this batch shows all affected files updated.)
  • src/modules/workbench-shell/model/composer-commands.test.ts: Test calls updated to match the new buildComposerSubmission signature; no functional changes to test logic.
  • src/modules/workbench-shell/model/composer-store.ts: Removed newThreadRunMode state, its setter, and related type imports. Consistent with the removal of RunMode usage.
  • src/modules/workbench-shell/model/composer-store.test.ts: Removed test for setNewThreadRunMode to match the store changes.
  • src/modules/workbench-shell/model/thread-store.test.ts: Removed runMode from makePendingRun helper to align with type changes.
  • src/modules/workbench-shell/model/workbench-actions.ts: Removed runMode from NewThreadSubmission interface, submitNewThread implementation, and composer store reset. This aligns with the removal of RunMode and newThreadRunMode.
  • src/modules/workbench-shell/model/workbench-actions.test.ts: Updated test calls to exclude runMode and removed composer-store newThreadRunMode setup. No gaps in coverage introduced.
  • src/modules/workbench-shell/ui/dashboard-workbench-logic.ts: Removed runMode field from PendingThreadRun type. Matches removal of RunMode import.
  • src/modules/workbench-shell/ui/dashboard-workbench.tsx: Removed usage of newThreadRunMode from composer store and removed the prop from submitNewThread call. No new errors introduced.
  • src/modules/workbench-shell/ui/runtime-thread-surface-state.ts: Removed RunMode import, runMode from InitialPromptRequest, and the deriveSelectedRunMode helper. Complete and coherent removal.
  • src/modules/workbench-shell/ui/runtime-thread-surface.tsx: Removed selectedRunMode state, its update logic, RunMode import, and associated prop usage. The submitPrompt hardcodes "default"—this is harmless as RunMode is no longer in use. Should be cleaned up in a later step if "default" becomes meaningless. (The "default" string could be removed entirely if executePrompt no longer expects a run-mode parameter.)
  • src/modules/workbench-shell/ui/workbench-prompt-composer.tsx: Removed RunMode import, runMode parameter from buildSubmissionFromPromptInput, and the "default" argument at the call site. Empty runMode prop is no longer embedded in submissions.

Inline Downgraded Items (processed but not inline)

  • None

Coverage Status

  • Target files: 12
  • Covered files: 12
  • Uncovered files: 0
  • No-patch/binary covered as file-level: 0
  • Findings with unknown confidence (N/A): 0

Uncovered list:

  • None

No-patch covered list:

  • None

Runtime/Budget

  • Rounds used: 1/4
  • Planned batches: 1
  • Executed batches: 1
  • Sub-agent runs: 1
  • Planner calls: 1
  • Reviewer calls: 1
  • Model calls: 2/64
  • Structured-output summary-only degradation: NO

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated PR review completed.

  • Findings kept: 0
  • Findings with unknown confidence: 0
  • Inline comments attempted: 1
  • Target files: 12
  • Covered files: 12
  • Uncovered files: 0
    See the summary comment for detailed analysis and coverage details.

@@ -1,6 +1,5 @@
import { describe, expect, it } from "vitest";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review completed for this PR diff. No concrete inline issue was selected after aggregation.

@jorben jorben merged commit fe7fbfc into master Jun 7, 2026
4 checks passed
@jorben jorben deleted the refact/plan-mode branch June 7, 2026 12:12
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