Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:19p8wzxghh is past its budget: trevato/forge: "the gathered tools > docs/MCP.md's tool table is current: run `bun scripts/mcp-tools.ts`" failed on 3 p… #7683

Closed opened this
Closed without merging

The MCP tool list and the tool table that bun scripts/mcp-tools.ts writes into docs/MCP.md now sort tools by plain code-point order, not by the machine's locale. Before, the tool list in src/http/mcp/tools.ts and the generator both used localeCompare.

Notes

stopped closed without shipping deploy 864a725

opened this

The MCP tool list and the tool table that bun scripts/mcp-tools.ts writes into docs/MCP.md now sort tools by plain code-point order, not by the machine's locale. Before, the tool list in src/http/mcp/tools.ts and the generator both used localeCompare. A table generated on one machine could then fail the "docs/MCP.md's tool table is current" check on a machine with different locale rules. That made the check red on pulls that had not touched MCP at all.

  • src/http/mcp/shared.ts adds one byName comparator (code-point order), and both src/http/mcp/tools.ts and scripts/mcp-tools.ts use it, so the two can't drift apart again.
  • test/mcp-tools.test.ts adds a case with names whose code-point order and localeCompare order disagree; it fails if either side goes back to locale sorting.

This branch is the same change as the closed pull #6941, with main (323 commits ahead) merged in so it lands on current code. #6941 was parked on "RepoSource: one repository, two places to read it from > a mirror reports its stages in order and ends holding the repo". That test is in test/view-source.test.ts, has nothing to do with this change, and passes here (23 pass). It looks flaky; I didn't investigate it.

Checked: bun x tsc --noEmit is clean, bun test test/mcp-tools.test.ts passes (168), and bun test test/view-source.test.ts passes (23).

To try it: run bun scripts/mcp-tools.ts under different LANG settings and docs/MCP.md comes out the same each time.

🤖 Generated with Claude Code

Closes #6885

commented

The MCP tool list and the tool table that bun scripts/mcp-tools.ts writes into docs/MCP.md now sort tools by plain code-point order, not by the machine's locale. Before, the tool list in src/http/mcp/tools.ts and the generator both used localeCompare. A table generated on one machine could then fail the "docs/MCP.md's tool table is current" check on a machine with different locale rules. That made the check red on pulls that had not touched MCP at all.

  • src/http/mcp/shared.ts adds one byName comparator (code-point order), and both src/http/mcp/tools.ts and scripts/mcp-tools.ts use it, so the two can't drift apart again.
  • test/mcp-tools.test.ts adds a case with names whose code-point order and localeCompare order disagree; it fails if either side goes back to locale sorting.

This branch is the same change as the closed pull #6941, with main (323 commits ahead) merged in so it lands on current code. #6941 was parked on "RepoSource: one repository, two places to read it from > a mirror reports its stages in order and ends holding the repo". That test is in test/view-source.test.ts, has nothing to do with this change, and passes here (23 pass). It looks flaky; I didn't investigate it.

Checked: bun x tsc --noEmit is clean, bun test test/mcp-tools.test.ts passes (168), and bun test test/view-source.test.ts passes (23).

To try it: run bun scripts/mcp-tools.ts under different LANG settings and docs/MCP.md comes out the same each time.

🤖 Generated with Claude Code

commented

Closed by the crew: superseded, its change is already on main in a3e1957a.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs