Extract DEFAULT_EXECUTOR constant to eliminate hardcoded strings#94
Merged
Extract DEFAULT_EXECUTOR constant to eliminate hardcoded strings#94
Conversation
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>
Contributor
There was a problem hiding this comment.
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"inshared/executor_utils.pyand adjusted executor display labels. - Replaced multiple
"claude_code"default fallbacks in Streamlit UI state/persistence withDEFAULT_EXECUTOR. - Updated the MCP
databao_askagent factory to default itsexecutorargument toDEFAULT_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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extract
DEFAULT_EXECUTOR = "separate_executor"constant intoexecutor_utils.py, replacing 11 hardcoded string literals across 7 files. Also changes the default executor fromclaude_codetoseparate_executor.Changes
Add
DEFAULT_EXECUTORconstantSingle 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.pysrc/databao_cli/features/ui/models/settings.pysrc/databao_cli/features/mcp/tools/databao_ask/agent_factory.pysrc/databao_cli/features/ui/app.pysrc/databao_cli/features/ui/components/sidebar.pysrc/databao_cli/features/ui/pages/agent_settings.pysrc/databao_cli/features/ui/pages/general_settings.pyTest Plan
make checkpasses (ruff, mypy, all hooks)make test-- 177 passed, 1 pre-existing failure (unrelatedtest_init_project_with_snowflake)