claude-task-master icon indicating copy to clipboard operation
claude-task-master copied to clipboard

bug: Support AWS bedrock - not addressed with v0.14 release

Open mspiegel31 opened this issue 1 year ago • 4 comments

Description

this comment states that #287 should be closed with the release of version 0.14.x. this does not appear to be the case.

There are a few key differences between how the Anthropic API functions and the AWS Bedrock API functions. Notably:

  1. AWS bedrock requires the usage of a either a credentials chain (preferred) or static tokens. These links from the vercel ai-sdk delve into specific examples for consuming these authn techniques
  2. AWS bedrock models do not follow the same naming conventions as the anthropic API (see here for naming conventions). Note that AWS bedrock models use a version suffix (i.e. -v1:0) in their model references

Steps to Reproduce

  1. run task-master init
  2. modify .taskmasterconfig with sample configuration:
{
  "models": {
    "main": {
      "provider": "anthropic",
      "modelId": "claude-3-7-sonnet-20250219-v1:0",
      "maxTokens": 120000,
      "temperature": 0.2,
      "baseUrl": "https://bedrock.us-east-1.amazonaws.com"
    },
    "research": {
      "provider": "openrouter",
      "modelId": "perplexity/sonar-pro",
      "maxTokens": 8700,
      "temperature": 0.1,
      "baseUrl": "https://openrouter.ai/api/v1"
    },
    "fallback": {
      "provider": "anthropic",
      "modelId": "claude-3-5-sonnet-20241022-v2:0",
      "maxTokens": 8192,
      "temperature": 0.1,
      "baseUrl": "https://bedrock.us-east-1.amazonaws.com"
    }
  },
  "global": {
    "logLevel": "info",
    "debug": false,
    "defaultSubtasks": 5,
    "defaultPriority": "medium",
    "projectName": "Taskmaster",
    "ollamaBaseUrl": "http://localhost:11434/api",
    "azureOpenaiBaseUrl": "https://your-endpoint.openai.azure.com/",
    "userId": "1234567890"
  }
}
  1. run task-master parse-prd --input scripts/example_prd.txt

Expected Behavior

PRD parsing behaves as expected

Actual Behavior

observe error:

Parsing PRD file: scripts/example_prd.txt
Generating 10 tasks...
⠋ Parsing PRD and generating tasks...
[INFO] Parsing PRD file: scripts/example_prd.txt, Force: false, Append: false
[INFO] Reading PRD content from scripts/example_prd.txt
[INFO] Calling AI service to generate tasks from PRD...
⠹ Parsing PRD and generating tasks...
[ERROR] Anthropic generateObject ('tasks_data') failed: Invalid JSON response
[WARN] Attempt 1 failed for role main (generateAnthropicObject / anthropic): Invalid JSON response
[ERROR] Something went wrong on the provider side. Max retries reached for role main (generateAnthropicObject / anthropic).
[ERROR] Service call failed for role main (Provider: anthropic, Model: claude-3-7-sonnet-20250219-v1:0): Invalid JSON response
⠸ Parsing PRD and generating tasks...
[ERROR] Anthropic generateObject ('tasks_data') failed: Invalid JSON response

Screenshots or Logs

Provide screenshots, logs, or error messages if applicable.

Environment

  • Task Master version: 0.14.0
  • Node.js version: v22.11.0
  • Operating system: MacOS
  • IDE (if applicable): N/A

Additional Context

A proposed solution would involve:

  1. Adding a new aws-bedrock.js provider in src/ai-providers
  2. Implementing the configuration parsing strategies mentioned above (here and here)
  3. Leveraging import { createAmazonBedrock } from '@ai-sdk/amazon-bedrock'; function, similar to other AI providers

mspiegel31 avatar May 21 '25 16:05 mspiegel31

Bedrock has not been implemented in v0.14 so you're on the money there. Might be squeezed into v0.15, but since we're looking to start going to weekly releases, it might be after. It's still on the backlog to complete. Would make for a good PR :)

eyaltoledano avatar May 22 '25 02:05 eyaltoledano

I wish I could get my hands on a bedrock instance so that I can test it out.

Is there a free tier ?

Crunchyman-ralph avatar May 22 '25 07:05 Crunchyman-ralph

I wish I could get my hands on a bedrock instance so that I can test it out.

Is there a free tier ?

Not that I know of.

Amazon bedrock is requirement due to security / data protection in some companies.

I am looking to start using taskmaster with my team of developers, but would have to use it with bedrock. I may try it out with my anthropic key that I have with some test project.

olssonsten avatar May 24 '25 20:05 olssonsten

Handled by #607 and will be released as part of 0.16.0

Crunchyman-ralph avatar May 28 '25 12:05 Crunchyman-ralph