Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/deep_code_agent/tui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Deep Code Agent TUI - Textual-based terminal user interface.

This module provides a rich terminal interface for the Deep Code Agent,
featuring a chat-style conversation view, HITL approval modals, and
featuring a chat-style conversation view, inline HITL approvals, and
real-time streaming responses.

Example:
Expand Down
8 changes: 2 additions & 6 deletions src/deep_code_agent/tui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,8 @@ def action_toggle_dark(self) -> None:

def action_help(self) -> None:
"""Show help."""
self.notify(
"Enter send prompt\nCtrl+L clear chat\nCtrl+D theme\nTab navigate",
title="Help",
severity="information",
timeout=10,
)
if self._main_screen is not None:
self._main_screen.action_help()

def update_session_info(self, session_info: dict) -> None:
"""Update session information."""
Expand Down
16 changes: 3 additions & 13 deletions src/deep_code_agent/tui/bridge/agent_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ async def process_request(self, message: str) -> None:
pass
except Exception as e:
# Dispatch error event
self._run_on_app(self.app.notify, f"[ERROR] {e}", title="Error", severity="error")
import traceback

traceback.print_exc()
Expand All @@ -272,11 +271,11 @@ async def process_request(self, message: str) -> None:
async def resume_with_decision(self, decision: dict) -> None:
"""Resume after HITL decision.

Called when the user has made a decision in the ApprovalModal.
Called when the user has made a HITL approval decision.
Resumes the agent stream with the decision.

Args:
decision: User decision dict from ApprovalModal
decision: User decision dict from the approval UI
"""
if self.stream_handler is None or self.app is None:
return
Expand Down Expand Up @@ -537,21 +536,13 @@ def handle_event() -> None:
asyncio.create_task(self.resume_with_decision({"decisions": decisions}))
return

# Show approval modal
from deep_code_agent.tui.screens.approval_modal import ApprovalModal

def on_decision(decision: dict) -> None:
# Check if tool should be added to auto-approve
if decision.get("add_to_auto_approve", False):
tool_to_add = decision.get("tool_name", tool_name)
if tool_to_add and tool_to_add not in auto_approve_tools:
# We're already in the main thread, so we can set directly
setattr(app, "auto_approve_tools", auto_approve_tools + [tool_to_add])
app.notify(
f"Auto-approve enabled for: {tool_to_add}",
title="Auto-Approve",
severity="information",
)

if "decisions" in decision and isinstance(decision["decisions"], list):
decisions = decision["decisions"]
Expand All @@ -567,8 +558,7 @@ def on_decision(decision: dict) -> None:
decisions = [base for _ in range(self._pending_hitl_action_count)]
asyncio.create_task(self.resume_with_decision({"decisions": decisions}))

modal = ApprovalModal(interrupt_data, callback=on_decision)
app.push_screen(modal)
chat_log.add_approval_request(interrupt_data, callback=on_decision)

elif event.type == EventType.ERROR:
self._reset_streaming_state()
Expand Down
307 changes: 0 additions & 307 deletions src/deep_code_agent/tui/screens/approval_modal.py

This file was deleted.

Loading
Loading