Repository navigation
fix(stats): finish report bookkeeping after pull timeout - #562
Merged
jeff-r2026 merged 1 commit intoSep 15, 2026
Merged
Conversation
jeff-r2026
self-requested a review
September 15, 2026 06:28
jimpablo
added a commit
to jimpablo/teamai-cli
that referenced
this pull request
Sep 15, 2026
Resolve the conflict with Tencent#562 in reports-branch-readonly tests by using path.join for the reports worktree path. Keep Tencent#560's read-only refresh and autostash recovery together with Tencent#562's pushIfUnchanged retry and pull report-timeout bookkeeping. The late-report isolation test now only asserts that partition sync-locks stay held; .reports-lock is released after the earlier read-only refresh.
This was referenced Sep 15, 2026
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
Co-authored-by: linjinglan <[email protected]>
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
A stats push taking longer than five seconds could succeed after
pullhad abandoned local acknowledgement, causing the next pull to count the same session data again. Bound the wait around the complete reporting batch, so late success still advances reported snapshots and consumes the reported usage prefix. Keep partition sync locks until that work settles.Reporting now returns an explicit success result. A failed or skipped push preserves local events and snapshots. Restore the stats input after a failed reports-branch push so a normal retry does not add its delta twice; allow that retry to push an existing commit even when its reconstructed tree is unchanged. Existing callers retain their default no-op behavior.
English and Chinese usage documentation and the affected design document describe the wait boundary and remaining limitations.
Type of Change
Test Plan
npm run buildpassed using worktree-local, lockfile-pinned dependencies.node node_modules/typescript/bin/tsc --noEmitpassed.git diff --checkpassed.One pre-existing test,
pull scope isolation > project mode: inherits user resources only when explicitly enabled, fails on this Windows environment because the expected deployed skill is absent. The same failure was reproduced on unmodified main. The passing scope run excluded that test; it is not claimed as passing. An exploratory broader run also encountered the existing Windows-invalidgstack:tddfixture in usage-tracking; no change to that test is included.CLI test commands (retries disabled; the two selections together cover all 13 cases):
Notes for Reviewers
This remains best-effort delivery. There is no durable batch journal or remote deduplication for a process terminated between pushing and local acknowledgement, or for partially successful multi-target batches. Five seconds bounds the reporting batch wait; it does not cancel Git or guarantee process exit while subprocesses remain active.
The CLI matrix uses isolated homes and local Git remotes. Agent and provider configurations are exercised, not live Agent GUIs or hosted-provider authentication. The installed CLI and main working tree were not patched.