Skip to content

feat: /setproject command to bind codebase to conversation #1044

@CryptixSamurai

Description

@CryptixSamurai

Problem

There's no way to bind a registered codebase to a specific conversation via chat. The AI router auto-selects projects per-message via /invoke-workflow --project, but doesn't persist the binding on the conversation record.

This is especially needed for Telegram Forum Topics where each topic should be permanently linked to a project. Currently users must mention the project name in every message.

Proposed Solution

Add a /setproject <name> deterministic command that:

  1. Looks up the codebase by name (case-insensitive, partial match like findCodebaseByName)
  2. Updates conversation.codebase_id in the database
  3. Updates conversation.cwd to the codebase's default_cwd
  4. Returns confirmation: "Project set to {name}"

Context

Forum Topics support was added to the Telegram adapter (each topic gets a unique chatId:threadId conversation ID). But without /setproject, each topic conversation starts with codebase_id: null and the user must mention the project name explicitly.

Files to Change

  • packages/core/src/handlers/command-handler.ts — add setproject case
  • packages/core/src/orchestrator/orchestrator-agent.ts — add to deterministic command list

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority - Backlog, when time permitsarea: handlersCommand handlereffort/lowSingle file or function, one responsibility, isolated changefeature-requestNew functionality (external suggestion, needs review)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions