Skip to content

fix(executor): gate standalone chat workspaces - #1246

Merged
qdaxb merged 1 commit into
wecode-ai:mainfrom
FicoHu:codex/standalone-chats-opt-in
Jun 3, 2026
Merged

qdaxb merged 1 commit into
wecode-ai:mainfrom
FicoHu:codex/standalone-chats-opt-in

Conversation

@FicoHu

@FicoHu FicoHu commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • Documentation

    • Added guides for standalone chat workspace setup and configuration options.
  • New Features

    • Introduced standalone chat workspaces for local device support when no project is selected, disabled by default.
    • Includes customizable workspace directory paths with automatic workspace metadata tracking for history recovery.
  • Tests

    • Added test coverage validating standalone chat workspace functionality and default disabled state.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR adds a feature flag to disable standalone chat workspaces by default. It introduces environment-variable-controlled guards in standalone_chat_workspace.py, comprehensive test coverage verifying disabled-by-default behavior, and corresponding documentation in both English and Chinese.

Changes

Standalone Chat Workspace Enablement

Layer / File(s) Summary
Feature flag and guard logic
executor/agents/claude_code/standalone_chat_workspace.py
Introduces STANDALONE_CHATS_ENABLED_ENV and TRUTHY_ENV_VALUES constants alongside a new is_standalone_chat_workspace_enabled() function that reads the environment variable. Both is_initial_standalone_chat() and prepared_standalone_chat_workspace_path() now early-return False/None when disabled, preventing workspace preparation/finalization logic from running.
Test helpers and disabled-by-default verification
executor/tests/agents/test_standalone_chat_workspace.py, executor/tests/agents/test_project_workspace_paths.py
Adds _enable_standalone_chats(monkeypatch) test helpers in both modules. Introduces two new tests asserting that standalone chat workspaces are not prepared when disabled (return None and do not create directories). Updates existing workspace preparation and finalization tests to explicitly enable the feature before running assertions.
User-facing documentation
docs/en/user-guide/ai-devices/local-device-support.md, docs/zh/user-guide/ai-devices/local-device-support.md
Adds "Standalone Chat Workspaces" sections in English and Chinese describing the feature as disabled by default, the WEGENT_EXECUTOR_STANDALONE_CHATS_ENABLED environment variable, workspace directory lifecycle and root path configuration, persistence via task metadata label standaloneChatWorkspacePath, and clarification that project chats continue using configured workspace paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • wecode-ai/Wegent#1241: Both PRs modify executor/agents/claude_code/standalone_chat_workspace.py behavior for standalone chat workspaces—one gating preparation/finalization via WEGENT_EXECUTOR_STANDALONE_CHATS_ENABLED, the other preserving existing session files during finalize/copy—so they overlap on the same standalone workspace lifecycle/session handling code.

Suggested reviewers

  • qdaxb

Poem

🐰 A feature flag hops into sight,
Standalone chats are off by night,
With WEGENT_EXECUTOR_ on the scene,
Tests now guard what might have been,
Docs explain the path so bright! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.05% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(executor): gate standalone chat workspaces' directly reflects the main objective of the PR, which adds an environment-controlled enablement switch to disable standalone chat workspaces by default.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@qdaxb
qdaxb merged commit d2ef19e into wecode-ai:main Jun 3, 2026
18 of 19 checks passed
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.

2 participants