[bug] renaming team: in teamai.yaml orphans members' model gateway keys
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
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
- A team repo with
team: Workand a model profile;teamai models configure team:<ref> --api-key-stdin. - Change
team:toWork Engineeringinteamai.yaml, push, andteamai pullas the member. teamai models listshows the key as not configured.
Environment
- OS: macOS 27.0
- Node.js: v24.21.0
- teamai:
mainat 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Tencent/teamai-cli
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 76/100
Tencent/teamai-cli#939 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 5/5 Over a week Newbie friendliness 25/100
Tencent/teamai-cli#938 · 1 reaction ·
Maintainers usually reply within 1 day
-
[bug] CodeBuddy hooks are rendered in cmd.exe syntax and leave a junk `nul` file on every tool callOpen
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Tencent/teamai-cli#932 ·
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Tencent/teamai-cli#920 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Tencent/teamai-cli#919 ·
Maintainers usually reply within 1 day
All issues in Tencent/teamai-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
callstackincubator/rozenite#518 ·
Maintainers usually reply within 1 day
-
Area/Workflow Priority/Blocker Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
wso2/product-integrator#2622 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area:bash bug has repro platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
anthropics/claude-code#98644 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
allure-framework/allure-js#1603 ·
Maintainers usually reply within 1 day