ADFA-5308 | Sync run_app wait and anchor build output on first error - #82
Open
jatezzz wants to merge 4 commits into
Open
ADFA-5308 | Sync run_app wait and anchor build output on first error#82jatezzz wants to merge 4 commits into
jatezzz wants to merge 4 commits into
Conversation
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.
There was a problem hiding this comment.
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
requested review from
a team,
Daniel-ADFA,
dara-abijo-adfa and
itsaky-adfa
September 1, 2026 18:26
Daniel-ADFA
reviewed
Sep 2, 2026
Daniel-ADFA
reviewed
Sep 2, 2026
…dler logs AgentState now exposes stepNumber/estimatedTotalMillis with ChatFragment rendering them via getString; handlers log once through AgentTrace plus pluginContext.logger.
Daniel-ADFA
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What: Updated the AI agent's build tools to provide accurate, synchronous build feedback.
run_appnow waits for the build to complete, andread_build_outputcaptures the exact compiler errors instead of just the log tail.How:
RunAppHandlerto suspend usingwithTimeoutOrNullandsuspendCancellableCoroutine(up to a 10-minute timeout) while waiting for theBuildAndLaunchCallback, rather than reporting immediate success.ReadBuildOutputHandlerto scan for specific compiler/Gradle error markers and window 8000 characters starting from the first error line.ChatViewModelat 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
ReadBuildOutputHandlerTest,RunAppHandlerTest, andChatViewModelStoreTest) 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
ChatViewModelnow outlives theChatFragment. This was necessary to ensure thatrun_appwait loops aren't killed simply because the user navigated to another tab.clearErrorState()andpersistState()lifecycle hooks were updated accordingly.Depends on appdevforall/CodeOnTheGo#1763