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
4 changes: 3 additions & 1 deletion codetide/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Optional, List, Tuple, Union, Dict
from datetime import datetime, timezone
from pathlib import Path
import traceback
import asyncio
import pygit2
import time
Expand Down Expand Up @@ -292,7 +293,7 @@ async def _process_single_file(
logger.debug(f"Processing file: {filepath}")
return await parser.parse_file(filepath, self.rootpath)
except Exception as e:
logger.warning(f"Failed to process {filepath}: {str(e)}")
logger.warning(f"Failed to process {filepath}: {str(e)}\n\n{traceback.format_exc()}")
return None

def _add_results_to_codebase(
Expand Down Expand Up @@ -419,6 +420,7 @@ def _get_changed_files(self) -> Tuple[List[Path], bool]:
# Check for deleted files
for stored_file_path in self.files:
if stored_file_path not in files:
logger.info(f"detected deletion: {stored_file_path}")
file_deletion_detected = True
break

Expand Down
8 changes: 8 additions & 0 deletions codetide/agents/tide/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,14 @@
Ensure high coverage by including unit, integration, and end-to-end tests that address edge cases and follow best practices.
"""


CMD_BRAINSTORM_PROMPT = """
You are strictly prohibited from writing or generating any code until the user explicitly asks you to do so.
For now, you must put on the hat of a solutions architect: your role is to discuss, brainstorm, and collaboratively explore possible solutions, architectures, and implementation strategies with the user.
Ask clarifying questions, propose alternatives, and help the user refine requirements or approaches.
Maintain a conversational flow, encourage user input, and do not proceed to code generation under any circumstances until the user gives a clear instruction to generate code.
"""

CMD_CODE_REVIEW_PROMPT = """
Review the following code submission for bugs, style inconsistencies, and performance issues.
Provide specific, actionable feedback to improve code quality, maintainability, and adherence to established coding standards.
Expand Down
5 changes: 5 additions & 0 deletions codetide/agents/tide/ui/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .app import serve

__all__ = [
"serve"
]
8 changes: 5 additions & 3 deletions codetide/agents/tide/ui/agent_tide_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Install it with: pip install codetide[agents-ui]"
) from e

from codetide.agents.tide.prompts import CMD_CODE_REVIEW_PROMPT, CMD_COMMIT_PROMPT, CMD_TRIGGER_PLANNING_STEPS, CMD_WRITE_TESTS_PROMPT
from codetide.agents.tide.prompts import CMD_BRAINSTORM_PROMPT, CMD_CODE_REVIEW_PROMPT, CMD_COMMIT_PROMPT, CMD_TRIGGER_PLANNING_STEPS, CMD_WRITE_TESTS_PROMPT
from codetide.agents.tide.defaults import DEFAULT_AGENT_TIDE_LLM_CONFIG_PATH
from codetide.agents.tide.ui.defaults import PLACEHOLDER_LLM_CONFIG
from codetide.agents.tide.agent import AgentTide
Expand Down Expand Up @@ -42,15 +42,17 @@ def __init__(self, project_path: Path = Path("./"), history :Optional[list]=None
"plan": CMD_TRIGGER_PLANNING_STEPS,
"review": CMD_CODE_REVIEW_PROMPT,
"test": CMD_WRITE_TESTS_PROMPT,
"commit": CMD_COMMIT_PROMPT
"commit": CMD_COMMIT_PROMPT,
"brainstorm": CMD_BRAINSTORM_PROMPT
}
self.session_id = session_id if session_id else ulid()

commands = [
{"id": "review", "icon": "search-check", "description": "Review file(s) or object(s)"},
{"id": "test", "icon": "flask-conical", "description": "Test file(s) or object(s)"},
{"id": "commit", "icon": "git-commit", "description": "Commit changed files"},
{"id": "plan", "icon": "notepad-text-dashed", "description": "Create a step-by-step task plan"}
{"id": "plan", "icon": "notepad-text-dashed", "description": "Create a step-by-step task plan"},
{"id": "brainstorm", "icon": "brain-circuit", "description": "Brainstorm and discuss solutions (no code generation)"}
]

async def load(self):
Expand Down
18 changes: 17 additions & 1 deletion codetide/agents/tide/ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,23 @@ def serve(


def main():
parser = argparse.ArgumentParser(description="Launch the Tide UI server.")
parser = argparse.ArgumentParser(
description="Launch the Tide UI server.",
epilog=(
"\nAvailable commands and what they do:\n"
" --host Host to bind to (default: None)\n"
" --port Port to bind to (default: 9753)\n"
" --root-path Root path for the app (default: None)\n"
" --ssl-certfile Path to SSL certificate file (default: None)\n"
" --ssl-keyfile Path to SSL key file (default: None)\n"
" --ws-per-message-deflate WebSocket per-message deflate (true/false, default: true)\n"
" --ws-protocol WebSocket protocol (default: auto)\n"
" --project-path Path to the project directory (default: ./)\n"
" --config-path Path to the config file (default: .agent_tide_config.yml)\n"
" -h, --help Show this help message and exit\n"
),
formatter_class=argparse.RawDescriptionHelpFormatter
)
parser.add_argument("--host", type=str, default=None, help="Host to bind to")
parser.add_argument("--port", type=int, default=AGENT_TIDE_PORT, help="Port to bind to")
parser.add_argument("--root-path", type=str, default=None, help="Root path for the app")
Expand Down
Empty file added codetide/search/__init__.py
Empty file.