Skip to content

fix(scripts): normalise non-object mcpServers before jq update in Antigravity registration (#380) - #490

Draft
ZacLou wants to merge 1 commit into
monk-io:mainfrom
ZacLou:fix-antigravity-jq-mcpservers-normalize
Draft

ZacLou wants to merge 1 commit into
monk-io:mainfrom
ZacLou:fix-antigravity-jq-mcpservers-normalize

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 3, 2026

Copy link
Copy Markdown

Fixes #380.

The jq path in register_antigravity_mcp assumed mcpServers was already an object. When the existing ~/.gemini/config/mcp_config.json contained a string or array under mcpServers, jq aborted under set -e and the launcher exited.

Changes:

  • Before reading .mcpServers.monk.serverUrl, guard with if (.mcpServers | type) == "object".
  • Before writing .mcpServers.monk, normalise a non-object mcpServers to {}.
  • This mirrors the existing python3 fallback behaviour.
  • Add regression test tests/start-monk-agent-antigravity-jq-mcpServers-normalize.sh (skipped when jq is unavailable).

Verification:

  • New test validates that a config with "mcpServers":"legacy-string-value" is repaired while preserving unrelated top-level keys.

@ZacLou
ZacLou force-pushed the fix-antigravity-jq-mcpservers-normalize branch from 7af3a7a to 178bb5b Compare September 5, 2026 07:43
@ZacLou
ZacLou marked this pull request as draft September 5, 2026 08:38
@ZacLou
ZacLou force-pushed the fix-antigravity-jq-mcpservers-normalize branch from 178bb5b to 6e0bb33 Compare September 16, 2026 10:03
…igravity registration

The jq path in register_antigravity_mcp assumed mcpServers was already an
object, so a string or array value made jq abort under set -e and killed the
launcher. Mirror the python3 fallback behaviour: treat non-object mcpServers
as {} before reading or writing .mcpServers.monk.serverUrl.

Fixes monk-io#380.
@ZacLou
ZacLou force-pushed the fix-antigravity-jq-mcpservers-normalize branch from 6e0bb33 to cf0f277 Compare September 16, 2026 20:25
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.

[Bug bounty] POSIX Antigravity registration crashes when nested mcpServers is a non-object value

1 participant