fix: resolve 301-second timeout on large PRD parsing#1502
fix: resolve 301-second timeout on large PRD parsing#1502Crunchyman-ralph wants to merge 2 commits intonextfrom
Conversation
- Enhanced base-provider.js with timeout support using AbortController - Updated anthropic.js to pass timeoutMs to createProxyFetch() - Modified ai-services-unified.js to flow timeoutMs to provider calls - Increased parse-prd default timeout from 180s to 15 minutes - Updated both streaming and non-streaming handlers to use HTTP timeout Fixes issue where parse-prd would consistently timeout at ~301 seconds due to default HTTP client timeout. Now supports long-running operations up to 15 minutes by default, with proper timeout parameter flow-through to the underlying HTTP client. Co-authored-by: Ralph Khreish <[email protected]>
🦋 Changeset detectedLatest commit: 500ae4e The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis PR addresses timeout issues during large PRD parsing by threading a timeoutMs parameter through the AI service pipeline. The default streaming timeout is increased from 3 minutes to 15 minutes, and timeout support is added to the BaseAIProvider's HTTP client layer via AbortController-based timeout implementation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Areas requiring extra attention:
Possibly related issues
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
@claude add a changeset in .changesets |
|
Claude finished @Crunchyman-ralph's task —— View job Adding Changeset ✅Added a changeset for the timeout fix. Todo List:
Summary:
The changeset bot should now detect the changeset file and stop reporting missing changeset warnings. |
Co-authored-by: Ralph Khreish <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test-timeout-fix.js (1)
1-85: Test harness correctly verifies timeout functionality.The test script effectively demonstrates timeout support by:
- Creating a test provider extending
BaseAIProvider- Testing default and custom timeout configurations
- Exercising the timeout mechanism with a real HTTP request
- Including graceful error handling for network failures
The implementation correctly validates the timeout threading changes across the provider stack.
Consider moving to formal test suite.
This standalone test script provides valuable verification but might be better suited as a formal unit or integration test in the test directory for CI execution. The current approach with network requests to external endpoints may be unreliable in CI environments.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
.changeset/resolve-timeout-fix.md(1 hunks)scripts/modules/ai-services-unified.js(2 hunks)scripts/modules/task-manager/parse-prd/parse-prd-config.js(1 hunks)scripts/modules/task-manager/parse-prd/parse-prd-non-streaming.js(1 hunks)scripts/modules/task-manager/parse-prd/parse-prd-streaming.js(2 hunks)src/ai-providers/anthropic.js(1 hunks)src/ai-providers/base-provider.js(1 hunks)test-timeout-fix.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
scripts/modules/ai-services-unified.js
📄 CodeRabbit inference engine (.cursor/rules/ai_providers.mdc)
In
scripts/modules/ai-services-unified.js, import new providers and add entries to thePROVIDER_FUNCTIONSmap withgenerateText,streamText, andgenerateObjectpropertiesai-services-unified.js should export generateTextService and generateObjectService, handle provider/model selection based on role and .taskmasterconfig, resolve API keys, implement fallback and retry logic, and orchestrate calls to provider-specific implementations
Files:
scripts/modules/ai-services-unified.js
**/*.js
📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)
**/*.js: Always use isSilentMode() function to check current silent mode status instead of directly accessing the global silentMode variable or global.silentMode
Use try/finally block pattern when wrapping core function calls with enableSilentMode/disableSilentMode to ensure silent mode is always restored, even if errors occur
For functions that need to handle both a passed silentMode parameter and check global state, check both the function parameter and global state: const isSilent = options.silentMode || (typeof options.silentMode === 'undefined' && isSilentMode())
Functions should accept their dependencies as parameters rather than using globals to promote testability and explicit dependency injection
Define callbacks as separate functions for easier testing rather than inline functions
Files:
scripts/modules/ai-services-unified.jsscripts/modules/task-manager/parse-prd/parse-prd-non-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-streaming.jssrc/ai-providers/anthropic.jstest-timeout-fix.jssrc/ai-providers/base-provider.jsscripts/modules/task-manager/parse-prd/parse-prd-config.js
scripts/**/*.js
📄 CodeRabbit inference engine (.cursor/rules/context_gathering.mdc)
scripts/**/*.js: Use theContextGathererclass fromscripts/modules/utils/contextGatherer.jsto extract context from multiple sources (tasks, files, custom text, project tree) with token counting usinggpt-tokenslibrary
InitializeContextGathererwith project root and tasks path, then callgather()method with tasks array, files array, customContext, includeProjectTree, format ('research', 'chat', or 'system-prompt'), and includeTokenCounts options
Use theFuzzyTaskSearchclass fromscripts/modules/utils/fuzzyTaskSearch.jsfor intelligent task discovery with semantic matching, purpose categorization, and relevance scoring using Fuse.js
Implement a three-step initialization pattern for context-aware commands: (1) validate and parse parameters, (2) initialize context gatherer and find project root, (3) auto-discover relevant tasks using fuzzy search if task IDs not specified
Display token breakdown usingboxenlibrary with sections for tasks, files, and prompts, showing formatted token counts and file sizes in a clean bordered box with title
Process AI result responses usingcli-highlightlibrary to apply syntax highlighting to code blocks with language detection in the formatlanguage\ncode
Set reasonable file size limits (50KB default) and project tree depth limits (3-5 levels) when gathering context to maintain performance
Implement graceful error handling for context gathering: handle missing files with warnings, validate task IDs with helpful messages, continue processing if some context sources fail, and provide fallback behavior
Files:
scripts/modules/ai-services-unified.jsscripts/modules/task-manager/parse-prd/parse-prd-non-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-config.js
scripts/modules/**/*
📄 CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)
Restart the MCP server if core logic in
scripts/modulesor MCP tool definitions change
Files:
scripts/modules/ai-services-unified.jsscripts/modules/task-manager/parse-prd/parse-prd-non-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-config.js
scripts/modules/*.js
📄 CodeRabbit inference engine (.cursor/rules/mcp.mdc)
When implementing MCP support for a command, ensure the core logic function can suppress console output via an outputFormat parameter or other mechanism
scripts/modules/*.js: Use consistent file naming conventions:task_${id.toString().padStart(3, '0')}.txtfor task files; usepath.join()for composing paths; use appropriate extensions (.txt for tasks, .json for data)
Export all core functions, helper functions, and utility methods needed by dependent code from their respective modules; explicitly verify module export blocks at the bottom of files
Use structured error objects with code and message properties; include clear error messages; handle both function-specific and file system errors; log errors at appropriate severity levels
UseisSilentMode()function to check global silent mode status; wrap core function calls within direct functions usingenableSilentMode()anddisableSilentMode()in try/finally blocks if the core function produces console output not reliably controlled by outputFormat parameter
Ensure AI calls correctly handle and propagatetelemetryDataas described intelemetry.mdc
Import context gathering utilities (ContextGatherer,FuzzyTaskSearch) for AI-powered commands; support multiple context types (tasks, files, custom text, project tree); implement detailed token breakdown display
PrefergenerateTextServicefor calls sending large context (like stringified JSON) where incremental display is not needed; import necessary service functions fromai-services-unified.jsand prepare parameters (role, session, systemPrompt, prompt)
Create a clear unidirectional flow of dependencies between modules; separate business logic from UI rendering to avoid circular dependencies
Design functions to accept dependencies as parameters; avoid hard-coded dependencies that are difficult to mock
Keep pure logic separate from I/O operations or UI rendering to allow testing logic without mocking complex dependencies
Design core logic to work wi...
Files:
scripts/modules/ai-services-unified.js
**/*.{js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)
JavaScript test files using Jest must follow the same testing patterns as TypeScript files, include proper mocking of external dependencies, and achieve the same coverage thresholds
Files:
scripts/modules/ai-services-unified.jsscripts/modules/task-manager/parse-prd/parse-prd-non-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-streaming.jssrc/ai-providers/anthropic.jstest-timeout-fix.jssrc/ai-providers/base-provider.jsscripts/modules/task-manager/parse-prd/parse-prd-config.js
**/*.{js,ts}
📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements
Files:
scripts/modules/ai-services-unified.jsscripts/modules/task-manager/parse-prd/parse-prd-non-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-streaming.jssrc/ai-providers/anthropic.jstest-timeout-fix.jssrc/ai-providers/base-provider.jsscripts/modules/task-manager/parse-prd/parse-prd-config.js
scripts/modules/**/*.{js,ts}
📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
scripts/modules/**/*.{js,ts}: Implement silent migration for tasks.json files that transforms old format to tagged format, marking global flag and performing complete migration
Implement tag resolution functions (getTasksForTag, setTasksForTag, getCurrentTag) that provide backward compatibility with legacy format and default to master tag
Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking
When a logger object is passed as a parameter to core functions, ensure the receiving function can call methods like .info, .warn, .error on that object
Files:
scripts/modules/ai-services-unified.jsscripts/modules/task-manager/parse-prd/parse-prd-non-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-config.js
scripts/modules/task-manager/**/*.{js,mjs}
📄 CodeRabbit inference engine (.cursor/rules/tags.mdc)
scripts/modules/task-manager/**/*.{js,mjs}: Pass context object{ projectRoot, tag }to all core functions that read or write tasks
Core task functions must accept a context parameter with{ projectRoot, tag }properties
UsereadJSON(tasksPath, projectRoot, tag)andwriteJSON(tasksPath, data, projectRoot, tag)for all task data access
Files:
scripts/modules/task-manager/parse-prd/parse-prd-non-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-config.js
scripts/modules/task-manager/**/*.js
📄 CodeRabbit inference engine (.cursor/rules/telemetry.mdc)
scripts/modules/task-manager/**/*.js: AI service functions in core logic (e.g., in scripts/modules/task-manager/) must call the appropriate AI service function (e.g., generateObjectService) and pass commandName and outputType in the params object
Core logic functions must extract mainResult from aiServiceResponse and return an object that includes aiServiceResponse.telemetryData
Core logic functions with outputFormat parameter must check if outputFormat === 'text' and call displayAiUsageSummary(aiServiceResponse.telemetryData, 'cli') from scripts/modules/ui.js when applicable
Files:
scripts/modules/task-manager/parse-prd/parse-prd-non-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-config.js
scripts/modules/task-manager/**/*.{js,ts}
📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
Do not call AI-specific getters (like getMainModelId, getMainMaxTokens) from core logic functions in scripts/modules/task-manager/*. Instead, pass the role to the unified AI service
Files:
scripts/modules/task-manager/parse-prd/parse-prd-non-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-config.js
src/ai-providers/*.js
📄 CodeRabbit inference engine (.cursor/rules/ai_providers.mdc)
src/ai-providers/*.js: Create a new provider module insrc/ai-providers/<provider-name>.jsthat implementsgenerate<ProviderName>Text,stream<ProviderName>Text, andgenerate<ProviderName>Objectfunctions using the Vercel AI SDK
Provider modules insrc/ai-providers/must importgenerateText,streamText,generateObjectfrom theaipackage, the provider'screate<ProviderName>function from@ai-sdk/<provider-name>, and thelogutility from../../scripts/modules/utils.js
Provider functions must include basic validation and try/catch error handlingsrc/ai-providers/*.js files should contain provider-specific wrappers for Vercel AI SDK functions and interact directly with Vercel AI SDK adapters
Files:
src/ai-providers/anthropic.jssrc/ai-providers/base-provider.js
🧠 Learnings (31)
📓 Common learnings
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:23.032Z
Learning: Pull Request descriptions must include: Task Overview, Subtasks Completed (checklist), Implementation Details, Testing approach, Breaking Changes (if any), and Related Tasks.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1444
File: apps/cli/src/utils/auto-update/changelog.ts:103-111
Timestamp: 2025-11-25T18:32:29.828Z
Learning: The claude-task-master project uses a custom changelog format with PR numbers and author acknowledgements in the pattern `- [#PR](...) Thanks [author]! - Description`, which is parsed by the regex in apps/cli/src/utils/auto-update/changelog.ts.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to scripts/modules/ai-services-unified.js : ai-services-unified.js should export generateTextService and generateObjectService, handle provider/model selection based on role and .taskmasterconfig, resolve API keys, implement fallback and retry logic, and orchestrate calls to provider-specific implementations
Applied to files:
scripts/modules/ai-services-unified.jstest-timeout-fix.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Do not implement fallback or retry logic outside `ai-services-unified.js`; all fallback sequences and retry logic must be centralized in the unified service
Applied to files:
scripts/modules/ai-services-unified.js
📚 Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Do not wrap unified AI service calls (generateTextService, generateObjectService) in silent mode; their logging is handled internally
Applied to files:
scripts/modules/ai-services-unified.js
📚 Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to scripts/modules/ai-services-unified.js : In `scripts/modules/ai-services-unified.js`, import new providers and add entries to the `PROVIDER_FUNCTIONS` map with `generateText`, `streamText`, and `generateObject` properties
Applied to files:
scripts/modules/ai-services-unified.jstest-timeout-fix.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js, scripts/modules/ai-services-unified.js : Do not import or call anything from deprecated AI service files (`ai-services.js`, `ai-client-factory.js`, `ai-client-utils.js`)
Applied to files:
scripts/modules/ai-services-unified.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Prefer `generateTextService` for calls sending large context (like stringified JSON) where incremental display is not needed; import necessary service functions from `ai-services-unified.js` and prepare parameters (role, session, systemPrompt, prompt)
Applied to files:
scripts/modules/ai-services-unified.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Do not fetch AI-specific parameters (model ID, max tokens, temperature) using `config-manager.js` getters for AI calls; pass the `role` parameter instead to the unified service
Applied to files:
scripts/modules/ai-services-unified.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,ts} : Do not call AI-specific getters (like getMainModelId, getMainMaxTokens) from core logic functions in scripts/modules/task-manager/*. Instead, pass the role to the unified AI service
Applied to files:
scripts/modules/ai-services-unified.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Centralize all LLM calls through `generateTextService` or `generateObjectService` from `ai-services-unified.js`
Applied to files:
scripts/modules/ai-services-unified.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/ai-services.js : AI integration features should be placed in `ai-services.js`
Applied to files:
scripts/modules/ai-services-unified.js
📚 Learning: 2025-07-20T01:35:05.831Z
Learnt from: rtmcrc
Repo: eyaltoledano/claude-task-master PR: 933
File: scripts/modules/task-manager/parse-prd.js:226-226
Timestamp: 2025-07-20T01:35:05.831Z
Learning: The parsePRD function in scripts/modules/task-manager/parse-prd.js has a different parameter structure than other task-manager functions - it uses `options` parameter instead of `context` parameter because it generates tasks from PRD documents rather than operating on existing tasks.
Applied to files:
scripts/modules/task-manager/parse-prd/parse-prd-non-streaming.jsscripts/modules/task-manager/parse-prd/parse-prd-config.js
📚 Learning: 2025-11-24T18:02:36.388Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.388Z
Learning: Applies to scripts/modules/task-manager.js : Extract tasks from PRD documents using AI within the current tag context (defaulting to "master"), providing clear prompts to guide AI task generation and validating/cleaning up AI-generated tasks
Applied to files:
scripts/modules/task-manager/parse-prd/parse-prd-non-streaming.js.changeset/resolve-timeout-fix.md
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,mjs} : Pass context object `{ projectRoot, tag }` to all core functions that read or write tasks
Applied to files:
scripts/modules/task-manager/parse-prd/parse-prd-streaming.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,mjs} : Core task functions must accept a context parameter with `{ projectRoot, tag }` properties
Applied to files:
scripts/modules/task-manager/parse-prd/parse-prd-streaming.js
📚 Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to tests/unit/ai-providers/*.test.js : Create unit tests in `tests/unit/ai-providers/<provider-name>.test.js` that mock the provider's AI SDK module and test each exported function for correct client instantiation, parameter passing, result handling, and error handling
Applied to files:
test-timeout-fix.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : Do not import or instantiate real AI service clients. Create fully mocked versions that return predictable responses. Mock the entire module with controlled behavior.
Applied to files:
test-timeout-fix.js
📚 Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to src/ai-providers/*.js : Provider modules in `src/ai-providers/` must import `generateText`, `streamText`, `generateObject` from the `ai` package, the provider's `create<ProviderName>` function from `ai-sdk/<provider-name>`, and the `log` utility from `../../scripts/modules/utils.js`
Applied to files:
test-timeout-fix.js
📚 Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to src/ai-providers/*.js : Provider functions must include basic validation and try/catch error handling
Applied to files:
test-timeout-fix.jssrc/ai-providers/base-provider.js
📚 Learning: 2025-11-24T18:03:13.456Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.456Z
Learning: Applies to tests/setup.ts : Create global test setup file that configures jest.setTimeout(10000), clears all mocks after each test with jest.clearAllMocks(), and initializes global test configuration
Applied to files:
test-timeout-fix.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : Make async operations synchronous in tests. Mock async functions to return synchronous values when possible. Don't use real async/await or Promise resolution that might fail unpredictably.
Applied to files:
test-timeout-fix.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Ensure AI calls correctly handle and propagate `telemetryData` as described in `telemetry.mdc`
Applied to files:
test-timeout-fix.js
📚 Learning: 2025-11-24T18:03:13.456Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.456Z
Learning: Applies to tests/e2e/**/*.test.ts : End-to-end tests must test complete user workflows across multiple API endpoints in sequence, verify state changes between workflow steps, use extended timeouts (30000ms), and validate final outcomes without mocking business logic
Applied to files:
test-timeout-fix.js
📚 Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to src/ai-providers/*.js : Create a new provider module in `src/ai-providers/<provider-name>.js` that implements `generate<ProviderName>Text`, `stream<ProviderName>Text`, and `generate<ProviderName>Object` functions using the Vercel AI SDK
Applied to files:
test-timeout-fix.js
📚 Learning: 2025-11-24T18:03:13.456Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.456Z
Learning: Test files must be organized with unit tests separate from integration and e2e tests using project configuration in jest.config.js to maintain clear test separation and different timeout/environment settings
Applied to files:
test-timeout-fix.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to src/ai-providers/*.js : src/ai-providers/*.js files should contain provider-specific wrappers for Vercel AI SDK functions and interact directly with Vercel AI SDK adapters
Applied to files:
test-timeout-fix.js
📚 Learning: 2025-08-12T01:22:48.873Z
Learnt from: olssonsten
Repo: eyaltoledano/claude-task-master PR: 1112
File: src/profiles/roo.js:0-0
Timestamp: 2025-08-12T01:22:48.873Z
Learning: In src/profiles/roo.js, the enhanceRooMCPConfiguration function was simplified to only set server.timeout = 300, removing problematic overwrites of server.env and alwaysAllow configurations that could interfere with user settings.
Applied to files:
scripts/modules/task-manager/parse-prd/parse-prd-config.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/*/[!.]* : Tag resolution must follow the priority order: explicit `--tag` flag, then `getCurrentTag(projectRoot)`, then default to 'master'
Applied to files:
scripts/modules/task-manager/parse-prd/parse-prd-config.js
📚 Learning: 2025-11-24T18:05:23.901Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/AGENTS.md:0-0
Timestamp: 2025-11-24T18:05:23.901Z
Learning: Parse PRD files with `task-master parse-prd` and use `--append` flag to add new tasks to existing task lists without losing current tasks
Applied to files:
.changeset/resolve-timeout-fix.md
📚 Learning: 2025-11-24T18:00:06.827Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:06.827Z
Learning: For large feature initiatives, create a dedicated task context (tag), draft a PRD collaboratively, then use `task-master parse-prd` to generate tasks within that tag
Applied to files:
.changeset/resolve-timeout-fix.md
📚 Learning: 2025-11-24T18:05:23.901Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/AGENTS.md:0-0
Timestamp: 2025-11-24T18:05:23.901Z
Learning: Applies to assets/.taskmaster/docs/*.md : Use `.md` extension (rather than `.txt`) for PRD files in `.taskmaster/docs/` for better editor support and markdown rendering
Applied to files:
.changeset/resolve-timeout-fix.md
🧬 Code graph analysis (5)
scripts/modules/task-manager/parse-prd/parse-prd-non-streaming.js (2)
scripts/modules/commands.js (1)
config(168-168)scripts/modules/task-manager/parse-prd/parse-prd.js (3)
config(198-198)config(211-211)config(219-219)
src/ai-providers/anthropic.js (1)
scripts/modules/ai-services-unified.js (1)
baseURL(550-550)
test-timeout-fix.js (2)
src/ai-providers/base-provider.js (1)
BaseAIProvider(19-537)scripts/modules/ai-services-unified.js (2)
provider(379-379)provider(549-549)
src/ai-providers/base-provider.js (2)
scripts/modules/commands.js (2)
projectRoot(415-415)projectRoot(5197-5197)scripts/modules/task-manager/update-tasks.js (1)
projectRoot(69-69)
scripts/modules/task-manager/parse-prd/parse-prd-config.js (1)
src/utils/timeout-manager.js (1)
Duration(135-189)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Typecheck
🔇 Additional comments (13)
scripts/modules/ai-services-unified.js (2)
506-508: LGTM! Timeout parameter extraction is correctly implemented.The
timeoutMsparameter is properly extracted from params alongside other optional parameters, following the existing pattern.
682-682: LGTM! Timeout parameter propagation is correctly implemented.The
timeoutMsis conditionally added tocallParamsusing the same pattern asexperimental_transform, ensuring consistency. The conditional spread ensures the parameter is only included when provided..changeset/resolve-timeout-fix.md (1)
1-7: LGTM! Changeset documentation is clear and accurate.The changeset correctly documents the timeout fix as a patch, with a clear description of the issue and resolution. The format follows the project's conventions.
scripts/modules/task-manager/parse-prd/parse-prd-config.js (1)
65-66: LGTM! Default timeout increased appropriately for large PRD parsing.The default
streamingTimeoutis correctly increased from 3 minutes (180 seconds) to 15 minutes using theDurationclass. This aligns with the PR's goal to support longer-running PRD parsing operations and resolves the 301-second timeout issue.src/ai-providers/base-provider.js (4)
58-65: LGTM! Method signature and documentation updated correctly.The
createProxyFetchmethod now accepts an optionaltimeoutMsparameter with a sensible 15-minute default. The JSDoc is properly updated to reflect the timeout support.
72-80: LGTM! Proxy agent initialization correctly optimized.The proxy agent is now conditionally created and cached only when proxy is enabled. The local
proxyAgentvariable cleanly captures the conditional state for use in the fetch wrapper.
82-108: LGTM! Timeout implementation is robust and well-structured.The AbortController-based timeout mechanism correctly:
- Creates a timeout signal that aborts after the specified duration
- Gracefully combines with any existing signal from the caller
- Ensures cleanup via
finallyblock- Always returns a timeout-enabled fetch function, even when proxy is disabled
This implementation properly addresses the timeout threading requirements of the PR.
110-129: LGTM! Signal combination helper is correctly implemented.The
combineAbortSignalsmethod properly:
- Checks for already-aborted signals and short-circuits
- Preserves abort reasons when propagating
- Uses
{ once: true }to prevent memory leaks- Returns a combined signal that aborts when any input signal aborts
This is a robust implementation of a standard abort signal composition pattern.
src/ai-providers/anthropic.js (2)
39-46: LGTM! Timeout parameter correctly propagated to Anthropic client.The
timeoutMsparameter is properly documented, extracted from params, and passed tocreateProxyFetch, enabling timeout support for Anthropic provider requests.
48-55: LGTM! Fetch implementation always included correctly.The change from conditional to always including
fetch: fetchImplis correct, ascreateProxyFetchnow always returns a function (with timeout support). This ensures the custom fetch wrapper is consistently used.scripts/modules/task-manager/parse-prd/parse-prd-non-streaming.js (1)
43-45: LGTM! Timeout correctly propagated to non-streaming PRD parsing.The
timeoutMsparameter is properly passed fromconfig.streamingTimeouttogenerateObjectService, enabling long-running PRD parsing operations with the configured 15-minute timeout.scripts/modules/task-manager/parse-prd/parse-prd-streaming.js (2)
215-217: LGTM! Timeout correctly propagated to streaming PRD parsing.The
timeoutMsparameter is properly passed tostreamObjectService, enabling timeout support for the streaming PRD parsing path with the configured timeout value.
568-570: LGTM! Timeout correctly propagated to fallback PRD parsing.The
timeoutMsparameter is properly passed togenerateObjectServicein the fallback path, ensuring timeout support when streaming fails. This provides complete timeout coverage across all PRD parsing code paths.
Fixes issue where parse-prd would consistently timeout at ~301 seconds due to default HTTP client timeout. Now supports long-running operations up to 15 minutes by default, with proper timeout parameter flow-through to the underlying HTTP client.
What type of PR is this?
Description
Related Issues
How to Test This
# Example commands or stepsExpected result:
Contributor Checklist
npm run changesetnpm testnpm run format-check(ornpm run formatto fix)Changelog Entry
For Maintainers
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.