Prompt file imported from ShalomDeitch1/AgentGroup (
.github/prompts/collaberation.prompt.md). Copyright stays with the author.
TASK: fix admin/agents page to have a "deploy all changes" button that will deploy all agents in the configuration, fixing the collaboration list to match the configuration, and deploying the supervisor last.
IT IS IMPORTANT TO FIX the not having the Code Interpreter associated with the coder agent. IT IS IMPORTANT TO FIX the collaboration list to match the configuration after any deploy - adding or removing agents as needed. IT IS IMPORTANT TO SUPPORT adding new agents (with a button) and deleting non-default agents (with a delete button).
Below the line are some bash scripts that may be useful for managing Bedrock agents and their collaborations.
- some comments when deleting agents
I want to replace the buttons of "deploy" with a single "deploy all changes" it will always deploy the supervisor last, and if the agents in the collaboration list does not contain all the agents in the configuration and only those agents - fix the collaboration list to match the configuration.
There has to be a button to add a new agent. If there are added agents, they can also have a delete button to remove ONLY non-default agents.
The deploy can redeploy even if there are no changes - it first gets the app in "sync" and then fixes what it needed.
There are problems with the collaberation part is how the design of aws if you delete an agent, it does not remove it from the collaberation group, so you have to remove it yourself
aws bedrock-agent disassociate-agent-collaborator
--agent-id VXVYK82M1U
--agent-version DRAFT
--collaborator-name "GenericAgent"
--region us-east-1
aws bedrock-agent delete-agent
--agent-id 2SGGTELEG6
--region us-east-1
aws bedrock-agent associate-agent-collaborator
--agent-id VXVYK82M1U
--agent-version DRAFT
--agent-descriptor aliasArn="arn:aws:bedrock:us-east-1:288581185716:agent-alias/2SGGTELEG6/Y9L3BEXRHD"
--collaboration-instruction "Handle general knowledge queries, summaries, and formatting tasks"
--collaborator-name "GenericAgent"
--region us-east-1
{
"agentCollaborator": {
"agentId": "VXVYK82M1U",
"agentVersion": "DRAFT",
"agentDescriptor": {
"aliasArn": "arn:aws:bedrock:us-east-1:288581185716:agent-alias/2SGGTELEG6/Y9L3BEXRHD"
},
"collaboratorId": "XWSMARST3U",
"collaborationInstruction": "Handle general knowledge queries, summaries, and formatting tasks",
"collaboratorName": "GenericAgent",
"createdAt": "2026-01-19T18:37:38.612871+00:00",
"lastUpdatedAt": "2026-01-19T18:37:38.612871+00:00",
"relayConversationHistory": "DISABLED",
"clientToken": "522f0345-8d59-4238-9817-20b27e655ef0"
}
}
when i had a timed out user, and then tried to login i got [SECURITY] type=LOGIN_FAILURE success=false timestamp=2026-01-19T18:47:09.780Z email=a***n@example.com ip=::1 details={"reason":"The security token included in the request is expired"}
this should not happen. Tokens should not be used on login (or register)
I did reset and then deployed generic-agent and fianacial-Analyst both were ok but when I deployed "coder" i gottheerror on the console (the UI claimed all ok)
[CredentialManager] Fetching fresh normal credentials
[SECURITY] type=LOGIN_SUCCESS success=true timestamp=2026-01-19T18:50:58.781Z email=an@example.com ip=::1
[2026-01-19T18:51:12.600Z] GET /api/agents
[2026-01-19T18:51:12.610Z] GET /api/agents/models
[2026-01-19T18:51:12.664Z] GET /api/tools
[2026-01-19T18:51:12.999Z] GET /api/agents
[CredentialManager] Fetching fresh admin credentials
[2026-01-19T18:51:13.407Z] GET /api/tools
[2026-01-19T18:51:14.813Z] GET /api/agents/models
[CredentialManager] Using cached admin credentials
[2026-01-19T18:51:21.548Z] POST /api/agents/supervisor/reset
[SECURITY] type=ADMIN_ACTION success=true timestamp=2026-01-19T18:51:21.925Z email=an@example.com ip=::1 details={"action":"RESET_AGENT","target":"supervisor"}
[Bedrock] Agent configuration loaded
[Bedrock] Supervisor: Financial-Advisor-Supervisor
[Bedrock] Collaborators: Coder, Financial-Analyst, Generic-Agent
[2026-01-19T18:51:21.936Z] GET /api/agents
[2026-01-19T18:51:26.008Z] POST /api/agents/generic_agent/deploy
[Bedrock] Provisioning agent: Generic-Agent (isSupervisor: false)
[Bedrock] Checking if agent Generic-Agent already exists... (collaboration: DISABLED)
[CredentialManager] Using cached admin credentials
[Bedrock] Creating new agent: Generic-Agent
[Bedrock] Agent created with ID: 6ODINKDZCG
[Bedrock] Creating action group WebSearch for agent 6ODINKDZCG...
[Bedrock] Collaborators associated, waiting for agent 6ODINKDZCG to be ready for preparation...
[Bedrock] Agent 6ODINKDZCG reached state NOT_PREPARED for prepare agent (waited 0s)
[Bedrock] Preparing agent 6ODINKDZCG...
[Bedrock] Waiting for agent 6ODINKDZCG to be prepared...
[Bedrock] Agent 6ODINKDZCG reached state PREPARED for create alias (waited 3s)
[Bedrock] Creating alias for agent 6ODINKDZCG...
[Bedrock] Agent 6ODINKDZCG reached state PREPARED for create alias (waited 0s)
[Bedrock] Agent Generic-Agent fully provisioned (agentId: 6ODINKDZCG, aliasId: UBAOHADNO2)
[Bedrock] Agent Generic-Agent provisioned successfully
[Bedrock] Agent configuration loaded
[Bedrock] Supervisor: Financial-Advisor-Supervisor
[Bedrock] Collaborators: Coder, Financial-Analyst, Generic-Agent
[SECURITY] type=ADMIN_ACTION success=true timestamp=2026-01-19T18:51:33.944Z email=an@example.com ip=::1 details={"action":"DEPLOY_AGENT","target":"generic_agent"}
[2026-01-19T18:51:33.958Z] GET /api/agents
[2026-01-19T18:51:38.217Z] POST /api/agents/financial_analyst/deploy
[Bedrock] Provisioning agent: Financial-Analyst (isSupervisor: false)
[Bedrock] Checking if agent Financial-Analyst already exists... (collaboration: DISABLED)
[CredentialManager] Using cached admin credentials
[Bedrock] Creating new agent: Financial-Analyst
[Bedrock] Agent created with ID: BCOMBJTHH0
[Bedrock] Waiting for agent BCOMBJTHH0 to be ready for preparation...
[Bedrock] Agent BCOMBJTHH0 reached state NOT_PREPARED for prepare agent (waited 3s)
[Bedrock] Preparing agent BCOMBJTHH0...
[Bedrock] Waiting for agent BCOMBJTHH0 to be prepared...
[Bedrock] Agent BCOMBJTHH0 reached state PREPARED for create alias (waited 3s)
[Bedrock] Creating alias for agent BCOMBJTHH0...
[Bedrock] Agent BCOMBJTHH0 reached state PREPARED for create alias (waited 0s)
[Bedrock] Agent Financial-Analyst fully provisioned (agentId: BCOMBJTHH0, aliasId: RBAVX2FSEM)
[Bedrock] Agent Financial-Analyst provisioned successfully
[Bedrock] Agent configuration loaded
[Bedrock] Supervisor: Financial-Advisor-Supervisor
[Bedrock] Collaborators: Coder, Financial-Analyst, Generic-Agent
[SECURITY] type=ADMIN_ACTION success=true timestamp=2026-01-19T18:51:47.551Z email=an@example.com ip=::1 details={"action":"DEPLOY_AGENT","target":"financial_analyst"}
[2026-01-19T18:51:47.558Z] GET /api/agents
[2026-01-19T18:51:49.901Z] POST /api/agents/coder/deploy
[Bedrock] Provisioning agent: Coder (isSupervisor: false)
[Bedrock] Checking if agent Coder already exists... (collaboration: DISABLED)
[CredentialManager] Using cached admin credentials
[Bedrock] Creating new agent: Coder
[Bedrock] Agent created with ID: 0BKXUVFCAL
[Bedrock] Creating action group CodeInterpreter for agent 0BKXUVFCAL...
[Bedrock] Error configuring action groups for agent 0BKXUVFCAL: ValidationException: Create operation can't be performed on ActionGroup when Agent is in Creating state. Retry the request when the agent is in a valid state.
at AwsRestJsonProtocol.handleError (/mnt/c/projects/cross_river/finance-assistant/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js:931:27)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at AwsRestJsonProtocol.deserializeResponse (/mnt/c/projects/cross_river/finance-assistant/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js:307:13)
at AwsRestJsonProtocol.deserializeResponse (/mnt/c/projects/cross_river/finance-assistant/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js:916:24)
at /mnt/c/projects/cross_river/finance-assistant/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js:26:24
at /mnt/c/projects/cross_river/finance-assistant/node_modules/@smithy/core/dist-cjs/index.js:121:20
at /mnt/c/projects/cross_river/finance-assistant/node_modules/@smithy/middleware-retry/dist-cjs/index.js:254:46
at /mnt/c/projects/cross_river/finance-assistant/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js:5:26
at ensureActionGroups (/mnt/c/projects/cross_river/finance-assistant/src/services/bedrock-provisioner.ts:278:17)
at provisionSingleAgent (/mnt/c/projects/cross_river/finance-assistant/src/services/bedrock-provisioner.ts:457:33) {
'$fault': 'client',
'$retryable': undefined,
'$metadata': {
httpStatusCode: 400,
requestId: 'c4220aee-0309-4be7-bb6f-d16d580e2093',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
fieldList: undefined
}
[Bedrock] Waiting for agent 0BKXUVFCAL to be ready for preparation...
[Bedrock] Agent 0BKXUVFCAL reached state NOT_PREPARED for prepare agent (waited 0s)
[Bedrock] Preparing agent 0BKXUVFCAL...
[Bedrock] Waiting for agent 0BKXUVFCAL to be prepared...
[Bedrock] Agent 0BKXUVFCAL reached state PREPARED for create alias (waited 3s)
[Bedrock] Creating alias for agent 0BKXUVFCAL...
[Bedrock] Agent 0BKXUVFCAL reached state PREPARED for create alias (waited 0s)
[Bedrock] Agent Coder fully provisioned (agentId: 0BKXUVFCAL, aliasId: TKDB2LARIA)
[Bedrock] Agent Coder provisioned successfully
[Bedrock] Agent configuration loaded
[Bedrock] Supervisor: Financial-Advisor-Supervisor
[Bedrock] Collaborators: Coder, Financial-Analyst, Generic-Agent
[SECURITY] type=ADMIN_ACTION success=true timestamp=2026-01-19T18:51:59.093Z email=a***n@example.com ip=::1 details={"action":"DEPLOY_AGENT","target":"coder"}
[2026-01-19T18:51:59.101Z] GET /api/agents
THE CODER DID NOT HAVE Code Interpreter ASSOCIATED WITH IT :-(
I Deployed the supervisor LAST - it has 3 collaborators