Repository navigation
[pull] main from Tencent:main - #77
Merged
Merged
Conversation
) renderForCursor was the one renderer that dropped spec.model: Claude, the Codex family and Copilot all write the agent's model into their native file, and reverseFromCursor reads it back (COMMON_CURSOR_FIELDS whitelists it), so a team agent with a concrete model ran on Cursor's default model silently. #830's design notes name the gap ('Cursor drops model when it renders agents today') and ask for it as a separate change — this is that change: write the value verbatim, as the other renderers do. The model[effort=...] form stays with the alias proposal. Co-authored-by: ydflow <[email protected]>
) (#855) * fix(persistence): write state.json and the search index atomically (#854) saveState, saveStateForScope and buildIndex wrote in place: open + truncate + write. A crash, kill, ENOSPC or power loss mid-write leaves truncated JSON, and the readers answer null for what they cannot parse: - state.json: loadStateForScope falls back to StateSchema.parse({}) — lastPullRev and every per-checkout pushBaseRevs entry are gone without a word, so the next push compares against a stale base. That is the stale-base overwrite class the worktree fixes (#827) closed. - search-index.json: loadIndex returns null, so recall silently loses the whole corpus until the next rebuild, and the shrink guard loses its baseline. The repo already writes config.yaml (#831) and the votes file atomically for exactly this reason, and writeJsonAtomic exists: temp file + rename, preserving the target's permission bits. Move the three writers to it. No reader changes; a successful write behaves as before. * test: inject index-write failures at the write call, not the file mode CI failed recall-rebuild-roots: the 'cannot be written' test chmod'd the index file 0o444, which fails the in-place writer but not the atomic one — writeJsonAtomic stages a temp sibling (the directory is writable) and renames over the target, and rename needs only the directory's permission. Same for the EISDIR test: renaming a file over a directory is EISDIR on POSIX but EPERM on Windows. Fail the fse.writeFile calls at the index path itself — the staged temp file included — so the injection works for both writers on every platform. The root-skip guard goes with the chmod it existed for. * test: force the #812 e2e state-write failure at the write call, not the file mode CI failed the 'cannot be recorded' case: it chmod'd state.json 0o444, which stops the in-place writer but not the atomic one — writeJsonAtomic stages a temp sibling and renames, and rename needs only the directory's permission, so the push completed normally and exited 0. (The e2e config retries once; the retry then failed teammatePublishes' git commit with 'nothing to commit', the run's second error.) The CLI runs as a subprocess, so the write call cannot be spied on the way state-atomic-save does it. Inject the failure from outside instead: a preload hook (NODE_OPTIONS --require) fails every fs.writeFile targeting the staged temp of this state file inside the CLI process — the same seam as the unit tests, on every platform. --------- Co-authored-by: ydflow <[email protected]> Co-authored-by: ydflow <[email protected]>
…on save and recall use (#853) #837 threaded LoadOptions through the config loaders, and #850 fixes the three commands that still reach them bare (pull, push, status). Three more commands load their config before their own dry-run guard and pass nothing: - contribute (--scope project loads, then --scope user / auto-detect) - session save (same three branches) - recall (detection, the inherited user scope, and the user branch) On a config pending the legacy role migration each of them rewrote ~/.teamai/config.yaml under --dry-run, printing the migration line without any [dry-run] marker; the auto-detect and project branches can also adopt a pre-#546 partition and run the single-repo self-heal bootstrap. loadLocalConfigForScope is the loader #837 missed: it now takes LoadOptions and forwards them to detectProjectConfig and both migrateLegacyRoleConfig calls. Callers that pass nothing behave as before — a real run still migrates in place. Co-authored-by: ydflow <[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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )