Skip to content

Agent availability is detected once at startup and never refreshed #20

Open

Description

@anildukkipatty

What happens

src/server.ts:482-490 probes the three CLIs once at boot and builds availableAgents. That array is captured in a closure and handed to every request (:502); GET /agents just echoes it (src/server-common.ts:529-532). It is never re-evaluated.

Installing an agent while gitbot is running therefore has no effect until a restart, and nothing in the UI or the logs says so.

Why it matters

Pairs badly with #19. Once the app starts telling people "install Claude Code", the very next thing they do is install it, reload the page, and find nothing has changed.

README.md:184 already documents the restart requirement as a troubleshooting row, which is a sign the behaviour surprises people.

Suggested fix

Re-probe in the GET /agents handler rather than serving the boot-time snapshot. The probes are three execSync("<cli> --version") calls; if per-request cost is a concern, cache with a short TTL.

Note the request path also reads availableAgents for its own guards (src/server.ts:252, :299), so those should read from the same refreshed source.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions