Skip to content

ADFA-6337 | Add run_gradle_task tool for AI agent - #123

Open
jatezzz wants to merge 2 commits into
mainfrom
feat/ADFA-6337-agent-run-gradle-task
Open

jatezzz wants to merge 2 commits into
mainfrom
feat/ADFA-6337-agent-run-gradle-task

Conversation

@jatezzz

@jatezzz jatezzz commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR introduces the run_gradle_task tool to the AI-Core plugin, enabling the AI agent to execute arbitrary Gradle tasks such as test, lint, and clean. The agent can pass specific task names alongside Gradle arguments, allowing it to act independently without the user having to run tasks manually. Tasks are executed on the IDE's own tooling server and gated behind an approval dialog. The tool processes task success, failure, refusal, and cancellation, returning the relevant build output, test failures, or compiler errors directly to the agent. It also informs the agent how to proceed using --rerun if tasks are skipped because they are up to date.

Details

  • Implemented RunGradleTaskHandler to execute tasks and monitor build completion using the IDE's IdeBuildService.
  • Created GradleCommandLine to properly parse tasks and arguments, ensuring leading Gradle options are separated correctly.
  • Updated tool_descriptions.yml to instruct the model on how and when to use the run_gradle_task tool.
  • Bumped the AI-Core plugin version to 3.3.0 (version code 7).
  • Added comprehensive unit tests for argument parsing and the Gradle task handler.

Demo

https://drive.google.com/file/d/1KUp_BW-GYEgDHAd2Te-tnFMiBLUNMtqB/view?usp=sharing

Ticket

ADFA-6337

Observation

appdevforall/CodeOnTheGo#2110 Must be merged first

New run_gradle_task runs tasks with arguments such as --tests or --rerun, returns build output, cancels on Stop and reruns on repeat requests. GradleCommandLine parses leading options, spaced list entries, colour codes and wrapped host errors; build wait limits move to BuildWait.kt. The chat-history write scope now closes on dispose once queued writes finish.

Refs: ADFA-6337
@jatezzz
jatezzz requested review from a team, Daniel-ADFA and itsaky-adfa October 6, 2026 21:39
Lists the project's tasks by group from the last sync, filterable by path, group or description, kept within the 4000-char tool-result cap.

Refs: ADFA-6337
@jatezzz
jatezzz requested a review from hal-eisen-adfa October 6, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants