Conversation
SessionStart keeps seeding its one tool through seedProjectAgentRoot. The new createProjectToolRoots takes a set of tools, defaulting to enabledAgents and, when that is empty, to the tool roots the main checkout already has.
…oots Project-scope init with --agent creates those tools' roots after saving enabledAgents, then init runs the scope's pull so the first session has the team's skills, rules and MCP servers. Without --agent no root is created. Docs and setup skill stop telling members to pull after init.
…sh the rest after The post-checkout pass now runs pull in an internal inline mode: it skips the team repo fetch when the clone was fetched within the source TTL (24 h, new last-fetch.json stamp beside the clone), reads subscribed sources from their cached clones, waits for another pull's partition lock instead of skipping, and leaves learnings, reports, usage reporting and post-pull scripts to a detached full pull started after it.
The post-merge git hook now runs an inline pull. With a separate team repo it fetches the team repo whatever its fetch stamp says, aborting the fetch after 5 s (internal fetchTimeoutMs pull option, AbortSignal into simple-git), and delivers when the revision moved; a detached full pull then refreshes the team repo past the cap, sources, learnings and reports. In single-repo mode it delivers the working tree git pull updated, with no network and no detached pull.
A failure inside the silent git hook (team fetch failed or hit the cap, partition lock held past the inline wait, handler error) is written to debug.log and recorded in the project partition. doctor names it with its fix and reports whether the hook is installed; the next interactive pull mentions it once; a successful hook pull, detached retry included, clears it. The post-merge inline lock wait is capped at its fetch cap.
…er core.hooksPath
… init Project-scope init in a terminal without --agent reuses the single-repo tool picker (Auto = tools installed under HOME). The choice is added to enabledAgents before the tool roots are created, so only the chosen tools' roots appear and the closing pull fills them. --agent and non-interactive runs skip the picker; the latter still create no root.
- Leave an unreadable or non-executable .git/hooks script alone instead of replacing or enabling it; doctor explains the fallback. - Install the git hook after the agent hooks and propagate its failure with the fix; init reports it and still pulls, hooks inject exits non-zero. - Record why a git hook synced nothing when the project config is unreadable. - Cap the self-mode post-merge lock wait at the same 5 s as the fetch. - Keep a partial delivery failure recorded until a complete sync. - Join detached hook pulls before the e2e sandbox is removed.
Resolve refreshTeamRepo's options: keep inline/fetchTimeoutMs and add main's dryRun guard for the self-mode .gitignore self-heal (Tencent#944).
Detection run inside <main>/.teamai/knowledge-wt resolves that worktree as its own project root, so the config-based guard missed it: a self-mode push fired post-checkout there, delivered into the disposable worktree and left a detached pull running. Exclude the main checkout's .teamai/ for both git events.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prepare the team's supported resources before the AI tool reads its startup configuration.
flowchart TB subgraph CURRENT[Before] direction LR C1[Start tool] --> C2[Read startup config] --> C3[SessionStart pull] --> C4[Resources arrive late] end subgraph EXPECTED[After] direction LR E1[init / new worktree / git pull] --> E2[Prepare resources] --> E3[Start tool] --> E4[Read prepared config] end CURRENT ~~~ EXPECTED classDef sync fill:#6a4f8f,stroke:#513b6d,color:#fff; classDef late fill:#a33a3a,stroke:#7a2a2a,color:#fff; classDef ready fill:#2f8f4f,stroke:#1f6b39,color:#fff; class C3,E2 sync; class C2,C4 late; class E3,E4 ready; style CURRENT fill:#fff5f4,stroke:#a33a3a,color:#3a2525 style EXPECTED fill:#f1faf3,stroke:#2f8f4f,color:#183e22initfinishes with a pull in both scopes. Project Git hooks prepare worktrees and apply updates aftergit pull. Startup delivery runs inline; the full refresh runs in the background.Interactive init without
--agentReuses single-repo mode's existing
promptForSelfModeAgents. This PR adds the project call and wording.Choice
2enables Claude, creates only.claude/, and fills it before exit. Enter selects Auto. Non-interactive init without--agentcreates no roots.Type of Change
Evidence
Before: startup reads configuration before delivery; team changes leave the previous resources on disk.
After: all five resources pass. Codex parent and child both call MCP, with resource tokens absent from the prompt and no shell or file changes.
Codex project MCP records combine this runtime at
6c330c00with #954 at48c77400in a temporary test branch. Trust was configured in the fixture. #954 and #955 remain excluded; standalone project MCP and automatic hook trust are not claimed.Test Plan
npx tsc --noEmitpassesnpm run lintpassesnpx vitest runpasses, 7,207 passed and 1 skippednpm run buildpasses49d16d22; CI runs the suite on the current head--agent, choice2: all five resources delivered, only.claude/createdBuilt-CLI checks cover init, worktrees, all five updated resources, hook coexistence, failures, dry-run and uninstall. Five Codex parent/child records cover the session cases above. Interactive init passed at
49d16d22. Build, unit tests, typecheck and lint pass at the current head.Related Issues
Fixes #963.
Related delivery and trust work: #954, #955.
Merge Danger
Door: two-way
No schema migration. Uninstall removes TeamAI's Git hook entries and blocks.
Blast Radius: startup
Init, worktree creation and post-merge now wait for delivery. Hooks preserve Git's exit status;
doctorand the next interactive pull report failures.Notes for Reviewers
.teamai/, and the reports and learnings checkouts in the project data home.initreports it and still pulls;hooks injectexits non-zero.doctorand the next interactive pull report it.teamai pull.--worktreeintegration is out of scope.Active sessions may need restarting. Both usage guides and affected skills are updated.