[Feature]: Share one createTuiTurnId between the TUI chat controller and the headless runner
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Refatoração
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- node.js, typescript
- Domínio
- cli
Direção de pesquisa
Start with packages/tui/src/application/turn-id.ts, which already defines createTuiTurnId, and the duplicate in packages/tui/src/tui/controller/chat-controller-support.ts. Point the import in packages/tui/src/tui/controller/chat-controller.ts at the application module and delete the duplicate. Done when there is one definition, the id format and the createTurnId override are unchanged, and the pnpm verify gates pass, ignoring the flaky test:capabilities. External PRs are disabled on this repo, so the change must go through a collaborator.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Product or interface
CLI - interactive TUI (the duplicate is shared with CLI - headless)
Use case and problem
createTuiTurnId() is defined twice, with identical bodies, at 3c21163:
| Copy | Used by |
|---|---|
packages/tui/src/application/turn-id.ts |
headless runner (packages/tui/src/headless/runner.ts) |
packages/tui/src/tui/controller/chat-controller-support.ts |
interactive TUI chat controller (packages/tui/src/tui/controller/chat-controller.ts) |
export function createTuiTurnId(): string {
return `turn_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
}
Today both paths produce ids shaped turn_<timestamp base36>_<6 random chars>, but nothing ties the two copies together. If one copy later changes the id format, for example the prefix, the length or the randomness source, interactive and headless turns would silently get different formats. Nothing would fail to flag the drift.
Desired behavior
Keep one definition in application/turn-id.ts:
- Make the chat controller import
createTuiTurnIdfrom../../application/turn-id.js. - Delete the copy in
chat-controller-support.ts. It has no other importers.
The controller already imports from application/: run-coordinator.js, interactive-turn-delivery.js and login-gate.js. So this adds no new dependency direction.
What the change keeps the same:
- The id format.
- The controller's
createTurnIdoption override. release/public-source.json, because no files are added or removed.
The change touches 2 files, +1 / −5. External pull requests can't be opened on this repository, so I've left a ready commit on my fork in case a collaborator wants to pick it up:
- Commit: https://github.com/zhangbububu/minimax-code/commit/34c6a7d623729d3ad2f2dbc121f2a23eb4d4ce70
- Compare: https://github.com/MiniMax-AI/minimax-code/compare/main...zhangbububu:minimax-code:refactor/dedupe-turn-id
I checked the commit on macOS with Node 24.14.1 and pnpm 9.12.0. Every pnpm verify gate passed (check:source, typecheck, lint:tui, build, check:standalone, test:byok, test:smoke and the rest) except test:capabilities, which never passed reliably on either revision. Its failures are described in the next section.
Platform
Multiple platforms
Alternatives and additional context
Alternative. Keep the copy in chat-controller-support.ts and point the headless runner at it. I'd avoid this because headless would then depend on tui/controller/, while application/ is the layer both already share.
Unrelated flakiness seen while validating. test:capabilities intermittently fails on a single test, on both this commit and unmodified main at 3c21163:
| Revision | Runs | Passed |
|---|---|---|
| this commit | 5 | 1 |
main |
3 | 2 |
The failures were:
packages/agent-modules/permission/test/unit/permission/tools/fs-permission-runtime-read.test.ts› "reads the current Session own tool-output artifact when the host grants it". Hits the default 5 s timeout. Seen on both revisions.packages/tui/test/unit/update-runtime.test.ts› "heals receipts pinned to a Homebrew Cellar keg via the stable opt path". Hits the default 5 s timeout once on this commit.packages/local-runtime-v2/test/integration/session-stop-cascade.integration.test.ts› "A: stops background bash and subagent…". Failed once onmainwithENOENT … bash.pid.
The permission case takes about 2.9 s when run alone, so it has little headroom under suite load. I can file this separately if that's useful.
- Linguagem predominante
- TypeScript
- Estrelas
- 2.3k
- Forks
- 315
- Merge médio
- 3h 54min
- PRs com merge (30d)
- 9
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de MiniMax-AI/minimax-code
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
MiniMax-AI/minimax-code#639 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
MiniMax-AI/minimax-code#636 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
MiniMax-AI/minimax-code#615 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
MiniMax-AI/minimax-code#556 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
MiniMax-AI/minimax-code#507 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de MiniMax-AI/minimax-code
Issues semelhantes
-
Media browser returns "Not found" for repositories using the SHA-256 object formatTalvez já em andamento @adamchodera assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Follow-ups from #312Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
janhesters/remixcn#318 ·
Mantenedores costumam responder em até 1 dia
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
danielmiessler/LifeOS#3150 ·
Mantenedores costumam responder em até 5 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Make the "%" unit spacing the same in the web and in A10Talvez já em andamento @kragent66-glitch assumiu hoje. Abertabug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 comentário ·