Skip to content

improvement(blocks): share the tool-call fallback helper and tidy the Hex/Stripe validation code - #10014

Merged
waleedlatif1 merged 1 commit into
stagingfrom
improvement/tool-call-fallback-cleanup
Nov 13, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
improvement/tool-call-fallback-cleanup

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Adds isToolCall(context) / toolCallArg(context, value) to blocks/utils.ts. The "use the model's tool-named arg only on a tool call" rule from fix(hex,stripe): validate Hex and Stripe against their API docs #10005/fix(blocks): keep agent-supplied tool args that block mappers remap from dedicated fields #10006/fix(google-drive): keep the page token an agent passes #10008 is now written once instead of hand-rolled in 10 blocks:
    • three local agentArg closures (outlook's returned null, the others undefined);
    • two isAgentCall predicates;
    • inline context?.operation ? … : undefined ternaries.
  • Stripe:
    • one listCursorParams / appendListCursors helper replaces the cursor params and guard copied into the 8 list tools;
    • the search metadata schema spreads the list one;
    • the dead op and the redundant checks in update/create subscription are removed.
  • Hex: shorter emptyToUndefined, plus one fieldOrToolArg for the cursor and user id fallbacks.
  • Tests:
    • removes a duplicate Drive test and collapses an it.each that only exercised one branch;
    • Hex requestUrl takes the context instead of three inline copies;
    • the six copied requireParamsMapper helpers are gone.
  • Comments: trims the redundant, overlong and history-describing ones, and fixes the wording that said only agents pass a context (Pi and Human v2 do too).
  • Behavior is unchanged with one deliberate exception: Hex and Stripe now use the same truthy check as every other block, so a tool call whose context operation is an empty string is treated like the canvas there too.

Type of Change

  • Improvement (refactor)

Testing

  • Generated tool metadata, integration docs and the deployment catalog are byte-identical after regenerating.
  • An equivalence fuzz of the old vs new mapper for all 10 blocks covered every touched key across empty, whitespace, string, boolean and number values, with and without a tool-call context. 2.48M cases, no differences outside the empty-operation case above.
  • A fuzz of the 8 Stripe list tools' params, URLs and errors plus the subscription bodies ran 2,072 cases with no differences.
  • 13 block/tool test files (278 tests) pass.
  • check:utils, check:test-patterns, check:comment-hygiene, check:file-names, check:explicit-any and check-block-registry origin/staging pass, plus lint and type-check in the pre-push hook.

Checklist

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

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 13, 2026 9:26pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 30 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Shares the tool-call fallback across ten blocks and removes repeated Stripe cursor code.

  • Block mappings use one shared rule to choose tool-call arguments.
  • Stripe list tools share cursor rules across their endpoints.
  • Stripe subscription checks keep using the same values in shorter code.

Acknowledged intentional change: waleedlatif1 states that Hex and Stripe should treat an empty context operation like the canvas, matching the other blocks.

Reviews (1) · Last reviewed commit: "improvement(blocks): share the tool-call..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit 30f6b8e into staging Nov 13, 2026
80 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/tool-call-fallback-cleanup branch November 13, 2026 21:38

This branch was previously deployed

1 inactive deployment
Preview — 9fca01ff Deployed Nov 13, 2026 by vercel[bot]
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