Skip to content

fix: follow-ups from the 2026-11-30 issue run (convert preserveUnowned*, fold warning for localRoot, OpenCode V2 stderr docs) - #4034

Merged
dyoshikawa merged 3 commits into
mainfrom
resolve-issue-4031-followups
Dec 1, 2026
Merged

dyoshikawa merged 3 commits into
mainfrom
resolve-issue-4031-followups

Conversation

@dyoshikawa

@dyoshikawa dyoshikawa commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Closes #4031

Summary

Resolves the three follow-ups left from the 2026-11-30 issue run.

  • convert honours preserveUnownedMcpServers / preserveUnownedHooks. rulesync convert passed neither option, so converting into an existing .codex/config.toml replaced the whole mcp_servers table and converting hooks replaced hand-written handlers even with the options on. convert now passes both, as it already passes preserveUnmanagedRuleContent. docs/guide/configuration.md and the convert section of docs/reference/cli-commands.md say so.
  • Fold warning for an appended localRoot body. foldedNothing treated a fold target that resolved only the root and localRoot rules as having folded nothing, so its file was handed to the selection watch, which stays quiet unless some target narrowed with include. But a fold target appends the localRoot body to the root file (append-to-root), and a later writer that keeps that body in its own local file drops it. RulesProcessor now records the body it appended (getAppendedLocalRootBody()). foldedNothing is false when the file's last writer does not carry that body, so the fold-root overwrite warning names the loss and the reorder that fixes it. The warning text now mentions "(and any appended localRoot body)". Example: pi,rovodev with a root rule and a localRoot rule. rovodev writes the local body to AGENTS.local.md and wins AGENTS.md, so pi loses the local body. main printed nothing; now the fold warning fires. pi,agentsmd stays quiet, since agentsmd appends the same body (new e2e test).
  • OpenCode V2 postToolUse stderr docs. The 1 MiB cap and the 1 s background-output cut-off hold on the Bun CLI (exec) path only. On the Bun Shell fallback, stderr is not capped, and a timed-out command writes its stderr only when it eventually ends. The note in docs/reference/file-formats.md and the generator comment now say so (checked against __rulesyncRunCommand in opencode-style-generator.ts).

Design decisions

  • convert honours the config options rather than documenting that it ignores them: convert writes into the same destination files generate does, and it already honours preserveUnmanagedRuleContent, so following the same keys is the least surprising choice. Both options stay off by default, so default output is unchanged.
  • The scrap issue's example used codexcli, but codexcli is not a collisionPolicy: "fold" target, so foldedNothing is never consulted for it. The fix and the test use a real fold target (pi).
  • The issue also suggested counting simulated sections. No collisionPolicy: "fold" target has additionalConventions, so a fold target never adds one. That part is not implemented, which keeps the change to what can actually happen.
  • The third note in Follow-ups: low findings left from the 2026-11-30 issue run (#4028-#4030) #4031 (a fold warning that main printed when only the winner's own TOON list differed is now silent) is a behavior note, not a change request; nothing changes for it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4

dyoshikawa and others added 3 commits December 2, 2026 01:10
- convert honours preserveUnownedMcpServers and preserveUnownedHooks, as
  generate does.
- A fold target whose root file holds an appended localRoot body or a
  simulated section no longer counts as folding nothing, so a later target
  that overwrites it gets the fold warning.
- Qualify the OpenCode V2 postToolUse stderr notes for the Bun Shell fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…ulated-section flag

Address review of #4034:
- foldedNothing now treats an appended localRoot body as lost only when the
  file's last writer does not carry it (pi,agentsmd stays quiet).
- No fold target has additionalConventions, so the simulated-section half is
  removed; RulesProcessor exposes getAppendedLocalRootBody() instead.
- The fold warning mentions an appended localRoot body.
- Document which rulesync.jsonc options convert honours.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
@dyoshikawa
dyoshikawa merged commit d5b5aae into main Dec 1, 2026
22 of 25 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-4031-followups branch December 1, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-ups: low findings left from the 2026-11-30 issue run (#4028-#4030)

1 participant