Skip to content

Windows: a browser opened by afx from a Codev terminal closes when the session ends #1961

Backlog

Description

@amrmelsayed

Problem

On Windows, a browser that Codev opens from inside a Codev terminal closes when that terminal's session ends.

afx workspace start, afx attach and afx tower connect (cloud login) call openBrowser() (packages/codev/src/agent-farm/utils/shell.ts), which launches the default browser as a child of the afx process. When afx runs in a Codev terminal, that child is inside the session's Job Object. After #1915 (PR #1959) a session job allows no break-away, so:

  • A browser is already running: the URL is handed to the existing browser process, which is outside the job. Nothing changes.
  • No browser is running: the new browser process is a member of the session job. It is ended when the session ends or is cleaned up, with no message.

PR #1959 documents this in DEPENDENCIES.md; it does not change it.

Expected

A browser opened by an afx command outlives the session the command was typed in, as it does on macOS and Linux.

Proposed fix

On Windows, when afx is running inside a session job, start the browser outside the job, the way afx tower start already creates Tower through CIM (agent-farm/commands/windows/tower-lifecycle.ts). Outside a session job, and on other platforms, keep the current open() call.

Scope

Acceptance

  • With no browser running, afx workspace start from a Codev terminal on Windows opens the dashboard, and the browser is still open after that session is closed.
  • A Windows test shows the launched process is not a member of the session job.
  • No behaviour change on macOS or Linux, or on Windows outside a session job.

Activity

  1. added
    bug
    area/tower
    on Nov 24, 2026
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

    area/towerbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions