Skip to content

fix(agent): drop tool-row values left from a previous operation - #10080

Merged
waleedlatif1 merged 1 commit into
stagingfrom
sweep2/toolrow
Nov 16, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
sweep2/toolrow

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

An Agent tool row keeps its stored values when the user switches the row's operation, but it renders only the sub-blocks the new operation's condition shows. A value written only by now-hidden sub-blocks stayed out of sight. createLLMToolSchema also withheld that param from the model, because the user had "provided" it. The value still reached the block mapper and the vendor at execution. Four cases with the real block configs:

  • Checkr: geo ID left over from Get Geo, row switched to List Candidates. The candidate list gets an invisible geo filter.
  • Checkr: tags left over from Set Report Tags, row switched to Order Report. The old tags get attached to the new report.
  • Trello: archive status left over from Update Card, row switched to Update List. The model can no longer set closed. Once mappers fall back to tool-call args, the list gets archived.
  • CB Insights: websites left over from Look Up Organizations, row switched to Search Firmographics. Results get filtered by a field the user can't see.

Fix

omitConditionHiddenParams(subBlocks, params, operation) in lib/workflows/tool-input/hidden-params.ts drops a stored value only when every sub-block that writes it is decidably hidden under { ...params, operation }. The writers are sub-blocks matching the value's id or canonical id, widened to the whole basic/advanced group. Every unclear case keeps the value:

  • The operation must be one of the block's own operation option ids. Otherwise a clause on operation is undecided.
  • A clause on another field is decided only when the row holds a scalar value for that field. A stored 'true'/'5' is also tried as a boolean or number.
  • A function condition goes through a Proxy that watches which fields it reads. If it reads an undecided field, nothing is dropped. Example: Video Generator gates settings on model, which the model supplies at call time.
  • Credential and password fields, reactiveCondition fields, and params no sub-block writes are always kept.

Applied at:

  • transformBlockTool, before the schema, providerTool.params and the transform. This covers Agent and Pi tool rows, including rows saved before this change. The model now sees the param again when it is user-or-llm. Pi's projected-provenance copy keeps the same keys, the way the agent handler's copy already did.
  • Human-in-the-loop v2 notification tools (prepareNotificationToolParams). v1 is unchanged on purpose.
  • getParamsForToolOperation when the editor switches operations, so rows stop collecting stale values. It now takes the selected operation.

Canvas execution is not affected. The serializer already drops sub-blocks whose condition is false (shouldSerializeSubBlock).

Review

An independent read-only reviewer ran the helper against the real tool-row renderer (getSubBlocksForToolInput). It covered every block with tools, including github, slack, gmail, google_sheets, table, file, notion, hubspot, jira, trello, checkr, cbinsights, airtable, salesforce and microsoft_teams, across every operation. For each operation it tried each option value of each dropdown, switch and checkbox, with values typed and as strings, and stored under both the sub-block id and the canonical id. That came to about 117k combinations and about 1M rendered fields. No visible value was dropped.

Tests

The new cases in providers/utils.test.ts run the real transform and prepareToolExecution with the real block configs:

  • Four stale-value cases: Trello, CB Insights, and both Checkr cases. Each fails when the transformBlockTool guard is reverted.
  • The operation-switch case fails when the getParamsForToolOperation guard is reverted.
  • Cases that must keep their value: a canonical pair stored under the basic member, the advanced member, or the canonical id; a pure tool param; and an operation the block doesn't list.

bun run test passes for providers/utils.test.ts, tools/index.test.ts, the agent, HITL and Pi handler suites, and the custom-block and tool-input suites.

🤖 Generated with Claude Code

A tool row keeps stored values across operation switches but renders only the
sub-blocks the new operation shows. A value written only by hidden sub-blocks
stayed out of sight, was withheld from the model's schema as user-provided,
and still reached the block mapper and the vendor.

omitConditionHiddenParams drops a stored value only when every sub-block that
writes it (canonical group included) is decidably hidden for the selected
operation. Agent and Pi tool rows (transformBlockTool), Human-in-the-loop v2
notification tools, and the editor's operation switch all apply it.
@vercel

vercel Bot commented Nov 16, 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 16, 2026 3:00am 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 7 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 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were established.

Summary

The PR removes stored tool-row values when every matching field is clearly hidden by the selected operation.

  • Tool rows drop stored values when the selected operation hides their fields.

No actionable issues were established. Tests were inspected but not run during this review.

Intentional exclusion: waleedlatif1 states that Human-in-the-loop v1 remains unchanged to preserve its existing behavior.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Stored[Stored tool-row values] --> Filter[Remove clearly hidden values]
  Operation[Selected operation] --> Filter
  Fields[Block field conditions] --> Filter
  Filter --> Schema[Build model schema]
  Filter --> Merge[Merge model arguments]
  Merge --> Transform[Apply existing block transform]
  Transform --> Execute[Execute tool]
Loading

Reviews (1) · Last reviewed commit: "fix(agent): drop tool-row values left fr..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit e018bde into staging Nov 16, 2026
81 checks passed
@waleedlatif1
waleedlatif1 deleted the sweep2/toolrow branch November 16, 2026 04:00

This branch was previously deployed

1 inactive deployment
Preview — 592a925f Deployed Nov 16, 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