Skip to content

Commit 60adb94

Browse files
authored
Merge pull request #751 from srtab/feat/git-platform-tools
Added gitlab specialized tool.
2 parents 735bda8 + 02addd3 commit 60adb94

77 files changed

Lines changed: 2047 additions & 2249 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/extensions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@
99
"eamodio.gitlens",
1010
"charliermarsh.ruff",
1111
"tamasfe.even-better-toml",
12-
"ms-ossdata.vscode-pgsql",
1312
]
1413
}

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ DAIV is an AI-powered development assistant built on Django with Django Tasks fo
99
* `codebase/` - Codebase module with all the repository interaction and related logic.
1010
* `chat/` - Chat module with the OpenAI compatible API.
1111
* `core/` - Core module with common logic.
12-
* `quick_actions/` - Quick actions module.
12+
* `slash_commands/` - Slash commands module.
1313
* `daiv/` - Main logic of the Django project: settings, urls, wsgi, asgi, tasks, etc.
1414
* `docker/` - Dockerfiles and configurations for local and production deployments.
1515
* `docs/` - Documentation for the project.

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- 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
13+
- Added code review and security audit agent skills for structured review and security guidance.
1314
- Added support for issue labels to configure plan and execute agent behavior:
1415
- `daiv-auto`: Automatically approve the plan and proceed with implementation without manual approval
1516
- `daiv-max`: Use high-performance mode with `CLAUDE_OPUS_4_5` model and `HIGH` thinking level for both planning and execution
@@ -20,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2021
### Changed
2122

2223
- Improved documentation for Review Addressor with clear examples showing how to address code review comments using direct mentions (`@daiv <request>`).
23-
- Added comparison table to Quick Actions documentation clarifying the difference between slash commands and direct mentions.
24+
- Added comparison table to Slash Commands documentation clarifying the difference between slash commands and direct mentions.
2425
- Added configuration section to Issue Addressor documentation with `.daiv.yml` snippets for enabling automated issue resolution and plan approval workflow.
2526
- Updated the `generating-agents-md` skill prompt to align with the AGENTS.md creation guidance format.
2627
- 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.
@@ -46,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4647
- Removed builtin `maintaining-changelog` skill in favor of the new changelog subagent
4748
- 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.
4849
- Removed Celery worker configuration and bootstrap scripts.
50+
- Removed the `quick_actions` Django app, templates, and tests in favor of the `slash_commands` module.
4951

5052
## [1.1.0] - 2025-12-04
5153

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ DAIV is an open-source automation assistant designed to enhance developer produc
1515
- 💬 **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.
1616
- 🧠 **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).
1717
- ⚙️ **Configurable Behavior**: A `.daiv.yml` file in your repo's default branch lets you tailor DAIV's features (like toggling auto-issue addressing).
18-
-**Quick Actions**: Command-based interactions for common tasks on issues and merge requests, such as regenerating plan, approving plan, repairing pipeline, etc.
18+
-**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.
1919
- 🔧 **MCP Tools**: Supporting [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) tools to extend the capabilities of the agents.
2020
- 🎯 **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.
2121
- 📦 **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.

daiv/automation/agent/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class DAIVAgentSettings(BaseSettings):
1414

1515
RECURSION_LIMIT: int = Field(default=500, description="Recursion limit for the agent.")
1616
MODEL_NAME: ModelName | str = Field(
17-
default=ModelName.CLAUDE_SONNET_4_5,
17+
default=ModelName.Z_AI_GLM_4_7,
1818
description="Model for tasks, a multi-modal (image and text) model with capabilities to call tools.",
1919
)
2020
FALLBACK_MODEL_NAME: ModelName | str = Field(

daiv/automation/agent/constants.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22

33
from daiv.settings.components import PROJECT_DIR
44

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

8-
# Path where the project skills are stored in repository.
9-
PROJECT_SKILLS_PATH = ".daiv/skills"
8+
# Path where the skills are stored in repository.
9+
DAIV_SKILLS_PATH = ".daiv/skills"
10+
CURSOR_SKILLS_PATH = ".cursor/skills"
11+
CLAUDE_CODER_SKILLS_PATH = ".claude/skills"
1012

11-
# Path where the project memory is stored in repository.
12-
PROJECT_MEMORY_PATH = ".daiv/AGENTS.md"
13+
# Paths where the skills are stored in repository.
14+
SKILLS_SOURCES = [DAIV_SKILLS_PATH, CURSOR_SKILLS_PATH, CLAUDE_CODER_SKILLS_PATH]
15+
16+
# Path where the memory is stored in repository.
17+
DAIV_MEMORY_PATH = ".daiv/AGENTS.md"
1318

1419

1520
class ModelName(StrEnum):

daiv/automation/agent/graph.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525

2626
from automation.agent.base import BaseAgent, ThinkingLevel
2727
from automation.agent.conf import settings
28-
from automation.agent.constants import PROJECT_MEMORY_PATH, PROJECT_SKILLS_PATH
28+
from automation.agent.constants import DAIV_MEMORY_PATH, SKILLS_SOURCES
2929
from automation.agent.mcp.toolkits import MCPToolkit
3030
from automation.agent.middlewares.file_system import FilesystemMiddleware
31+
from automation.agent.middlewares.git import GitMiddleware
3132
from automation.agent.middlewares.git_platform import GitPlatformMiddleware
3233
from automation.agent.middlewares.logging import ToolCallLoggingMiddleware
3334
from automation.agent.middlewares.prompt_cache import AnthropicPromptCachingMiddleware
@@ -42,6 +43,7 @@
4243
create_general_purpose_subagent,
4344
)
4445
from automation.conf import settings as automation_settings
46+
from codebase.base import Scope
4547
from codebase.context import RuntimeCtx, set_runtime_ctx
4648
from core.constants import BOT_NAME
4749

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

8487
system_prompt = await DAIV_SYSTEM_PROMPT.aformat(
8588
current_date_time=timezone.now().strftime("%d %B, %Y"),
@@ -88,6 +91,7 @@ async def dynamic_daiv_system_prompt(request: ModelRequest) -> str:
8891
repository=request.runtime.context.repo_id,
8992
git_platform=request.runtime.context.git_platform.value,
9093
bash_tool_enabled=BASH_TOOL_NAME in tool_names,
94+
working_directory=f"/{agent_path.name}/",
9195
)
9296
return (
9397
BASE_AGENT_PROMPT
@@ -181,9 +185,9 @@ async def create_daiv_agent(
181185
),
182186
MemoryMiddleware(
183187
backend=backend,
184-
sources=[f"/{agent_path.name}/{ctx.config.context_file_name}", f"/{agent_path.name}/{PROJECT_MEMORY_PATH}"],
188+
sources=[f"/{agent_path.name}/{ctx.config.context_file_name}", f"/{agent_path.name}/{DAIV_MEMORY_PATH}"],
185189
),
186-
SkillsMiddleware(backend=backend, sources=[f"/{agent_path.name}/{PROJECT_SKILLS_PATH}"]),
190+
SkillsMiddleware(backend=backend, sources=[f"/{agent_path.name}/{source}" for source in SKILLS_SOURCES]),
187191
SubAgentMiddleware(
188192
default_model=model,
189193
default_middleware=subagent_default_middlewares,
@@ -196,7 +200,8 @@ async def create_daiv_agent(
196200
),
197201
*agent_conditional_middlewares,
198202
FilesystemMiddleware(backend=backend),
199-
GitPlatformMiddleware(auto_commit_changes=auto_commit_changes),
203+
GitMiddleware(auto_commit_changes=auto_commit_changes),
204+
GitPlatformMiddleware(),
200205
SummarizationMiddleware(
201206
model=model, trigger=summarization_trigger, keep=summarization_keep, trim_tokens_to_summarize=None
202207
),
@@ -230,12 +235,9 @@ async def main():
230235
wrap_lines=True,
231236
reserve_space_for_menu=7, # Reserve space for completion menu to show 5-6 results
232237
)
233-
async with set_runtime_ctx(repo_id="srtab/daiv", ref="main") as ctx:
238+
async with set_runtime_ctx(repo_id="srtab/daiv", scope=Scope.GLOBAL, ref="main") as ctx:
234239
agent = await create_daiv_agent(
235-
ctx=ctx,
236-
model_names=["openrouter:minimax/minimax-m2.1"],
237-
store=InMemoryStore(),
238-
checkpointer=InMemorySaver(),
240+
ctx=ctx, model_names=["openrouter:z-ai/glm-4.7"], store=InMemoryStore(), checkpointer=InMemorySaver()
239241
)
240242
while True:
241243
user_input = await session.prompt_async()
Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +0,0 @@
1-
import logging
2-
3-
from langchain_core.tools import tool
4-
5-
logger = logging.getLogger("daiv.tools")
6-
7-
# https://www.anthropic.com/engineering/claude-think-tool
8-
9-
THINK_TOOL_NAME = "think"
10-
11-
12-
@tool(THINK_TOOL_NAME, parse_docstring=True)
13-
def think_tool(thought: str):
14-
"""
15-
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.
16-
17-
Args:
18-
thought (str): Your private thoughts.
19-
20-
Returns:
21-
A message indicating that the thought has been logged.
22-
""" # noqa: E501
23-
logger.info("[%s] Thinking about: %s", think_tool.name, thought)
24-
return "Thought registered."

daiv/automation/agent/middlewares/file_system.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030

3131
DAIV_FILESYSTEM_SYSTEM_PROMPT = SystemMessagePromptTemplate.from_template(
3232
"""\
33-
## Filesystem Tools `ls`, `read_file`, {{#read_only}}write_file`, `edit_file`, {{/read_only}}`glob`, `grep`
33+
## Filesystem Tools
3434
3535
You have access to a filesystem which you can interact with using these tools.
36-
Tool-call arguments (ls/read_file{{#read_only}}/edit_file{{/read_only}}/etc.) MUST use absolute paths (start with "/").
36+
Tool-call arguments (ls/read_file{{^read_only}}/edit_file{{/read_only}}/etc.) MUST use absolute paths (start with "/").
3737
User-visible output MUST NEVER contain "/repo/" and MUST use repo-relative paths.
3838
3939
- ls: list files in a directory

0 commit comments

Comments
 (0)