From da236ce14e83ddf1c9cde65c6eff9ccf1bf9f2bb Mon Sep 17 00:00:00 2001 From: Irina Rueegg Date: Thu, 28 May 2026 09:46:20 +0200 Subject: [PATCH 1/2] toggle file context --- frontend/chat.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/chat.py b/frontend/chat.py index 8ad1ffd..6064c94 100644 --- a/frontend/chat.py +++ b/frontend/chat.py @@ -545,15 +545,16 @@ def render_normal_chat(): # 5h — Settings expander: file context toggle, model, token limit, custom prompt. with st.expander("⚙️ Settings", expanded=False): - st.toggle("Include current file as context", key="include_file_context", value=True) + current_file = st.session_state.get("active_file") + if current_file: + st.toggle(f"Include current file as context: **{Path(current_file).name}**", key="include_file_context", value=True) + st.divider() default_model = chat_manager.model or "" model_options = [default_model] if default_model else [] - for m in ["claude-3-5-sonnet-20241022", "claude-3-haiku-20240307", "gpt-4o", "gpt-4o-mini"]: - if m not in model_options: - model_options.append(m) + st.selectbox("Model", model_options, key="selected_model") st.slider( From ea0543715424ffbc0fff86a2ab746a1a03c2cdc1 Mon Sep 17 00:00:00 2001 From: Irina Rueegg Date: Thu, 28 May 2026 10:10:25 +0200 Subject: [PATCH 2/2] remove rejection feedback after onclick --- frontend/chat.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/chat.py b/frontend/chat.py index 6064c94..decf29c 100644 --- a/frontend/chat.py +++ b/frontend/chat.py @@ -85,6 +85,12 @@ def _reject_action(feedback: str): st.session_state.agent_pending_action = next_action st.session_state.agent_status = "waiting_approval" +def _handle_reject(): + feedback = st.session_state.agent_reject_feedback + with st.spinner("Agent is replanning..."): + _reject_action(feedback) + st.session_state.agent_reject_feedback = "" + def _followup_agent(question: str): """Continue a finished task by injecting a follow-up question and resuming the loop.""" @@ -225,7 +231,10 @@ def render_agent_mode(): if args: _render_arguments(args) - feedback = st.text_input( + if "agent_reject_feedback" not in st.session_state: + st.session_state.agent_reject_feedback = "" + + st.text_input( "Rejection feedback (optional):", key="agent_reject_feedback", placeholder="e.g. Use a different approach...", @@ -238,10 +247,11 @@ def render_agent_mode(): _approve_action() st.rerun() with col2: - if st.button("Reject", use_container_width=True): - with st.spinner("Agent is replanning..."): - _reject_action(feedback) - st.rerun() + st.button( + "Reject", + use_container_width=True, + on_click=_handle_reject, + ) with col3: if st.button("Abort Task", use_container_width=True): _reset_agent()