Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[bug] renaming team: in teamai.yaml orphans members' model gateway keys

Closed
#894 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
cli

Research direction

Start in src/models/profile.ts, especially getTeamValuesPath and getTeamIdentity, then trace how teamai models switch records and reads the team profile. Reproduce the rename scenario from the issue and inspect the existing model-store tests. Done means an existing key resolves after changing team: and models switch state remains stable.

Written by the indexing model from the issue text.

Description

bug help wanted

Description

Renaming the team's display name orphans every member's model gateway key for that team.

getTeamValuesPath(localConfig)                        src/models/profile.ts
  ~/.teamai/models/teams/<slug of teamai.yaml `team:`>-<hash of repo identity>.json
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
admin: team: Work  →  team: Work Engineering          same repo, same hash, new slug
member's next command reads  …/work-engineering-<hash>.json   (empty)
  → "Profile team:… has no API key. Run `teamai models configure …`"; the stored key sits in …/work-<hash>.json

getTeamIdentity is the file's basename and teamai models switch records it, so the rename also breaks that record.

Expected: the key follows the repository, not its display name.

Proposed fix: look the file up by the hash (*-<hash>.json) and rename it to the current slug when found; or key it by the hash alone and keep the display name inside the file. Either way, migrate an existing <old-slug>-<hash>.json on first read, and keep getTeamIdentity stable across a rename (tests: rename team: → the key still resolves; models switch state still matches).

Reproduction

  1. A team repo with team: Work and a model profile; teamai models configure team:<ref> --api-key-stdin.
  2. Change team: to Work Engineering in teamai.yaml, push, and teamai pull as the member.
  3. teamai models list shows the key as not configured.

Environment

  • OS: macOS 27.0
  • Node.js: v24.21.0
  • teamai: main at b3b3a0b0
  • Provider: any
  • AI tool(s): any

Logs

Where it was found

Found by an adversarial review of #880, whose new secrets store reused this naming; #880 now names its secrets file by the hash alone (~/.teamai/secrets/teams/<hash>.json). The models store was left as is. Evidence here is from reading the code on main; not reproduced with the CLI.

Dominant language
TypeScript
Stars
5k
Forks
376
Avg merge
14h 21m
Merged PRs (30d)
316

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Tencent/teamai-cli

All issues in Tencent/teamai-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.