Skip to content

Commit 19e0aa0

Browse files
committed
fix: properly initialize session state for Threads number input
Pre-initialize max_threads_override in session state before rendering the widget, and remove the value parameter to let Streamlit read from session state. This ensures user changes are properly tracked. https://claude.ai/code/session_01XGuw7AxoKRWHr9EZX1SDXi
1 parent 1665060 commit 19e0aa0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/workflow/StreamlitUI.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,12 +1110,13 @@ def parameter_section(self, custom_parameter_function) -> None:
11101110

11111111
# Display threads configuration for local mode only
11121112
if not st.session_state.settings.get("online_deployment", False):
1113-
max_threads_config = st.session_state.settings.get("max_threads", {})
1114-
default_threads = max_threads_config.get("local", 4)
1113+
# Initialize session state with default if not set
1114+
if "max_threads_override" not in st.session_state:
1115+
max_threads_config = st.session_state.settings.get("max_threads", {})
1116+
st.session_state.max_threads_override = max_threads_config.get("local", 4)
11151117
st.number_input(
11161118
"Threads",
11171119
min_value=1,
1118-
value=default_threads,
11191120
key="max_threads_override",
11201121
help="Maximum threads for parallel processing. Threads are distributed between parallel commands and per-tool thread allocation."
11211122
)

0 commit comments

Comments
 (0)