Skip to content

Extract DEFAULT_EXECUTOR constant to eliminate hardcoded strings#94

Merged
catstrike merged 1 commit intomainfrom
ls/extract-default-executor-constant
Apr 8, 2026
Merged

Extract DEFAULT_EXECUTOR constant to eliminate hardcoded strings#94
catstrike merged 1 commit intomainfrom
ls/extract-default-executor-constant

Conversation

@catstrike
Copy link
Copy Markdown
Collaborator

Summary

Extract DEFAULT_EXECUTOR = "separate_executor" constant into executor_utils.py, replacing 11 hardcoded string literals across 7 files. Also changes the default executor from claude_code to separate_executor.

Changes

Add DEFAULT_EXECUTOR constant

Single source of truth in shared/executor_utils.py; all consumers import it instead of repeating the string literal.

Files
  • src/databao_cli/shared/executor_utils.py
  • src/databao_cli/features/ui/models/settings.py
  • src/databao_cli/features/mcp/tools/databao_ask/agent_factory.py
  • src/databao_cli/features/ui/app.py
  • src/databao_cli/features/ui/components/sidebar.py
  • src/databao_cli/features/ui/pages/agent_settings.py
  • src/databao_cli/features/ui/pages/general_settings.py

Test Plan

  • make check passes (ruff, mypy, all hooks)
  • make test -- 177 passed, 1 pre-existing failure (unrelated test_init_project_with_snowflake)

The default executor value was duplicated as a string literal in 11 places
across 7 files. A single constant in executor_utils.py makes future
changes a one-line edit and also changes the default to separate_executor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 8, 2026 15:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR centralizes the default executor choice by introducing a shared DEFAULT_EXECUTOR constant and updating UI + MCP code paths to use it, while also switching the default executor from claude_code to separate_executor.

Changes:

  • Added DEFAULT_EXECUTOR = "separate_executor" in shared/executor_utils.py and adjusted executor display labels.
  • Replaced multiple "claude_code" default fallbacks in Streamlit UI state/persistence with DEFAULT_EXECUTOR.
  • Updated the MCP databao_ask agent factory to default its executor argument to DEFAULT_EXECUTOR.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/databao_cli/shared/executor_utils.py Adds DEFAULT_EXECUTOR and updates executor display names/recommended labeling.
src/databao_cli/features/ui/models/settings.py Switches persisted settings defaults/fallbacks to DEFAULT_EXECUTOR.
src/databao_cli/features/mcp/tools/databao_ask/agent_factory.py Defaults MCP agent creation to DEFAULT_EXECUTOR.
src/databao_cli/features/ui/app.py Uses DEFAULT_EXECUTOR for session-state defaults and settings persistence.
src/databao_cli/features/ui/components/sidebar.py Uses DEFAULT_EXECUTOR as the executor selector fallback.
src/databao_cli/features/ui/pages/agent_settings.py Uses DEFAULT_EXECUTOR as the executor selection fallback and removes “default/recommended” wording from Claude Code info text.
src/databao_cli/features/ui/pages/general_settings.py Resets executor type to DEFAULT_EXECUTOR when resetting settings.

@catstrike catstrike merged commit 9e77980 into main Apr 8, 2026
9 of 10 checks passed
@catstrike catstrike deleted the ls/extract-default-executor-constant branch April 8, 2026 16:55
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