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
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
"eamodio.gitlens",
"charliermarsh.ruff",
"tamasfe.even-better-toml",
"ms-ossdata.vscode-pgsql",
]
}
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DAIV is an AI-powered development assistant built on Django with Django Tasks fo
* `codebase/` - Codebase module with all the repository interaction and related logic.
* `chat/` - Chat module with the OpenAI compatible API.
* `core/` - Core module with common logic.
* `quick_actions/` - Quick actions module.
* `slash_commands/` - Slash commands module.
* `daiv/` - Main logic of the Django project: settings, urls, wsgi, asgi, tasks, etc.
* `docker/` - Dockerfiles and configurations for local and production deployments.
* `docs/` - Documentation for the project.
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Added changelog subagent for maintaining changelogs and release notes across any format (CHANGELOG.md, CHANGES.rst, HISTORY.md, NEWS, etc.) with automatic format detection and convention preservation
- Added code review and security audit agent skills for structured review and security guidance.
- Added support for issue labels to configure plan and execute agent behavior:
- `daiv-auto`: Automatically approve the plan and proceed with implementation without manual approval
- `daiv-max`: Use high-performance mode with `CLAUDE_OPUS_4_5` model and `HIGH` thinking level for both planning and execution
Expand All @@ -20,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Improved documentation for Review Addressor with clear examples showing how to address code review comments using direct mentions (`@daiv <request>`).
- Added comparison table to Quick Actions documentation clarifying the difference between slash commands and direct mentions.
- Added comparison table to Slash Commands documentation clarifying the difference between slash commands and direct mentions.
- Added configuration section to Issue Addressor documentation with `.daiv.yml` snippets for enabling automated issue resolution and plan approval workflow.
- Updated the `generating-agents-md` skill prompt to align with the AGENTS.md creation guidance format.
- Updated issue addressing to accept any DAIV label (`daiv`, `daiv-auto`, `daiv-max`) as a trigger. **BREAKING CHANGE**: Issue title prefix (`DAIV:`) is no longer supported as a trigger. Use labels instead.
Expand All @@ -46,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed builtin `maintaining-changelog` skill in favor of the new changelog subagent
- Removed `pull_request.branch_name_convention` from `.daiv.yml` configuration file. **BREAKING CHANGE**: Branch name convention must now be defined in the `AGENTS.md` file instead.
- Removed Celery worker configuration and bootstrap scripts.
- Removed the `quick_actions` Django app, templates, and tests in favor of the `slash_commands` module.

## [1.1.0] - 2025-12-04

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DAIV is an open-source automation assistant designed to enhance developer produc
- 💬 **Code Review Addressor**: Assists with code review comments by providing context-aware answers or directly applying requested changes. This reduces the overhead of going back and forth on merge requests.
- 🧠 **Codebase Chat**: Chat with your codebase for context-aware answers. An OpenAI-compatible API is available for easy integration with tools such as [Open-WebUI](https://github.com/open-webui/open-webui).
- ⚙️ **Configurable Behavior**: A `.daiv.yml` file in your repo's default branch lets you tailor DAIV's features (like toggling auto-issue addressing).
- ⚡ **Quick Actions**: Command-based interactions for common tasks on issues and merge requests, such as regenerating plan, approving plan, repairing pipeline, etc.
- ⚡ **Slash Commands**: Command-based interactions for common tasks on issues and merge requests, such as help to list available commands, cloning issues to multiple repositories, etc.
- 🔧 **MCP Tools**: Supporting [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) tools to extend the capabilities of the agents.
- 🎯 **Agent Skills**: Modular, reusable capabilities that give agents domain-specific expertise. Define custom workflows in your repository's `.daiv/skills/` directory, or use builtin skills like changelog maintenance and AGENTS.md generation.
- 📦 **Sandbox**: Running commands in a secure sandbox to allow the agents to perform actions on the codebase, such as installing/updating dependencies, generating translations, etc. with your own docker image.
Expand Down
2 changes: 1 addition & 1 deletion daiv/automation/agent/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DAIVAgentSettings(BaseSettings):

RECURSION_LIMIT: int = Field(default=500, description="Recursion limit for the agent.")
MODEL_NAME: ModelName | str = Field(
default=ModelName.CLAUDE_SONNET_4_5,
default=ModelName.Z_AI_GLM_4_7,
description="Model for tasks, a multi-modal (image and text) model with capabilities to call tools.",
)
FALLBACK_MODEL_NAME: ModelName | str = Field(
Expand Down
15 changes: 10 additions & 5 deletions daiv/automation/agent/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@

from daiv.settings.components import PROJECT_DIR

# Path where the builtin skills are stored on the filesystem to be copied to the backend.
# Path where the builtin skills are stored in the filesystem to be copied to the repository.
BUILTIN_SKILLS_PATH = PROJECT_DIR / "automation" / "agent" / "skills"

# Path where the project skills are stored in repository.
PROJECT_SKILLS_PATH = ".daiv/skills"
# Path where the skills are stored in repository.
DAIV_SKILLS_PATH = ".daiv/skills"
CURSOR_SKILLS_PATH = ".cursor/skills"
CLAUDE_CODER_SKILLS_PATH = ".claude/skills"

# Path where the project memory is stored in repository.
PROJECT_MEMORY_PATH = ".daiv/AGENTS.md"
# Paths where the skills are stored in repository.
SKILLS_SOURCES = [DAIV_SKILLS_PATH, CURSOR_SKILLS_PATH, CLAUDE_CODER_SKILLS_PATH]

# Path where the memory is stored in repository.
DAIV_MEMORY_PATH = ".daiv/AGENTS.md"


class ModelName(StrEnum):
Expand Down
20 changes: 11 additions & 9 deletions daiv/automation/agent/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@

from automation.agent.base import BaseAgent, ThinkingLevel
from automation.agent.conf import settings
from automation.agent.constants import PROJECT_MEMORY_PATH, PROJECT_SKILLS_PATH
from automation.agent.constants import DAIV_MEMORY_PATH, SKILLS_SOURCES
from automation.agent.mcp.toolkits import MCPToolkit
from automation.agent.middlewares.file_system import FilesystemMiddleware
from automation.agent.middlewares.git import GitMiddleware
from automation.agent.middlewares.git_platform import GitPlatformMiddleware
from automation.agent.middlewares.logging import ToolCallLoggingMiddleware
from automation.agent.middlewares.prompt_cache import AnthropicPromptCachingMiddleware
Expand All @@ -42,6 +43,7 @@
create_general_purpose_subagent,
)
from automation.conf import settings as automation_settings
from codebase.base import Scope
from codebase.context import RuntimeCtx, set_runtime_ctx
from core.constants import BOT_NAME

Expand Down Expand Up @@ -80,6 +82,7 @@ async def dynamic_daiv_system_prompt(request: ModelRequest) -> str:
str: The dynamic prompt for the DAIV system.
"""
tool_names = [tool.name for tool in request.tools]
agent_path = Path(request.runtime.context.repo.working_dir)

system_prompt = await DAIV_SYSTEM_PROMPT.aformat(
current_date_time=timezone.now().strftime("%d %B, %Y"),
Expand All @@ -88,6 +91,7 @@ async def dynamic_daiv_system_prompt(request: ModelRequest) -> str:
repository=request.runtime.context.repo_id,
git_platform=request.runtime.context.git_platform.value,
bash_tool_enabled=BASH_TOOL_NAME in tool_names,
working_directory=f"/{agent_path.name}/",
)
return (
BASE_AGENT_PROMPT
Expand Down Expand Up @@ -181,9 +185,9 @@ async def create_daiv_agent(
),
MemoryMiddleware(
backend=backend,
sources=[f"/{agent_path.name}/{ctx.config.context_file_name}", f"/{agent_path.name}/{PROJECT_MEMORY_PATH}"],
sources=[f"/{agent_path.name}/{ctx.config.context_file_name}", f"/{agent_path.name}/{DAIV_MEMORY_PATH}"],
),
SkillsMiddleware(backend=backend, sources=[f"/{agent_path.name}/{PROJECT_SKILLS_PATH}"]),
SkillsMiddleware(backend=backend, sources=[f"/{agent_path.name}/{source}" for source in SKILLS_SOURCES]),
SubAgentMiddleware(
default_model=model,
default_middleware=subagent_default_middlewares,
Expand All @@ -196,7 +200,8 @@ async def create_daiv_agent(
),
*agent_conditional_middlewares,
FilesystemMiddleware(backend=backend),
GitPlatformMiddleware(auto_commit_changes=auto_commit_changes),
GitMiddleware(auto_commit_changes=auto_commit_changes),
GitPlatformMiddleware(),
SummarizationMiddleware(
model=model, trigger=summarization_trigger, keep=summarization_keep, trim_tokens_to_summarize=None
),
Expand Down Expand Up @@ -230,12 +235,9 @@ async def main():
wrap_lines=True,
reserve_space_for_menu=7, # Reserve space for completion menu to show 5-6 results
)
async with set_runtime_ctx(repo_id="srtab/daiv", ref="main") as ctx:
async with set_runtime_ctx(repo_id="srtab/daiv", scope=Scope.GLOBAL, ref="main") as ctx:
agent = await create_daiv_agent(
ctx=ctx,
model_names=["openrouter:minimax/minimax-m2.1"],
store=InMemoryStore(),
checkpointer=InMemorySaver(),
ctx=ctx, model_names=["openrouter:z-ai/glm-4.7"], store=InMemoryStore(), checkpointer=InMemorySaver()
)
while True:
user_input = await session.prompt_async()
Expand Down
24 changes: 0 additions & 24 deletions daiv/automation/agent/middlewares/__init__.py
Original file line number Diff line number Diff line change
@@ -1,24 +0,0 @@
import logging

from langchain_core.tools import tool

logger = logging.getLogger("daiv.tools")

# https://www.anthropic.com/engineering/claude-think-tool

THINK_TOOL_NAME = "think"


@tool(THINK_TOOL_NAME, parse_docstring=True)
def think_tool(thought: str):
"""
Use the tool to think about something in private. It will not obtain new information or make any changes, but just log the thought. Use it when complex reasoning or brainstorming is needed. Use it as a private scratchpad.

Args:
thought (str): Your private thoughts.

Returns:
A message indicating that the thought has been logged.
""" # noqa: E501
logger.info("[%s] Thinking about: %s", think_tool.name, thought)
return "Thought registered."
4 changes: 2 additions & 2 deletions daiv/automation/agent/middlewares/file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@

DAIV_FILESYSTEM_SYSTEM_PROMPT = SystemMessagePromptTemplate.from_template(
"""\
## Filesystem Tools `ls`, `read_file`, {{#read_only}}write_file`, `edit_file`, {{/read_only}}`glob`, `grep`
## Filesystem Tools

You have access to a filesystem which you can interact with using these tools.
Tool-call arguments (ls/read_file{{#read_only}}/edit_file{{/read_only}}/etc.) MUST use absolute paths (start with "/").
Tool-call arguments (ls/read_file{{^read_only}}/edit_file{{/read_only}}/etc.) MUST use absolute paths (start with "/").
User-visible output MUST NEVER contain "/repo/" and MUST use repo-relative paths.

- ls: list files in a directory
Expand Down
Loading
Loading