Skip to content

ADFA-5308 | Sync run_app wait and anchor build output on first error - #82

Open
jatezzz wants to merge 4 commits into
mainfrom
feat/ADFA-5308-agent-real-build-log
Open

ADFA-5308 | Sync run_app wait and anchor build output on first error#82
jatezzz wants to merge 4 commits into
mainfrom
feat/ADFA-5308-agent-real-build-log

Conversation

@jatezzz

@jatezzz jatezzz commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

What: Updated the AI agent's build tools to provide accurate, synchronous build feedback. run_app now waits for the build to complete, and read_build_output captures the exact compiler errors instead of just the log tail.

How:

  • Modified RunAppHandler to suspend using withTimeoutOrNull and suspendCancellableCoroutine (up to a 10-minute timeout) while waiting for the BuildAndLaunchCallback, rather than reporting immediate success.
  • Removed the dead tooling-server retry loop.
  • Updated ReadBuildOutputHandler to scan for specific compiler/Gradle error markers and window 8000 characters starting from the first error line.
  • Scoped ChatViewModel at the plugin level rather than the fragment level so an ongoing 10-minute build wait isn't canceled if the user switches bottom-sheet tabs.

Why: The agent requires precise compiler feedback to iterate and self-correct. Previously, reporting success before the build ran meant the agent never learned if its code was broken. Furthermore, truncating the log to the very end meant the agent only saw the closing Gradle summary rather than the actual unresolved references.

Details

  • Logic-related: Added extensive unit tests (ReadBuildOutputHandlerTest, RunAppHandlerTest, and ChatViewModelStoreTest) verifying 8000-character budget truncation, error-anchored windows, missing callbacks, and view-model retention across tab switches.

DEMO

Ticket

ADFA-5308
Parent ADFA-5216

Observation

  • The ChatViewModel now outlives the ChatFragment. This was necessary to ensure that run_app wait loops aren't killed simply because the user navigated to another tab. clearErrorState() and persistState() lifecycle hooks were updated accordingly.

Depends on appdevforall/CodeOnTheGo#1763

read_build_output anchors on the first error and run_app waits for the build callback, surviving chat-view teardown; self-answered tool calls are ignored.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

jatezzz and others added 2 commits September 2, 2026 08:33
…dler logs

AgentState now exposes stepNumber/estimatedTotalMillis with ChatFragment rendering
them via getString; handlers log once through AgentTrace plus pluginContext.logger.
@jatezzz
jatezzz requested a review from Daniel-ADFA September 2, 2026 14:02
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