Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file. See [standa

- `teamai stats` no longer counts a session twice, and no longer counts another project's sessions. Its dashboard section added the whole machine's local `events.jsonl` metrics to the scope's already-reported totals from the team repo, so every session that a `pull` had reported — and that stays in the event log until compaction — was counted once by the team total and once again locally, and sessions whose `cwd` belonged to a different project were added to this scope's as well. It now filters the event log the way `teamai pull` reports it (only the sessions recorded in the current scope, see #785) and adds only what that scope has not reported yet, derived from the same per-scope `reported-*` snapshots the report path advances — so the local figure agrees with the team's instead of exceeding it. When the reported totals could not be read at all (no stats file, an unreadable one, a reports worktree that is not there), or when they exist but hold nothing yet, nothing is subtracted — a snapshot can name a session the team file never received, so a non-empty team total is what licenses trusting them, and a session the member can see happening is never hidden. The per-repo and by-hour breakdowns read that same filtered log, so they stay inside the scope; they answer a different question from the headline — what this machine's retained event log holds, per repo — and both the headings and the `--by-repo` / `--by-time` flag descriptions now name that source instead of presenting them as a split of the headline (for [#768](https://github.com/Tencent/teamai-cli/issues/768)).
- The data-partition migration no longer retires a legacy `<repo>/.teamai/` while the partition's `config.yaml` cannot be read. `teamai init`, `pull` and `push` took a partition config that merely existed as a finished migration and renamed the legacy directory to `.teamai.bak`, although it held the only config that still loaded. A partition `config.yaml` that is empty or cannot be opened, does not parse, does not validate, or is not `scope: project` now leaves the legacy directory in place and names the file to fix; once it is fixed, the next of those commands retires it as before. A partition directory whose `config.yaml` was moved aside is no longer replaced by a fresh copy of the legacy directory, which deleted what the partition held; the migration waits and says to restore the file or move the directory aside (for [#797](https://github.com/Tencent/teamai-cli/issues/797)).
- `teamai recall <query>` searches nothing in a project whose config exists but cannot be read, and says why. Detection skipped the broken file and searched whatever loaded next: the user scope, or a legacy `.teamai/` behind a broken partition that may belong to another team, whose knowledge was returned and whose documents got recalled counts. It now prints ``Nothing was searched: <file>: <reason>. Fix the file, or move it aside and run `teamai init` to write a new one.`` and exits 1, and `recall --check` does the same instead of printing `NOT_RELEVANT`, which told the recall subagent the team had no knowledge. The `teamai-recall` subagent a pull from this release deploys relays that line to the member, telling the main conversation to move the file or re-run `teamai init` only with their consent. (for [#796](https://github.com/Tencent/teamai-cli/issues/796)).
- `teamai pull` syncs nothing in a project whose config exists but cannot be read, and says why. Detection skipped the broken file and pulled whatever loaded next: the user scope, or a legacy `.teamai/` behind a broken partition that may belong to another team, whose skills, rules and docs were deployed and to which the project's usage was reported. It now prints ``Nothing was synced: <file>: <reason>. Fix the file, or move it aside and run `teamai init` to write a new one.`` and exits 1. A session start there runs no pull, seeds no agent directory and stashes no package hint; `teamai pull --silent`, which hooks from before `hook-dispatch` still run, prints nothing, writes the reason to `~/.teamai/debug.log` and exits 1. This is the rule team hooks and usage follow since [#748](https://github.com/Tencent/teamai-cli/issues/748) (for [#784](https://github.com/Tencent/teamai-cli/issues/784)).
- The legacy `teamai dashboard-report` command no longer records dashboard events in a directory that never set up teamai. A current install writes only `teamai hook-dispatch`, whose dashboard-report handler declares `requiresConfig` and is dropped when no config resolves for the hook's `cwd`; the old subcommand stayed ungated, so a hook left behind by an earlier install kept recording events for every project it fired in, and those sessions were then reported by whichever scope pulled next. It now applies the same gate `teamai contribute-check` was given, asked about the session's `cwd` — or, for a host that sends none, the directory the hook runs in (for [#768](https://github.com/Tencent/teamai-cli/issues/768)).
- The lock behind `pull`, `push`, the reports and learnings worktrees, learnings publishing, migration, self-mode bootstrap and the update check no longer hands one lock to two live processes. Reclaiming a stale lock renamed over whatever file was there once it had judged the lock stale, and it judged live locks stale: one that had just been released (and could be re-created by a third process before the rename), one whose owner had created it but not yet written it, one owned by a process running as another user (for example a `sudo teamai` run), and one it could not read. Under 16 processes contending on one lock, about 1% of acquisitions overlapped another holder, enough for two pulls to report the same usage twice. Now only a lock whose owner is provably gone is reclaimed; a lock that vanished gets one more exclusive create, and a new lock is published with its content already in place (written to a temp file, then hard-linked to the lock name; a filesystem without hard links falls back to the previous create). A lock that names no owner (empty, partly written, unreadable) is never reclaimed: if a crash left one, `pull` and `push` report busy until it is removed, and a warning names the file. Migration skips the lock's temporary files, which a contending pull creates and removes while the copy runs. With the change, the same stress run shows no overlap (for [#760](https://github.com/Tencent/teamai-cli/issues/760)).
Expand Down
18 changes: 13 additions & 5 deletions agents/teamai-recall.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@ teamai recall --check "<3-6 keywords from the task>"
computed over titles and tags only, so a term reported missing may still be
discussed in a body that a full recall (or a `Grep`) will surface. Only
`NOT_RELEVANT` short-circuits the flow.
- If the command fails or `teamai` is not on PATH: skip the precheck and
continue to Step 1 (do not block on precheck failure).
- If the output (stdout or stderr) contains `Nothing was searched:`: this
project's teamai config cannot be read, so no team knowledge was searched.
Return that line from `Nothing was searched:` to its end, verbatim (it names
the file and the fix), and **stop** — do not report "no relevant team
knowledge", and do not proceed to Step 1–5. Add that the main conversation
should show it to the user and must not move the file or run `teamai init`
without the user's consent: that replaces their settings for this project.
- If the command fails in any other way or `teamai` is not on PATH: skip the
precheck and continue to Step 1 (do not block on precheck failure).

#### Complexity quick-judge (after RELEVANT)

Expand Down Expand Up @@ -199,9 +206,10 @@ in `teamwiki/` with BM25 + graph-boost. Capture the full output.
If the first call returns insufficient results, you may retry once with
`--depth lookup` to broaden the search to raw symbol pages.

If the command fails, knowledge base is empty, or returns zero hits,
emit a single line `No relevant team knowledge found for: <query>` and
stop.
If the output contains `Nothing was searched:`, return that line from the
marker on and stop, as in Step 0. If the command fails otherwise, knowledge base is
empty, or returns zero hits, emit a single line
`No relevant team knowledge found for: <query>` and stop.

### Step 4 — Read the top hits and drill into codebase

Expand Down
1 change: 1 addition & 0 deletions docs/usage-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,7 @@ teamai recall "GPU out of memory"
- Searches the project scope when the current working directory contains its config; with `inheritUserScope: true`, searches project first and user second, labeling results `[project]`/`[user]`. Otherwise searches user scope
- For the same resource type and filename, the project entry wins; different resource types with the same filename remain separate
- Consulted active-scope knowledge is automatically upvoted. Inherited user hits remain read-only while the project is active
- In a project whose config exists but cannot be read, recall searches and records nothing, neither the user scope nor a lower-priority project config (such as a legacy `.teamai/config.yaml`) behind it: it prints ``Nothing was searched: <file>: <reason>. Fix the file, or move it aside and run `teamai init` to write a new one.`` and exits 1, with `--check` too, which prints no verdict. The recall subagent relays that line instead of reporting no knowledge. With no config at all, recall still says no learnings are available and exits 0
- A lightweight relevance precheck is available via `teamai recall --check "<keywords>"`, which prints `RELEVANT score=<n> threshold=<n>` or `NOT_RELEVANT score=<n> threshold=<n>` without reading files or upvoting — the recall subagent uses it to skip retrieval on unrelated tasks. For a `RELEVANT` top hit it also reports `matched=`/`missing=` — the query terms that hit its title/tags and those that did not
- `RELEVANT` means a hit cleared the score threshold, i.e. reading files is worth the cost — it does not mean the knowledge base covers your subject. Use the `matched=`/`missing=` terms (and the `Matched:`/`Missing:` lines on full results) to make that judgement: a hit missing all your distinctive terms is topically adjacent, not an answer

Expand Down
1 change: 1 addition & 0 deletions docs/usage-guide.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,7 @@ teamai recall "GPU 内存不足"
- 当前工作目录包含 project scope 配置时搜索该项目;配置 `inheritUserScope: true` 后先搜索 project、再搜索 user,并标注 `[project]`/`[user]` 来源;否则搜索 user scope
- 资源类型和文件名都相同时由 project 条目优先;不同资源类型即使文件名相同也分别保留
- 当前 scope 中被查阅的知识自动 upvote;项目运行期间继承的 user 命中保持只读
- 当 project 配置存在但无法读取时,recall 不检索也不记录任何内容,既不退回 user scope,也不退回其后优先级更低的 project 配置(如旧的 `.teamai/config.yaml`):输出 ``Nothing was searched: <file>: <reason>. Fix the file, or move it aside and run `teamai init` to write a new one.`` 并以 exit 1 退出;`--check` 同样如此,不输出任何判定。recall subagent 会原样转述这一行,而不是报告没有团队知识。完全没有配置时,recall 仍提示没有可用的 learnings 并以 exit 0 退出
- 提供轻量相关性预检 `teamai recall --check "<关键词>"`,输出 `RELEVANT score=<n> threshold=<n>` 或 `NOT_RELEVANT score=<n> threshold=<n>`,不读取文件、不 upvote —— recall subagent 用它在任务与团队知识无关时跳过检索。当 top 命中为 `RELEVANT` 时,还会输出 `matched=`/`missing=`,即命中/未命中其 title 与 tag 的查询词
- `RELEVANT` 表示分数越过阈值、值得花成本读文件,**不代表**知识库覆盖了你要找的主题。请用 `matched=`/`missing=`(以及完整结果里的 `Matched:`/`Missing:` 行)自行判断:若关键区分词全部落在 missing 里,那条只是主题相邻,并非答案

Expand Down
2 changes: 2 additions & 0 deletions skill-data/core/references/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ This is the #1 onboarding issue. In order:
file and the reason; `teamai doctor` checks another config and can pass
here. Moving it aside and re-running `teamai init` replaces their settings
for that project: do it only with their consent.
`recall` refuses the same way with `Nothing was searched: <file>: <reason>`:
no team knowledge was searched, so do not report that the team has none.

## Permission / access denied

Expand Down
Loading
Loading