Skip to content

fix: pin zod-to-json-schema + add teammate communication prompt#17

Merged
Joao208 merged 1 commit into
mainfrom
joaobarros-/-fix-teammate-mcp-zod-compat
Mar 16, 2026
Merged

fix: pin zod-to-json-schema + add teammate communication prompt#17
Joao208 merged 1 commit into
mainfrom
joaobarros-/-fix-teammate-mcp-zod-compat

Conversation

@Joao208

@Joao208 Joao208 commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Descricao

Corrige dois problemas no agent-teams:

  1. Teammate MCP não inicializava: zod-to-json-schema@3.25.1 (puxado pelo @modelcontextprotocol/sdk@1.22.0) tenta importar zod/v3, subpath que só existe no zod@3.25.x. Como o lockfile resolvia zod@3.24.4, o server crashava com ERR_PACKAGE_PATH_NOT_EXPORTED antes de responder ao initialize. O lead funciona porque roda via npx (deps isoladas), mas o teammate roda via node direto no monorepo.

  2. Teammates não coordenam contratos de API: O prompt do spawner não instruía teammates a compartilhar contratos (paths, shapes) entre si. Backend e frontend implementavam paths independentes sem comunicação.

Mudanças

  • Adicionado pnpm.overrides no root pinnando zod-to-json-schema para ~3.24.5 (compatível com zod@3.24.x)
  • Adicionada seção TEAMMATE COMMUNICATION no prompt do spawner instruindo uso de send_message, write_artifact, e fetch_messages para coordenação de contratos

Etiquetas (Labels)

  • Correcao de Bug
  • Estrutura

Motivacao e Contexto

Agent teams spawned teammates que não conseguiam inicializar o MCP server, resultando em tasks que ficavam pending para sempre. Além disso, mesmo quando funcionavam, backend e frontend não conversavam sobre contratos de API.

Como Isso Foi Testado?

  • Outros (quais?)

Testado manualmente enviando JSON-RPC initialize para o teammate MCP server — antes crashava com ERR_PACKAGE_PATH_NOT_EXPORTED, agora responde corretamente.

Analise de Risco e Impacto

  • Baixo

Summary by CodeRabbit

  • New Features

    • Improved agent teammate communication with enhanced coordination guidelines for API contract sharing and message synchronization to strengthen workflow reliability.
  • Chores

    • Updated package dependency resolution configuration for better dependency management.

@coderabbitai

coderabbitai Bot commented Mar 16, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 513e2bb6-250d-45bc-824c-8e0ccec8c2a8

📥 Commits

Reviewing files that changed from the base of the PR and between 92cbd5f and b8d54d9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • packages/agent-teams-lead/src/spawner.ts

📝 Walkthrough

Walkthrough

Two files were modified: package.json received a new PNPM overrides configuration for zod-to-json-schema version ~3.24.5, and spawner.ts had a new "TEAMMATE COMMUNICATION" section added to the agent prompt with coordination guidelines for teammate interactions.

Changes

Cohort / File(s) Summary
Configuration
package.json
Added PNPM overrides block to pin zod-to-json-schema to version ~3.24.5 for package resolution control.
Agent Prompt Enhancement
packages/agent-teams-lead/src/spawner.ts
Added "TEAMMATE COMMUNICATION" section to the buildPrompt agent instructions, providing guidance on broadcasting API contracts via send_message, checking for contracts with fetch_messages, and coordinating with owning teammates.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A config tweak and words so clear,
For teammates near to lend an ear,
Broadcast contracts, fetch with care,
Coordination blooms everywhere! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes both main changes in the PR: pinning zod-to-json-schema and adding teammate communication guidance to the prompt.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch joaobarros-/-fix-teammate-mcp-zod-compat
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Joao208 Joao208 merged commit 3f76960 into main Mar 16, 2026
4 of 5 checks passed
@Joao208 Joao208 deleted the joaobarros-/-fix-teammate-mcp-zod-compat branch March 16, 2026 22:47
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