You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a problem with very heavily nested arguments to tools. This occurs when you see filters. You see that they are not passed through to the underlying api well.
Fixed the issue with heavily nested filter arguments not being passed through to the StackOne API properly.
Todo List:
Read repository setup instructions (CLAUDE.md)
Analyze current filter implementation in codebase
Examine parameter mapping and request building modules
Check StackOne toolset implementation
Review existing tests for filter handling
Investigate StackOne API documentation for proper filter format
Identify root cause of nested filter argument issue
Implement fix for nested filter handling
Test the fix and ensure compatibility
Run linting/testing if available
Commit changes
Root Cause ✅
The issue was in src/modules/requestBuilder.ts:149 where complex filter objects were being converted to [object Object] instead of proper deep object query parameter format.
Solution Implemented ✅
Added deep object serialization for query parameters:
serializeDeepObject() method: Recursively converts nested objects to proper query parameter format
shouldUseDeepObjectSerialization() method: Identifies when to apply deep object serialization (for filter and proxy parameters)
Enhanced execute() method: Uses appropriate serialization based on parameter type
src/modules/tests/requestBuilder.spec.ts - Test coverage
Changes Committed ✅
Committed fix with SHA: 5eaea8ba85f1608a0c0bb66a23bf1cd41a1c9dfb
The heavily nested filter arguments issue is now resolved! Filter and proxy parameters will be properly serialized as deep object query parameters, allowing complex filtering to work correctly with the StackOne API.
We have another issue I want you to build on the last change.
Very deeply nested schemas can take up alot of tokens in the prompt. We should truncate very nested params. and also have a tool which individually gets the full params for a tool name. we should direct the model to that if they have sent us the truncated params.
Added schemaTruncation option to BaseToolSetConfig
Updated OpenAPIToolSet and StackOneToolSet to apply truncation
Full schemas stored separately for fallback access
GetFullSchema Tool (src/tools/getFullSchema.ts):
Special tool automatically available when truncation is enabled
Retrieves complete untruncated schemas by tool name
Provides clear guidance to models when schemas are truncated
Integration Points:
Works with OpenAI format (tool.toOpenAI())
Works with AI SDK format (tool.toAISDK())
Maintains backward compatibility when truncation disabled
Usage Examples:
// Basic truncationconsttoolset=newStackOneToolSet({schemaTruncation: {maxDepth: 2}});// Custom configurationconsttoolset=newOpenAPIToolSet({filePath: 'spec.json',schemaTruncation: {maxDepth: 3,truncationMessage: 'Schema truncated - use getFullSchema for details',addTruncationIndicator: true}});// Get full schema when neededconstfullSchemaResult=awaitgetFullSchemaTool.execute({toolName: 'hris_create_employee'});
Test Coverage ✅
11/11 tests passing for schema truncation functionality
Configurable Depth: Control how deep schemas go (default: 3 levels)
Automatic Fallback: getFullSchema tool provides complete details when needed
Transparent Operation: Models get clear hints about truncated content
Backward Compatible: No breaking changes when feature disabled
Changes Committed ✅
Committed comprehensive schema truncation implementation with SHA: 82a0bf3
Files Modified:
src/utils/schema.ts - Core truncation logic
src/toolsets/base.ts - Base configuration and getFullSchema integration
src/toolsets/openapi.ts - OpenAPI toolset truncation support
src/toolsets/stackone.ts - StackOne toolset truncation support
src/tools/getFullSchema.ts - Fallback tool for complete schemas
examples/schema-truncation.ts - Usage examples and demos
src/tests/schema-truncation.spec.ts - Comprehensive test suite
Summary: Successfully implemented configurable schema truncation feature that reduces token usage for deeply nested parameters while maintaining full functionality through automatic fallback mechanisms. The feature is fully tested, documented, and ready for use.
Activity
mattzcarey commentedon Jun 6, 2025
@claude please work on this.
claude commentedon Jun 6, 2025
Claude finished @mattzcarey's task in 6m 38s —— View job •
claude/issue-38-20250606_164935• Create PR ➔Filter Bug Fix Complete ✅
Fixed the issue with heavily nested filter arguments not being passed through to the StackOne API properly.
Todo List:
Root Cause ✅
The issue was in
src/modules/requestBuilder.ts:149where complex filter objects were being converted to[object Object]instead of proper deep object query parameter format.Solution Implemented ✅
Added deep object serialization for query parameters:
serializeDeepObject()method: Recursively converts nested objects to proper query parameter formatshouldUseDeepObjectSerialization()method: Identifies when to apply deep object serialization (forfilterandproxyparameters)execute()method: Uses appropriate serialization based on parameter typeExamples of the fix:
{filter: {updated_after: "2020-01-01"}}→filter=[object Object]{filter: {updated_after: "2020-01-01"}}→filter[updated_after]=2020-01-01Supports deeply nested objects:
{filter: {nested: {level2: {deep: "value"}}}}→filter[nested][level2][deep]=valueTest Results ✅
Files Modified ✅
src/modules/requestBuilder.ts- Core fix implementationsrc/modules/tests/requestBuilder.spec.ts- Test coverageChanges Committed ✅
Committed fix with SHA:
5eaea8ba85f1608a0c0bb66a23bf1cd41a1c9dfbThe heavily nested filter arguments issue is now resolved! Filter and proxy parameters will be properly serialized as deep object query parameters, allowing complex filtering to work correctly with the StackOne API.
fix: implement deep object serialization for nested filter parameters
mattzcarey commentedon Jun 6, 2025
@claude
Great job claude.
We have another issue I want you to build on the last change.
Very deeply nested schemas can take up alot of tokens in the prompt. We should truncate very nested params. and also have a tool which individually gets the full params for a tool name. we should direct the model to that if they have sent us the truncated params.
claude commentedon Jun 6, 2025
Claude finished @mattzcarey's task in 12m 59s —— View job • Create PR ➔
Schema Truncation Feature Implementation ✅
Building on the previous filter parameter fix to optimize token usage by truncating deeply nested schemas.
Todo List:
Implementation Complete ✅
Core Features Implemented:
Schema Truncation Utility (
src/utils/schema.ts):truncateSchema()- Recursively truncates JSON schemas at configurable depthisSchemaTruncated()- Detects if a schema has been truncatedEnhanced Toolset Configuration:
schemaTruncationoption to BaseToolSetConfigGetFullSchema Tool (
src/tools/getFullSchema.ts):Integration Points:
tool.toOpenAI())tool.toAISDK())Usage Examples:
Test Coverage ✅
Token Savings Benefits ✅
getFullSchematool provides complete details when neededChanges Committed ✅
Committed comprehensive schema truncation implementation with SHA:
82a0bf3Files Modified:
src/utils/schema.ts- Core truncation logicsrc/toolsets/base.ts- Base configuration and getFullSchema integrationsrc/toolsets/openapi.ts- OpenAPI toolset truncation supportsrc/toolsets/stackone.ts- StackOne toolset truncation supportsrc/tools/getFullSchema.ts- Fallback tool for complete schemasexamples/schema-truncation.ts- Usage examples and demossrc/tests/schema-truncation.spec.ts- Comprehensive test suiteSummary: Successfully implemented configurable schema truncation feature that reduces token usage for deeply nested parameters while maintaining full functionality through automatic fallback mechanisms. The feature is fully tested, documented, and ready for use.
fix: implement deep object serialization for nested filter parameters (…