Skip to content

[pull] main from Tencent:main - #77

Merged
pull[bot] merged 3 commits into
Walternater:mainfrom
Tencent:main
Sep 27, 2026
Merged

pull[bot] merged 3 commits into
Walternater:mainfrom
Tencent:main

Conversation

@pull

@pull pull Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

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 : )

ydflow and others added 3 commits September 27, 2026 20:58
)

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]>
@pull pull Bot locked and limited conversation to collaborators Sep 27, 2026
@pull pull Bot added the ⤵️ pull label Sep 27, 2026
@pull
pull Bot merged commit a8ab8e0 into Walternater:main Sep 27, 2026
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant