Skip to content

Spec generation lacks an in-flight signal — "Generate spec" can start duplicate turns #151

Description

@hevayo

Tracking a known gap deferred from #150 ("Generate spec" CTA).

Problem

The "Generate spec" CTA (#150) starts a room-scoped agent turn that writes requirements/requirements.md into the live collab doc. That doc only commits ~60s later (committer debounce), and hasSpec on GET /projects/{p}/status is computed from git HEAD — so hasSpec stays false for the whole generation window. If the user navigates back to the project overview mid-generation, the Spec card still shows "Generate spec", and a second click starts a duplicate, racing turn against the same room.

#150 ships without a guard (deliberately, to keep it simple).

Proposed fix (later)

A BE-side in-flight signal so the console can reliably disable the CTA while generation is running — e.g. ProjectStatus reflects a "generating"/in-progress state (a phase value or a dedicated boolean) that flips when a generation turn is dispatched and clears when it commits or fails. The console then renders a disabled "Generating…" state instead of the CTA.

Client-only alternatives considered and rejected for now: reading the agent-chat store's active-turn state (couples the card to the chat feature), or a localStorage "generation-started" flag (goes stale if a turn fails). A BE signal is the durable fix.

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    consoleAEP Console (apps/console) work

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions