[bug] recall: recall quality and adoption never reach the agent's session
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- cli, developer-experience, tooling
Direzione di ricerca
Start with src/utils/session-id.ts and src/contribute-check.ts, then trace the recall cache path from src/recall.ts:639. Review src/transcript-parser.ts:62 and proposal #884 for the adoption path. Done means the listed agent session variables resolve the same id for recall and contribute-check, and adoption is detected across the supported agent workflows.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Two recall feedback signals don't work today. Both fail silently.
1. Recall quality never reaches contribute-check (every agent)
teamai recall "<query>" run by the agent's shell tool
recordRecallQuality(deriveSessionId({})) src/recall.ts:639
payload session_id / sessionId → {} is empty in the CLI
process.env.CLAUDE_SESSION_ID → not set by Claude Code
pid-<ppid> → a new shell per Bash call
→ ~/.teamai/sessions/pid-<n>-recall-cache.json, one orphan file per recall
Stop hook → contribute-check
readRecallQuality(<hook session_id>) src/contribute-check.ts:317
→ never finds the cache, so the knowledge-gap bonus never applies
src/utils/session-id.ts:32-34readsCLAUDE_SESSION_ID. Claude Code setsCLAUDE_CODE_SESSION_IDin Bash, hooks and MCP servers, equal to the hooksession_id(env vars).${CLAUDE_SESSION_ID}is only a text placeholder in skill bodies. Checked live in Claude Code 2.1.283:CLAUDE_CODE_SESSION_IDis set,CLAUDE_SESSION_IDis not.- The other agents expose their session id under their own names, and teamai reads none of them.
Fix (small, can ship on its own). Read each agent's variable, after the payload and before the pid fallback:
// src/utils/session-id.ts
const AGENT_SESSION_ENV = [
'CLAUDE_CODE_SESSION_ID', // Claude Code
'CODEX_SESSION_ID', // Codex ≥ 0.148, the root session (equals hook session_id)
'CODEBUDDY_SESSION_ID', // CodeBuddy: before CLAUDE_SESSION_ID, which it also sets
'COPILOT_AGENT_SESSION_ID', // Copilot CLI ≥ 1.0.29
'CURSOR_CONVERSATION_ID', // Cursor
'PI_SESSION_ID', // Pi
'CLAUDE_SESSION_ID', // kept for CodeBuddy and older setups
] as const;
| Agent | Variable | Equals hook session_id |
|---|---|---|
| Claude Code | CLAUDE_CODE_SESSION_ID |
yes (docs, and seen live) |
| Codex | CODEX_SESSION_ID |
yes; CODEX_THREAD_ID is the subagent's own id |
| CodeBuddy | CODEBUDDY_SESSION_ID |
yes for the main agent; subagents get their own id |
| Copilot CLI | COPILOT_AGENT_SESSION_ID |
yes since 1.0.29; not rechecked on 1.0.88 |
| Cursor | CURSOR_CONVERSATION_ID |
yes by source reading; not seen at runtime |
| Pi | PI_SESSION_ID |
yes |
| OpenCode, OMP | none | the generated bridges send no session id either (see the proposal) |
Tests: one per variable, and one that recall and contribute-check resolve the same id when the hook payload's session_id equals the env value. Real-CLI check: teamai recall from Claude Code and from Codex writes ~/.teamai/sessions/<session id>-recall-cache.json.
Known limit: when one agent runs another (Claude runs codex exec), the inner shell also sees the outer agent's variable, and a fixed order can pick the outer one. The proposal resolves that through the PostToolUse hook.
2. Adoption is about zero, even on Claude
main agent → teamai-recall subagent → teamai recall
│
└─ turns written to <session>/subagents/agent-*.jsonl (Claude Code 2.1.283)
main transcript only the subagent's summary
<!-- teamai:recalled-doc-ids: [redis-timeout] --> ids, no paths
main agent Read /…/learnings/redis-timeout.md
Stop → parseTranscriptForVotes src/transcript-parser.ts:62
recalled: [redis-timeout] from the comment (428-437)
paths: none the region with File: lines is in the subagent file (462-507)
adopted: [] the Read can't be matched
- Reproduced with a copy of
src/transcript-parser.tson a transcript with an Agent result carrying the comment, then aReadof the same path:recalledDocIds: ["redis-timeout"], adoptedDocIds: []. - Adoption only works when the main agent runs
teamai recallitself. The recommended subagent path gets no upvotes, except through the opt-inTEAMAI_UPVOTE_JUDGE. - Other agents never had adoption: the parser reads only Claude's JSONL. Codex rollouts and CodeBuddy's
index.jsonare passed in but not understood, and Copilot and OpenCode send no transcript path. - Impact: upvotes feed KB Health and promotion, which needs at least 5 upvotes (
docs/usage-guide.md:1287).
Fix. Not a small patch. The proposal in #884 detects adoption from the PostToolUse hook, which sees both the recall output and the later file read in the same session, for every agent.
- Lingua principale
- TypeScript
- Stelle
- 5k
- Fork
- 376
- Merge medio
- 14h 21m
- PR unite (30g)
- 316
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Tencent/teamai-cli
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
Tencent/teamai-cli#939 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tencent/teamai-cli#938 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[bug] CodeBuddy hooks are rendered in cmd.exe syntax and leave a junk `nul` file on every tool callAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
Tencent/teamai-cli#932 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Tencent/teamai-cli#920 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tencent/teamai-cli#919 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Tencent/teamai-cli
Issue simili
-
area/frontend good first issue kind/cooldown
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
voidzero-dev/oxc-angular-compiler#511 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
langchain-ai/deepagentsjs#898 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
anomalyco/models.dev#8509 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug documentation P2 UI/UX
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno