Skip to content

feat(conversations): Configure workspace_id based on main repository folder for consistent project-wide history #1957

@dariuszkowalski-com

Description

@dariuszkowalski-com

Description

Currently, Forge saves conversations using workspace_id calculated from the current working directory (cwd) of the environment. This means that running Forge commands in subdirectories of a project saves conversations separately, fragmenting conversation history across the project’s folder structure. Conversation history is not unified for the entire project repository.

Current Behavior

  • workspace_id is derived from the current working directory.
  • Conversations started in subdirectories are stored separately and isolated.
  • No visibility of conversations across the main project or other subdirectories.

Proposed Changes

  • Change workspace_id calculation to point to the main repository root folder containing the .git directory.
  • Ensure that navigating and running Forge in any subdirectory under the main project retrieves conversation history relevant to the entire project repository.
  • Make workspace_id resolution configurable with markers like .git, .envrc, or other custom markers similar to the approach used in zsh-per-project-history, where the project root is discovered via configurable tags.
  • Add details about the workspace_id resolution logic and active configuration markers to the /info and /env commands.
  • Provide a new CLI command to inspect how workspace_id is determined for the current environment and project.

Benefits

  • Unified conversation history for entire project repositories regardless of the subdirectory where Forge is run.
  • Improved developer experience by having a consistent workspace context.
  • Flexibility to adapt workspace detection to various project structures or user preferences.

Additional Context

The approach is inspired by plugins like zsh-per-project-history which dynamically detect project roots based on configurable markers to maintain a per-project history. This improves multi-directory workflows within single repositories.

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