improvement(blocks): extract model config subBlocks into shared utils#3162
improvement(blocks): extract model config subBlocks into shared utils#3162waleedlatif1 wants to merge 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryExtracted model configuration logic (reasoning effort, verbosity, thinking level, temperature, max tokens) from the agent block into reusable utilities ( Key Changes:
Code Quality:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Agent as agent.ts
participant Utils as blocks/utils.ts
participant Providers as @/providers/utils
participant Stores as Workflow Stores
Note over Agent,Utils: Before: Inline Config (230 lines)
Agent->>Agent: Define reasoningEffort subBlock
Agent->>Agent: Define verbosity subBlock
Agent->>Agent: Define thinkingLevel subBlock
Agent->>Agent: Define temperature (max=1) subBlock
Agent->>Agent: Define temperature (max=2) subBlock
Agent->>Agent: Define maxTokens subBlock
Agent->>Agent: Define input types for all configs
Note over Agent,Utils: After: Shared Utilities
Agent->>Utils: ...getModelConfigSubBlocks()
Utils->>Providers: Import model config helpers
Utils->>Utils: Define 6 config subBlocks
Utils->>Stores: fetchOptions() queries workflow state
Stores-->>Utils: Return blockValues with model
Utils->>Providers: getReasoningEffortValuesForModel(model)
Utils->>Providers: getVerbosityValuesForModel(model)
Utils->>Providers: getThinkingLevelsForModel(model)
Utils-->>Agent: Return config subBlocks array
Agent->>Utils: ...MODEL_CONFIG_INPUTS
Utils-->>Agent: Return config input definitions
Note over Agent,Utils: Result: ~230 lines removed from agent.ts
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| }, | ||
| }, | ||
|
|
||
| ...getModelConfigSubBlocks(), |
There was a problem hiding this comment.
SubBlock ordering changed, moving temperature/maxTokens earlier in UI
Low Severity
The refactoring changes the ordering of subBlocks in the UI. Originally, temperature and maxTokens appeared after the memory-related fields (slidingWindowTokens). By using ...getModelConfigSubBlocks() at line 139, these fields now appear earlier, right after vertexCredential and before azureEndpoint. The PR description states "no behavior change" but this alters the visual arrangement users see in advanced mode.


Summary
getModelConfigSubBlocks()andMODEL_CONFIG_INPUTShelpers inblocks/utils.tsType of Change
Testing
Tested with
tsc --noEmit- no type errorsChecklist