Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,20 +281,25 @@ curl -X PATCH "$AGENTBRIDGE_BASE_URL/api/agent/tasks/$TASK_ID" \
-d '{"status":"done","blockingReason":null,"note":"Implemented the dashboard card summary UI and verified lint/typecheck."}'
```

Create a task for an agent in the same company:
Create a task for an agent in the same company. `assignedAgentId` is the assignee agent database UUID, not the API-facing `AgentId` header value. Resolve it from `GET /api/agent` for the acting agent, or from the dashboard/agents API for another assignee.

```bash
AGENT_UUID=$(curl -s "$AGENTBRIDGE_BASE_URL/api/agent" \
-H "Authorization: Bearer $AGENTBRIDGE_COMPANY_TOKEN" \
-H "AgentId: $AGENTBRIDGE_AGENT_ID" \
-H "Accept: application/json" | jq -r '.agent.id')

curl -X POST "$AGENTBRIDGE_BASE_URL/api/agent/tasks" \
-H "Authorization: Bearer $AGENTBRIDGE_COMPANY_TOKEN" \
-H "AgentId: $AGENTBRIDGE_AGENT_ID" \
-H "Content-Type: application/json" \
-d '{
"projectId":"00000000-0000-0000-0000-000000000000",
"assignedAgentId":"11111111-1111-1111-1111-111111111111",
"name":"Document onboarding flow",
"job":"Update README with setup and API usage instructions.",
"status":"todo"
}'
-d "{
\"projectId\":\"00000000-0000-0000-0000-000000000000\",
\"assignedAgentId\":\"$AGENT_UUID\",
\"name\":\"Document onboarding flow\",
\"job\":\"Update README with setup and API usage instructions.\",
\"status\":\"todo\"
}"
```

Useful Agent API resources:
Expand Down
6 changes: 3 additions & 3 deletions docs/production-runbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,15 @@ Expected response:

### 4. Scripted SaaS smoke

For repeatable local, disposable, or production-like validation, run the scripted smoke against an AgentBridge instance that is safe to mutate. The script creates a disposable task in the configured project, lists tasks, marks that task `done`, writes a note summary, and marks it read by the smoke agent.
For repeatable local, disposable, or production-like validation, run the scripted smoke against an AgentBridge instance that is safe to mutate. The script resolves the authenticated agent profile from `/api/agent`, uses that profile `id` as the task `assignedAgentId` UUID, creates a disposable task in the configured project, lists tasks, marks that task `done`, writes a note summary, and marks it read by the smoke agent.

Required environment:

| Variable | Notes |
| --------------------------- | ------------------------------------------------------------------------------------------------------ |
| `AGENTBRIDGE_BASE_URL` | Base URL for the instance, for example `http://localhost:3000` or a disposable preview URL. |
| `AGENTBRIDGE_COMPANY_TOKEN` | Company bearer token for the target company. Use a test/disposable token and never paste it into logs. |
| `AGENTBRIDGE_AGENT_ID` | AgentId that belongs to the target company and project. |
| `AGENTBRIDGE_AGENT_ID` | API-facing AgentId sent in the `AgentId` header. The script resolves its database UUID from `/api/agent` before task creation. |
| `AGENTBRIDGE_PROJECT_ID` | Project ID where the disposable smoke task can be created and updated. |

```bash
Expand All @@ -215,7 +215,7 @@ corepack pnpm smoke:saas-production
Expected result:

- `GET /api/health` returns HTTP `200` and `checks.database: "ok"`.
- `GET /api/agent` returns the configured agent profile.
- `GET /api/agent` returns the configured agent profile and provides the database UUID used as `assignedAgentId` for task creation.
- Agent API task create/list/update all return success.
- Console output ends with `PASS smoke-saas-production taskId=<created-task-id>`.

Expand Down
10 changes: 5 additions & 5 deletions scripts/smoke-saas-production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ async function main() {

const agentResult = await requestJson(config, "/api/agent")
assertStatus(agentResult.response, agentResult.body, 200, "agent profile")
assert.equal(
(agentResult.body.agent as JsonRecord | undefined)?.AgentId,
config.agentId
)
const agentProfile = agentResult.body.agent as JsonRecord | undefined
assert.equal(agentProfile?.AgentId, config.agentId)
assert.equal(typeof agentProfile?.id, "string")
const assignedAgentId = agentProfile.id

const createResult = await requestJson(config, "/api/agent/tasks", {
method: "POST",
body: JSON.stringify({
projectId: config.projectId,
assignedAgentId: config.agentId,
assignedAgentId,
name: taskName,
job: "Disposable task created by the scripted SaaS production smoke check.",
status: "todo",
Expand Down
Loading