Skip to content

Stop-Button bei AI-completed() wieder in Textfeld umwandeln#121

Open
Android-PowerUser wants to merge 1 commit into
improve-commandparser-robustnessfrom
change-stop-button-to-text-field-after-completed
Open

Stop-Button bei AI-completed() wieder in Textfeld umwandeln#121
Android-PowerUser wants to merge 1 commit into
improve-commandparser-robustnessfrom
change-stop-button-to-text-field-after-completed

Conversation

@Android-PowerUser

Copy link
Copy Markdown
Owner

Motivation

  • Wenn die KI completed() sendet, bleibt aktuell der Stop-Button sichtbar, obwohl die UI wieder das Eingabefeld zeigen sollte; das führt zu falscher Bedienbarkeit und zu neuen Pending-Antworten bei nachfolgenden Stream-Chunks.

Description

  • Füge eine Completion-Flag-Variable isTaskCompletedByAi hinzu und berücksichtige sie in der Generierungs-Status-Abfrage (isGenerationRunning()) so dass die UI nicht mehr als "laufend" gilt, sobald die KI completed() signalisiert.
  • Ignoriere nach completed() eintreffende Streaming-Chunks und blockiere deren Erzeugung einer neuen pending AI-Nachricht (aiResultStreamReceiver und Stream-Handler in Offline/Live/Cerebras/Puter/Mistral-Pfaden).
  • Markiere die Aufgabe bei Erkennung von Command.Completed via markTaskCompletedByAi(responseText) und aktualisiere die bestehende Modell-Nachricht mit dem finalen Text anstatt eine neue hinzuzufügen (updateLastModelMessageAfterAiCompletion).
  • Setze das Completion-Flag beim Zurücksetzen des Streaming-Zustands zurück (resetStreamingCommandState()), damit neue Runs normal funktionieren.
  • Betroffene Datei: app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt.

Testing

  • Build: ./gradlew :app:compileDebugKotlin wurde ausgeführt und war erfolgreich (kein Compile-Error).
  • Es wurden nur Kompilierungsprüfungen ausgeführt; es existieren projektweite Deprecation-/Opt-in-Warnungen, jedoch keine Fehler, die mit dieser Änderung zusammenhängen.

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 correctly addresses the issue where the stop button remained visible after the AI sent completed(). The changes properly introduce the isTaskCompletedByAi flag and use it to control UI state and ignore post-completion streaming chunks. The flag is reset appropriately in resetStreamingCommandState() to ensure new runs function normally. The implementation is clean and follows good practices with no defects that block merge.


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