Skip to content

Use completed() command for automatic screenshot flow#119

Open
Android-PowerUser wants to merge 1 commit into
add-toggle-button-for-termux-commandsfrom
update-takescreenshot-to-use-completed
Open

Use completed() command for automatic screenshot flow#119
Android-PowerUser wants to merge 1 commit into
add-toggle-button-for-termux-commandsfrom
update-takescreenshot-to-use-completed

Conversation

@Android-PowerUser

Copy link
Copy Markdown
Owner

Motivation

  • Replace the old explicit takeScreenshot() requirement with a completed() signal so the AI can stop automatic screenshot requests when the task is finished.
  • Update the system prompt and runtime flow to make screenshots the default after each AI reply unless completed() is present.

Description

  • Add Command.Completed to the command sealed class and make completed() detectable by the parser and single-instance guarded in CommandParser.
  • Extend PhotoReasoningCommandProcessing to report hasCompletedCommand, and update PhotoReasoningViewModel to automatically append a TakeScreenshot for final execution when neither completed() nor an explicit takeScreenshot() is present, while treating completed() as a termination marker (no accessibility action).
  • Stop incremental command execution when completed() is encountered during streaming and do not dispatch it to accessibility (no-op in ScreenOperatorAccessibilityService).
  • Update default system message in SystemMessagePreferences to instruct use of completed() and to reflect the new behavior "After each message... Say completed() when the task is finished.".
  • Surface completed() in the detected-commands UI and add unit tests to cover completed() parsing in CommandParserTest.

Testing

  • Ran ./gradlew :app:compileDebugKotlin and the build completed successfully (BUILD SUCCESSFUL).
  • Added unit tests in app/src/test/java/com/google/ai/sample/util/CommandParserTest.kt for completed() parsing; these tests were added but not executed in this compile step.

Codex Task

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The implementation of the completed() command is well-structured and comprehensive. All changes correctly integrate the new command across the application stack - from command parsing and execution to UI display and testing. The code functions correctly with no defects found.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant