Skip to content

[bug] init role prompt accepts 1,3 but keeps only the first role #759

Closed

Description

@SaulMoro

Description

The interactive role prompt in teamai init parses a comma list, and its error text asks for "one or more role numbers, separated by commas". init then keeps only the first number and saves additionalRoles: []. Entering 1,3 sets role 1 and drops role 3 without a warning.

parseRoleSelection("1,3")                     [1, 3]   src/init.ts:45
const [primaryIndex] = ...                    1        src/init.ts:117
return { primaryRole, additionalRoles: [] }            src/init.ts:124

Additional roles can only be set later, with teamai roles set <primary> --add <roles...>.

Suggested fix

Accept a single number at the primary role prompt, and point to roles set --add for the rest. Keeping the extra numbers as additionalRoles would also work, but it changes what init installs.

Related: #757, where a project prompt would parse the same kind of list.

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