Skip to content

Commit 8e3ed6a

Browse files
author
bgagent
committed
feat: troubleshooting skill
1 parent 9172b24 commit 8e3ed6a

2 files changed

Lines changed: 45 additions & 5 deletions

File tree

abca-plugin/skills/onboard-repo/SKILL.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You are guiding the user through onboarding a new GitHub repository to ABCA. Rep
1616
Use AskUserQuestion to collect:
1717
- **Repository**: GitHub `owner/repo` format
1818
- **Compute type**: `agentcore` (default) or `ecs`
19-
- **Model preference**: Claude Sonnet 4 (default), Claude Opus 4 (complex repos), or Claude Haiku (lightweight)
19+
- **Model preference**: Claude Sonnet 4 (default), Claude Opus 4 (complex repos), or Claude Haiku (lightweight). **Important:** Models must be specified using their cross-region inference profile ID (e.g. `us.anthropic.claude-opus-4-20250514-v1:0`), not the raw foundation model ID. On-demand invocation of raw model IDs is not supported for most models.
2020
- **Max turns**: Default 100 (range: 1-500)
2121
- **Max budget**: USD cost ceiling per task (optional)
2222
- **Custom GitHub PAT**: If this repo needs a different token than the platform default
@@ -44,7 +44,7 @@ new Blueprint(this, 'MyRepoBlueprint', {
4444
repoTable: repoTable,
4545
// Optional overrides:
4646
// computeType: 'agentcore',
47-
// modelId: 'anthropic.claude-sonnet-4-20250514-v1:0',
47+
// modelId: 'us.anthropic.claude-sonnet-4-20250514-v1:0',
4848
// maxTurns: 100,
4949
// maxBudgetUsd: 50,
5050
// runtimeArn: runtime.runtimeArn,
@@ -54,6 +54,30 @@ new Blueprint(this, 'MyRepoBlueprint', {
5454

5555
Use a descriptive construct ID derived from the repo name.
5656

57+
### Model ID and IAM Permissions
58+
59+
When specifying a non-default model via `agent.modelId`, two things are required:
60+
61+
1. **Use the inference profile ID, not the raw model ID.** Bedrock does not support on-demand invocation of raw foundation model IDs for most models. Use the cross-region inference profile ID instead:
62+
- Sonnet 4: `us.anthropic.claude-sonnet-4-20250514-v1:0`
63+
- Opus 4: `us.anthropic.claude-opus-4-20250514-v1:0`
64+
- Haiku 4.5: `us.anthropic.claude-haiku-4-5-20251001-v1:0` (on-demand works for Haiku)
65+
66+
2. **Grant the runtime IAM permissions for the model.** The Blueprint construct does not automatically grant `bedrock:InvokeModel*` — this is by design (least privilege). You must add a `grantInvoke` block in the stack for each model used:
67+
```typescript
68+
const opusModel = new bedrock.BedrockFoundationModel('anthropic.claude-opus-4-20250514-v1:0', {
69+
supportsAgents: true,
70+
supportsCrossRegion: true,
71+
});
72+
opusModel.grantInvoke(runtime);
73+
74+
const opusProfile = bedrock.CrossRegionInferenceProfile.fromConfig({
75+
geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,
76+
model: opusModel,
77+
});
78+
opusProfile.grantInvoke(runtime);
79+
```
80+
5781
## Step 4: Deploy
5882

5983
After adding the Blueprint, the stack must be redeployed:
@@ -100,4 +124,6 @@ Task-level parameters override Blueprint defaults. If neither specifies a value,
100124
## Common Issues
101125

102126
- **422 "Repository not onboarded"** — Blueprint hasn't been deployed yet. Add the construct and redeploy.
103-
- **Preflight failures after onboarding** — GitHub PAT may lack permissions for the new repo. Check the PAT's fine-grained access includes the target repository.
127+
- **Preflight failures after onboarding** — GitHub PAT may lack permissions for the new repo. Check the PAT's fine-grained access includes the target repository with Contents (read/write) and Pull requests (read/write) permissions.
128+
- **400 "Invocation with on-demand throughput isn't supported"** — The Blueprint `modelId` is using a raw foundation model ID instead of an inference profile ID. Change e.g. `anthropic.claude-opus-4-20250514-v1:0` to `us.anthropic.claude-opus-4-20250514-v1:0`.
129+
- **403 "not authorized to perform bedrock:InvokeModelWithResponseStream"** — The runtime IAM role lacks permissions for the model specified in the Blueprint. Add `grantInvoke` for both the model and its cross-region inference profile in `agent.ts`.

abca-plugin/skills/troubleshoot/SKILL.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,25 @@ node lib/bin/bgagent.js events <TASK_ID> --output json
9696
- Check event `reason` and `detail` fields for specifics
9797
- Verify PAT: fine-grained token must include the target repository with Contents (read/write), Pull Requests (read/write), Issues (read)
9898

99-
**`task_failed`:**
99+
**`task_failed` / task completes with 0 tokens and no PR:**
100100
- Agent encountered an error during execution
101-
- Check CloudWatch logs for the session
101+
- Check CloudWatch logs for the session:
102+
```bash
103+
aws logs filter-log-events \
104+
--log-group-name "/aws/vendedlogs/bedrock-agentcore/runtime/APPLICATION_LOGS/jean_cloude" \
105+
--filter-pattern "<TASK_ID>" \
106+
--region us-west-2 --query 'events[*].message' --output text
107+
```
102108
- Common: repo build/test commands not documented in CLAUDE.md
103109

110+
**403 "not authorized to perform bedrock:InvokeModelWithResponseStream":**
111+
- The Blueprint specifies a model that the runtime IAM role doesn't have permissions for
112+
- Fix: add `grantInvoke` for the model and its cross-region inference profile in `cdk/src/stacks/agent.ts`, then redeploy
113+
114+
**400 "Invocation with on-demand throughput isn't supported":**
115+
- The Blueprint `modelId` uses a raw foundation model ID (e.g. `anthropic.claude-opus-4-20250514-v1:0`)
116+
- Fix: change to the inference profile ID (e.g. `us.anthropic.claude-opus-4-20250514-v1:0`), update DynamoDB via redeploy
117+
104118
**`task_timed_out`:**
105119
- 9-hour maximum exceeded
106120
- Consider reducing scope or increasing `max_turns` for complex tasks

0 commit comments

Comments
 (0)