Skip to content

Fix #12770 - Proper validation - update Antigravity default model and trim leading#18585

Merged
steipete merged 1 commit intoopenclaw:mainfrom
jeann2013:fix/12770-BlueBubbles-Leading-newlines-not-trimmed
Feb 16, 2026
Merged

Fix #12770 - Proper validation - update Antigravity default model and trim leading#18585
steipete merged 1 commit intoopenclaw:mainfrom
jeann2013:fix/12770-BlueBubbles-Leading-newlines-not-trimmed

Conversation

@jeann2013
Copy link
Contributor

@jeann2013 jeann2013 commented Feb 16, 2026

Title

Fix #12770 - Set valid Antigravity DEFAULT_MODEL and trim leading whitespace in BlueBubbles replies

Body

Summary

  • Problem: Antigravity was using an invalid DEFAULT_MODEL, and BlueBubbles replies could contain unintended leading whitespace when blocks were coalesced or dispatched.

  • Why it matters: The invalid model ID caused runtime failures during model resolution. Leading whitespace in outbound replies could break validation logic and produce inconsistent message formatting.

  • What changed:

    • Updated DEFAULT_MODEL to google-antigravity/claude-opus-4-5-thinking.
    • Trimmed leading whitespace when coalescing reply blocks.
    • Trimmed leading whitespace before validation and dispatch in BlueBubbles send path.
    • Updated English testing documentation to reference the new Antigravity model.
  • What did NOT change (scope boundary):

    • No changes to model selection logic beyond the default value.
    • No behavioral changes to reply formatting other than leading whitespace normalization.
    • No API contract or integration flow changes.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR


User-visible / Behavior Changes

  • Antigravity now defaults to a valid model ID.
  • BlueBubbles outbound messages no longer include unintended leading whitespace.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

No security surface changes introduced.


Repro + Verification

Environment

  • OS: Windows 11 / WSL2 Ubuntu 24.04
  • Runtime/container: Node (project default runtime)
  • Model/provider: Antigravity (Google provider)
  • Integration/channel: BlueBubbles
  • Relevant config (redacted): Default Antigravity configuration

Steps (Before Fix)

  1. Start with default Antigravity configuration.
  2. Trigger model resolution without explicit override.
  3. Observe model resolution failure due to invalid DEFAULT_MODEL.

For BlueBubbles:

  1. Send a multi-block reply containing leading newline(s).
  2. Observe outbound message including unintended leading whitespace.

Expected

  • Antigravity resolves a valid default model without runtime errors.
  • BlueBubbles replies are normalized (no leading whitespace).

Actual (Before Fix)

  • Runtime failure when resolving default Antigravity model.
  • Outbound BlueBubbles messages could contain leading whitespace.

Evidence

  • Trace/log snippets
  • Failing test/log before + passing after
  • Screenshot/recording
  • Perf numbers (if relevant)

Verified via runtime logs and manual integration testing.


Human Verification (required)

  • Verified scenarios:

    • Default Antigravity model loads successfully.
    • Multi-block replies are coalesced without leading whitespace.
    • BlueBubbles send path trims text before validation and dispatch.
  • Edge cases checked:

    • Multiple leading newline characters.
    • Empty string after trimming.
    • Normal single-block replies unaffected.
  • What you did NOT verify:

    • Full CI matrix across all providers.
    • Non-English doc variants (only English testing docs updated).

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

No migration steps required.


Failure Recovery (if this breaks)

  • How to disable/revert this change quickly:
    Revert this PR or restore previous DEFAULT_MODEL value.

  • Files/config to restore:

    • extensions/google-antigravity-auth/index.ts
    • BlueBubbles send path files
  • Known bad symptoms reviewers should watch for:

    • Model resolution failures.
    • Unexpected message formatting differences beyond leading whitespace.

Risks and Mitigations

  • Risk: Trimming could remove intentional formatting in rare cases.

    • Mitigation: Only leading whitespace is trimmed; internal formatting remains untouched.

Greptile Summary

Updates the Antigravity DEFAULT_MODEL from claude-opus-4-6-thinking to claude-opus-4-5-thinking and adds trimStart() normalization to BlueBubbles outbound text to strip leading whitespace before validation and dispatch. The model change aligns with the existing forward-compat fallback in src/agents/model-forward-compat.ts.

  • extensions/google-antigravity-auth/index.ts: DEFAULT_MODEL constant updated to valid model ID.
  • extensions/bluebubbles/src/send.ts: trimStart() added inside sendMessageBlueBubbles, normalizing leading whitespace for all callers (channel, actions, monitor-processing, media-send).
  • extensions/bluebubbles/src/channel.ts: trimStart() also added in the sendText outbound path before calling sendMessageBlueBubbles — this is redundant with the send.ts change but not harmful.
  • docs/help/testing.md: Model list updated on line 264, but two command-line examples on lines 241 and 269 still reference the old claude-opus-4-6-thinking model name. These should be updated for consistency.

Confidence Score: 3/5

  • Low-risk changes overall, but the docs have incomplete model name updates that will cause confusion when running smoke tests.
  • The code changes in send.ts, channel.ts, and index.ts are straightforward and correct. However, the docs update in testing.md is incomplete — two command-line examples still reference the old invalid model name, which undermines the purpose of this PR. Additionally, the zh-CN translation docs also still reference the old model name (though these are noted as generated and out of scope).
  • Pay close attention to docs/help/testing.md — lines 241 and 269 still reference the old model name claude-opus-4-6-thinking and need to be updated to match line 264.

Last reviewed commit: 36d193e

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

…im leading whitespace in BlueBubbles replies
@openclaw-barnacle openclaw-barnacle bot added docs Improvements or additions to documentation channel: bluebubbles Channel integration: bluebubbles extensions: google-antigravity-auth Extension: google-antigravity-auth size: XS labels Feb 16, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 16, 2026

Additional Comments (2)

docs/help/testing.md
Stale model name in command example
This line still references claude-opus-4-6-thinking but the model list on line 264 was updated to claude-opus-4-5-thinking. This should be updated to match.

  - Antigravity (OAuth): `OPENCLAW_LIVE_GATEWAY_MODELS="google-antigravity/claude-opus-4-5-thinking,google-antigravity/gemini-3-pro-high" pnpm test:live src/gateway/gateway-models.profiles.live.test.ts`
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/help/testing.md
Line: 241:241

Comment:
**Stale model name in command example**
This line still references `claude-opus-4-6-thinking` but the model list on line 264 was updated to `claude-opus-4-5-thinking`. This should be updated to match.

```suggestion
  - Antigravity (OAuth): `OPENCLAW_LIVE_GATEWAY_MODELS="google-antigravity/claude-opus-4-5-thinking,google-antigravity/gemini-3-pro-high" pnpm test:live src/gateway/gateway-models.profiles.live.test.ts`
```

How can I resolve this? If you propose a fix, please make it concise.

docs/help/testing.md
Stale model name in smoke command
Same issue here — the gateway smoke command still references claude-opus-4-6-thinking while the model list on line 264 was updated to claude-opus-4-5-thinking. This will cause the smoke test to use the old (invalid) model.

`OPENCLAW_LIVE_GATEWAY_MODELS="openai/gpt-5.2,openai-codex/gpt-5.3-codex,anthropic/claude-opus-4-6,google/gemini-3-pro-preview,google/gemini-3-flash-preview,google-antigravity/claude-opus-4-5-thinking,google-antigravity/gemini-3-flash,zai/glm-4.7,minimax/minimax-m2.1" pnpm test:live src/gateway/gateway-models.profiles.live.test.ts`
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/help/testing.md
Line: 269:269

Comment:
**Stale model name in smoke command**
Same issue here — the gateway smoke command still references `claude-opus-4-6-thinking` while the model list on line 264 was updated to `claude-opus-4-5-thinking`. This will cause the smoke test to use the old (invalid) model.

```suggestion
`OPENCLAW_LIVE_GATEWAY_MODELS="openai/gpt-5.2,openai-codex/gpt-5.3-codex,anthropic/claude-opus-4-6,google/gemini-3-pro-preview,google/gemini-3-flash-preview,google-antigravity/claude-opus-4-5-thinking,google-antigravity/gemini-3-flash,zai/glm-4.7,minimax/minimax-m2.1" pnpm test:live src/gateway/gateway-models.profiles.live.test.ts`
```

How can I resolve this? If you propose a fix, please make it concise.

@steipete steipete merged commit e179d45 into openclaw:main Feb 16, 2026
28 checks passed
@sebslight
Copy link
Member

Reverted in main.

  • Merged commit: e179d453c7d8aa3ffdc2dbd67fa5f5fbf93aa016
  • Revert commit: 0158e4129e5ee1de33ca4a83ca9e09fdb6e4b283

This PR was merged accidentally, so we reverted it to restore prior behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: bluebubbles Channel integration: bluebubbles docs Improvements or additions to documentation extensions: google-antigravity-auth Extension: google-antigravity-auth size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BlueBubbles: Leading newlines not trimmed from message text

3 participants

Comments