Skip to content

perf(contracts): optimize agent config change comparisons - #552

Open
Yevanchen wants to merge 1 commit into
mainfrom
agent/evanmore-codex/aa4b04ea
Open

perf(contracts): optimize agent config change comparisons#552
Yevanchen wants to merge 1 commit into
mainfrom
agent/evanmore-codex/aa4b04ea

Conversation

@Yevanchen

Copy link
Copy Markdown
Collaborator

Summary

  • Optimize agent config change classification by comparing ordered MCP server and skill arrays directly.
  • Add regression coverage that order changes remain visible for MCP bindings and skills.

Why

  • The complexity scan flagged repeated nested work in config change classification.
  • These arrays have stable ordered string fields, so linear comparison avoids full stable JSON serialization while preserving existing order-sensitive behavior.

Verification

  • Commands:
    • vp exec bun test apps/api/tests/agent-versioned-config-plan.test.ts
    • vp fmt --check pkgs/contracts/src/agent/agent-config-change-plan.contract.ts apps/api/tests/agent-versioned-config-plan.test.ts
    • vp run --filter @mosoo/contracts tc
    • vp run --filter @mosoo/contracts test
  • Manual steps: N/A
  • Not run: Full workspace vp run -w check

Impact

  • User/API/contract changes: No public contract shape changes; internal classification remains order-sensitive.
  • Generated files / GraphQL / DB / lockfile: N/A
  • Env or config changes: N/A
  • Risk and rollback: Low; rollback is reverting the single commit.

Review

  • Closest review areas: pkgs/contracts/src/agent/agent-config-change-plan.contract.ts, apps/api/tests/agent-versioned-config-plan.test.ts
  • Known trade-offs: Provider options and built-in tools still use stable serialization because nested object key order must remain normalized.

@Yevanchen
Yevanchen force-pushed the agent/evanmore-codex/aa4b04ea branch 2 times, most recently from 81d4868 to f14d54d Compare August 20, 2026 16:29
@Yevanchen
Yevanchen force-pushed the agent/evanmore-codex/aa4b04ea branch from f14d54d to 7b7ce39 Compare August 21, 2026 16: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.

1 participant