Skip to content

[BUG] A window app launched as a background shell on a computer holds the run open #1785

Closed

Description

@edenreich

Summary

On a computer (a workspace with computer use enabled), a window app that the agent launches as a detached background shell keeps the run open after the agent has given its final answer. waitForBackgroundTasks (internal/agent/loop/utils.go) counts the app as a pending background task and blocks the completion boundary until the app exits or a2a.task.agent_mode_max_wait_seconds (300 s) passes. A window app is meant to stay open, so the session looks stuck: clients such as the Desktop app show it as running the whole time.

Observed on v0.252.0 with the ghcr.io/inference-gateway/computer:0.252.0 image.

The scope of this bug is window apps on a computer only. Regular background shells (builds, servers, long scripts started with detached: true) must keep holding the run exactly as they do today.

Steps to Reproduce

  1. Start a session on a computer workspace (computer use enabled, headless GNOME session).
  2. Ask the agent to open a terminal window and run a command in it.
  3. The agent launches the window app with Bash and detached: true (in the observed run: gnome-terminal-server --app-id org.gnome.Terminal), drives the window with the Computer tool and gives its final answer.
  4. Watch the run after the final answer.

Expected Behavior

The run completes as soon as the agent has answered. A window app launched on the computer's display is not work the run is waiting on - it stays open for the user and for later turns. If it exits later, its completion note can start a new turn, as background notes already do.

Regular background shells are unchanged: the run still waits for them at the completion boundary.

Actual Behavior

The run stays open after the final answer. From the worker log of the observed session:

22:41:55  assistant gives its final answer
22:41:55  waiting for pending background tasks before completing  running_jobs=1 max_wait_seconds=300
22:44:23  [Background Shell Completed: shell-d2d641e8]  Duration: 2m40.723s   (gnome-terminal-server exited)
22:44:42  Completing -> Idle

The session was held for about two and a half minutes with nothing left to do, and would have been held for the full 300 s if the window had stayed open.

Notes

  • The CLI needs a way to tell a window app from a regular background shell. Possible signals: the session runs with computer use enabled and the detached process is a client of the computer's display, or an explicit marker on the Bash call. The choice is open.
  • Related, same session: the computer image has no UTF-8 locale, so gnome-terminal failed four times before the agent started the terminal server by hand. That is why the agent ended up with a long-lived detached server in the first place. Tracked in [BUG] gnome-terminal cannot start on the computer image - no UTF-8 locale #1786.

Activity

  1. added
    bug
    on Nov 9, 2026
  2. added theissue type on Nov 9, 2026
  3. moved this from Todo to In progress in 2026on Nov 9, 2026
  4. moved this from In progress to QA in 2026on Nov 9, 2026
  5. moved this from QA to Done in 2026on Nov 9, 2026
  6. inference-gateway-releaser commented on Nov 10, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.253.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleased

    Type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions