Skip to content

docs/diagnostics: a named toolPaths entry replaces that tool's defaults whole, and nothing surfaces the dropped keys #1115

Closed

Description

@kittimzhe

Summary

A team teamai.yaml that sets toolPaths replaces the default table whole (the zod .default(...) on toolPaths in src/types.ts:399 only applies when the key is absent). Two consequences surprised me while verifying #1054, and neither surfaces anywhere a user would look:

  1. Customizing one tool drops the defaults for every other tool. A toolPaths: section that only mentions zcode removes the built-in claude, codex, cursor, … entries with it — skills/rules/settings resolution for those tools silently changes behavior.
  2. Omitting one field of a customized tool silently disables that surface. Concretely: our verification teamai.yaml set toolPaths.zcode with skills/rules but no settings, and the default settings: .zcode/cli/config.json vanished with the table. teamai hooks then reports the tool as no settings configured and hook reconciliation silently skips it — no warning at pull time, no doctor finding (below).

Why this is discoverability, not a semantics bug

The code comments establish that whole-entry replacement is deliberate: doctor-delivery.ts:645 — "A team toolPaths entry replaces the default one whole" — and "One with no rules path delivers no rules to it on purpose". Omission-as-opt-out is a real feature (a team can disable a tool's rules/settings by leaving the path out), so changing to per-key merge would break teams that rely on it. The gap is that the trap end of that trade is invisible:

  • docs/guide/ never documents the replace-whole rule — toolPaths appears only in FAQ asides (custom agents) and the team-culture path tables. Nothing tells a team writing a custom entry that they are now maintaining the whole table.
  • teamai doctor diagnoses exactly one missing-path shape: the codex-family claudemd (doctor-delivery.ts:645-654). A customized tool missing settings (hooks silently skipped) or missing skills/rules (delivery silently disabled) produces no finding.

Suggestions (any subset; happy to PR once a direction is picked)

  1. doctor finding: when a toolPaths entry exists for a built-in tool and lacks a key the default table provides (settings, skills, rules, as applicable to that tool), report it with the replace-whole explanation and the exact key to add — mirroring the tone of the existing claudemd check.
  2. One-line docs: a note in the guide where toolPaths is first mentioned: a custom section replaces the defaults whole; to keep a built-in tool's other paths, copy them from the default table (src/types.ts) or list the paths you want teamai to manage.
  3. Optionally, a pull-time hint (not a warning) the first time a partial table is detected, pointing at teamai doctor.

Environment: teamai-cli@0.28.0-beta.0, git-backed team repo, toolPaths.zcode with skills/rules but no settings.

Activity

  1. hongchuwudi commented on Oct 14, 2026

    @hongchuwudi
    Contributor

    Hi — first-time contributor here; this writeup is impressively precise.

    I'd like to take the documentation slice: add a toolPaths subsection to docs/guide/reference.md (under teamai.yaml) covering the replace-whole rule and the omission-as-opt-out behavior, plus a cross-link in faq.md — EN + zh-CN, docs-only diff. I'll leave the doctor finding for a follow-up PR unless someone picks it up first.

    If Kit or a maintainer is already on it, happy to stand down — otherwise I'll open the PR after a short nod here.

  2. kittimzhe commented on Oct 14, 2026

    @kittimzhe
    ContributorAuthor

    Go for it @hongchuwudi — the documentation slice is all yours. A few pointers from the verification sandbox that may save you a round-trip:

    • The replace-whole rule lives in src/types.ts:399 — toolPaths is a z.record(...).default({...}), so the default table applies only when the key is absent entirely; any toolPaths: section replaces the whole table (entries for every other tool included).
    • The intentional-omission side is documented in code comments: doctor-delivery.ts "A team toolPaths entry replaces the default one whole" and "One with no rules path delivers no rules to it on purpose" — worth citing in the doc so readers see omission-as-opt-out is a feature, not a trap.
    • The silent-skip symptom for a missing settings key surfaces in teamai hooks as no settings configured (hooks-cmd.ts) — a one-line cross-link from the FAQ's hooks entry may be the highest-value sentence.

    I'm not on the docs myself; the doctor finding stays open in this issue for whoever picks it up (happy to take it once the direction is blessed, or to review yours).

  3. akushonkamen commented on Oct 14, 2026

    @akushonkamen

    Hi — picking up the doctor finding slice (suggestion 1) only. @hongchuwudi has the docs slice (suggestion 2), so no overlap there.

    Re-confirmed the root cause on origin/main @ 435b9f2: toolPaths is z.record(z.string(), ToolPathsSchema).default({ ... }) (src/types.ts:433), so the default table applies only when the section is absent entirely, and every field of ToolPathsSchema is .optional() (src/types.ts:13-57) — a custom entry silently drops the surfaces it omits.

    Plan: a teamai doctor check that fires when a built-in tool's toolPaths entry is missing keys the default table provides (settings/skills/rules/claudemd/agents/mcp/mcpProject/userScope.* as applicable to that tool), carrying the replace-whole explanation and the exact keys to add — mirroring the tone of the existing codex-family claudemd finding (src/doctor-delivery.ts:725). No merge-semantics change: omission stays the documented opt-out, the finding just makes the trade visible. Suggestion 3 (pull-time hint) stays untouched to keep the diff small.

    Transparency note: I'm using an AI coding assistant for this contribution.

  4. jeff-r2026 commented on Oct 14, 2026

    @jeff-r2026
    Collaborator

    Skip the docs. Don't change the replace-whole behavior.

    When the team yaml sets toolPaths and drops a built-in tool or key (for example zcode.settings), teamai doctor and teamai pull should say that surface is off, and to add it back only if they still want it. Informational only — don't fail the check.

    @hongchuwudi no docs change. @akushonkamen this covers doctor and the pull hint.

  5. akushonkamen commented on Oct 14, 2026

    @akushonkamen

    PR is up: #1119 — doctor-only completeness finding for partial toolPaths entries (top-level + userScope sub-keys), no merge-semantics change. Full suite, typecheck and lint are green modulo the 3 known pre-existing main failures; details in the PR description.

  6. changed the title [-]docs/diagnostics: a custom toolPaths section replaces the default table whole, and nothing surfaces the dropped keys[/-] [+]docs/diagnostics: a named toolPaths entry replaces that tool's defaults whole, and nothing surfaces the dropped keys[/+] on Oct 21, 2026
  7. SaulMoro commented on Oct 21, 2026

    @SaulMoro
    Collaborator

    This was generated by AI during triage.

    Triage: still open. #1204 fixed the cross-tool half. The dropped-key half is ready for a contributor. Labels: enhancement, help wanted.

    #1204 (merged) makes a toolPaths section merge tool by tool (src/types.ts:734-736). A section that only names zcode no longer drops claude, codex, and the rest.

    Naming one tool still replaces that tool's entry whole. A toolPaths.zcode with skills and rules but no settings still drops .zcode/cli/config.json. teamai hooks can report no settings configured, and pull does not say why. doctor only reports a missing claudemd (src/doctor-delivery.ts:793).

    Leaving a field out is still the opt-out. Do not switch that entry to a per-field merge.

    What is left:

    • A doctor finding when a built-in tool's entry lacks a key the default table has. Name the key, and say that the entry replaced that tool's defaults.
    • One line in the guide where toolPaths is first explained: naming a tool replaces that tool's defaults, and other tools keep theirs.
    • A pull-time hint is optional.

    The title now describes that remaining gap. The old title said the whole table was replaced.

    AGENTS.md ("Testing before a PR") requires one real-CLI record after npm run build for the doctor finding. Use a team yaml that customizes one tool and omits settings, then show that teamai doctor reports that key.

  8. kittimzhe commented on Oct 22, 2026

    @kittimzhe
    ContributorAuthor

    Claiming the dropped-key half — I filed this one during #1054 verification, and the triage direction is clear. Plan: a doctor finding that mirrors the claudemd check — when a team toolPaths entry exists for a built-in tool and omits a key the default table provides for it (settings/skills/rules, as applicable), report it with the replace-whole explanation and the exact key to add — plus the one-line docs note in the guide. Omission-as-opt-out stays untouched: the finding only fires when the default table provides the key and the entry drops it silently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions