Skip to content

improvement(mothership): whitespace only deltas need to be preserved, update docs for theshold billing#4212

Merged
icecrasher321 merged 2 commits intostagingfrom
fix/rand-apr-16
Apr 17, 2026
Merged

improvement(mothership): whitespace only deltas need to be preserved, update docs for theshold billing#4212
icecrasher321 merged 2 commits intostagingfrom
fix/rand-apr-16

Conversation

@icecrasher321
Copy link
Copy Markdown
Collaborator

Summary

  • Whitespace trimming led to odd space missing
  • Update docs for threshold billing

Type of Change

  • Bug fix
  • Documentation

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Apr 17, 2026 2:19am

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 17, 2026

PR Summary

Medium Risk
Changes the default threshold for incremental overage invoicing, which can alter when customers are charged if OVERAGE_THRESHOLD_DOLLARS isn’t set. The UI change affects chat message rendering by allowing whitespace-only text blocks to display, which could surface new formatting edge cases.

Overview
Updates threshold billing defaults from $50 → $100 across product config and documentation: DEFAULT_OVERAGE_THRESHOLD and env.OVERAGE_THRESHOLD_DOLLARS default are raised, and the docs/FAQ examples are rewritten to match the new trigger.

Fixes a Mothership chat rendering issue by no longer trimming text block content in parseBlocks, allowing whitespace-only deltas to be preserved instead of being dropped.

Reviewed by Cursor Bugbot for commit e890972. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 17, 2026

Greptile Summary

This PR makes two independent fixes: it corrects the whitespace-trimming guard in parseBlocks so that whitespace-only text deltas are no longer silently dropped during streaming, and it updates the overage billing threshold from $50 to $100 across the constants, environment default, and documentation.

Confidence Score: 5/5

Safe to merge — both changes are targeted and low-risk.

The whitespace fix is a one-line guard change with no behavioural side-effects beyond the intended preservation of whitespace deltas. The billing threshold update is applied consistently across the constant, env default, and docs, with no other call-sites left at the old value. No P0 or P1 findings.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx Bug fix: replaces !block.content?.trim() with !block.content so whitespace-only text blocks are no longer skipped during message parsing.
apps/sim/lib/billing/constants.ts Raises DEFAULT_OVERAGE_THRESHOLD from 50 to 100 to match the updated billing policy.
apps/sim/lib/core/config/env.ts Raises the default for OVERAGE_THRESHOLD_DOLLARS from 50 to 100, keeping the env default in sync with the constant.
apps/docs/content/docs/en/execution/costs.mdx Documentation updated to reflect the new $100 threshold billing trigger with revised examples.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[ContentBlock arrives\ntype = 'text'] --> B{block.content\nfalsily empty?}
    B -- "null / undefined / ''" --> C[skip block\ncontinue]
    B -- "non-empty\n(including whitespace-only)" --> D[process block]
    D --> E{block.subagent set?}
    E -- yes --> F[append to agent group]
    E -- no --> G[append to top-level segments]

    style C fill:#f5a5a5,stroke:#c0392b
    style D fill:#a5d6a7,stroke:#2e7d32
Loading

Reviews (1): Last reviewed commit: "update overage threshold docs" | Re-trigger Greptile

@icecrasher321 icecrasher321 merged commit a589c8e into staging Apr 17, 2026
14 checks passed
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