Skip to content

Cursor/agentcore cursor workers - #69

Open
skopp002 wants to merge 24 commits into
cursor:mainfrom
skopp002:cursor/agentcore-cursor-workers
Open

skopp002 wants to merge 24 commits into
cursor:mainfrom
skopp002:cursor/agentcore-cursor-workers

Conversation

@skopp002

@skopp002 skopp002 commented Sep 4, 2026

Copy link
Copy Markdown

Note

Medium Risk
Introduces new AWS control-plane resources, IAM execution roles, and runtime secret/git credential handling on managed instances; behavior is largely documented but unproven in production and depends on several open AgentCore API/schema assumptions.

Overview
Adds a fourth self-hosted deployment path for Cursor pool workers on Amazon Bedrock AgentCore Runtime (Instances), alongside EC2, ECS, and EKS. The repo root now documents AgentCore, forwards make agentcore-* into a self-contained agentcore/ tree (with env -u so parent .env does not override AgentCore-specific image/region/secret settings), and extends ignore rules for Python artifacts.

The core runtime change is an HTTP adapter (worker_adapter.py) as container PID 1: it serves AgentCore GET /ping / POST /invocations, reports HealthyBusy while supervising agent worker, fetches Cursor API and optional Git push tokens from Secrets Manager, and prepares /mnt/workspace (persistent EBS) with git origin, repo routing labels, and best-effort fetch. Packaging includes an arm64 Dockerfile, Terraform/Makefile targets for capacity provider + runtime (via Cloud Control API where providers lag), session lifecycle scripts (start/status/stop/delete/list), local contract tests, GitHub kickoff templates, and extensive runbooks/diagrams. Docs note the target has not been validated in a live AWS account yet and call out first-run risks (image arch, metadata/IMDS configuration).

Reviewed by Cursor Bugbot for commit 29bd85c. Bugbot is set up for automated code reviews on this repo. Configure here.

awsskoppar and others added 3 commits September 3, 2026 12:06
…d Agent workers.

Includes the HTTP adapter, Terraform, session scripts, and an AWS blog draft that uses Mitra as the integration example.

Co-authored-by: Cursor <cursoragent@cursor.com>
…vider IAM.

Operator PassRole and instance-role naming match the managed AgentCore policy so RunInstances can succeed; local contract tests run without Docker Desktop.

Co-authored-by: Cursor <cursoragent@cursor.com>
@skopp002

skopp002 commented Sep 4, 2026

Copy link
Copy Markdown
Author

first commit

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread self-hosted-cloud-agent/agentcore/terraform/main.tf
Comment thread self-hosted-cloud-agent/agentcore/adapter/worker_adapter.py Outdated
Comment thread self-hosted-cloud-agent/agentcore/adapter/worker_adapter.py Outdated
awsskoppar and others added 5 commits September 4, 2026 16:20
Treat origin fetch as best-effort so a private HTTPS WORKER_REPOSITORY_URL
without credentials does not fail the worker before it starts. Add adapter
tests, the 15-step secrets-and-flow diagram, ignore __pycache__, and drop
the laptop-only blog draft from the tree.
One row per step and one column per component so arrows no longer
cross. Short codes stay on the grid; the full 15-step wording moves
into the legend.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread self-hosted-cloud-agent/agentcore/adapter/worker_adapter.py
Replace the crossing-arrow swimlane with laptop export commands, the
four places those variables land, the CURSOR_API_KEY copy path, and a
15-step list with the make/gh/aws command for each step.
Keep the crisp component sketch in the README Architecture section and
point to secrets-and-flow.png plus terraform/README.md for the full
env-var and command path.
Show Operator, Secrets Manager, ECR, AgentCore Runtime, the managed
instance, EBS, Cursor, and GitHub with labeled edges. Keep the detailed
secrets runbook linked from the Architecture section.
Label the eleven flows 1–11 so setup, session start, registration,
kickoff, and the PR can be read in order.
The cookbook does not generate .github/scripts; those files are static
templates in agentcore/github/ that the operator copies into the sample
app. Number that copy, GitHub App grant, and gh secret set on the
architecture diagram.
Move the Operator out of Configure so push-image no longer looks like a
configure step. Drop numbered lane titles so box 2 is not confused with
missing edge 2. Grant GitHub App is edge 2 on the sample repo.
Apply the parent README row, Makefile agentcore-% delegate, and
.env.example pointer that used to live as suggested edits, then
drop that section. Point readers at a short command sequence on
the AgentCore README.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread self-hosted-cloud-agent/Makefile Outdated
Pool jobs match on pool name and repo. Logs of Repo: (repo unavailable)
mean the worker registered without a repo label, so Cloud Agents wait
with no connected workers even while AgentCore reports HealthyBusy.
Pass --label repo=owner/repo from WORKER_REPOSITORY_URL, put the same
slug in the labels file and Terraform env, and set git safe.directory
for the worker process.
StopRuntimeSession only stops the agent inside the session. On AgentCore
Instances the managed instance stays until IdleInstanceTimeout or
DeleteCapacityProviderSession. Document that split, add
agentcore-delete-session, and stop listing terminated instances.
delete-capacity-provider-session exists on current AWS CLI, but older
builds report Found invalid choice. Detect that and SigV4 DELETE
/capacity-providers/{id}/sessions/{sessionId} instead.
List output was paging away extra boxes and delete-session was using
cursor-worker-<uuid>, while AgentCore tags instances with a bare UUID
from earlier invokes. Print RuntimeSessionId, treat ResourceNotFound
as already gone, and add agentcore-delete-listed-sessions.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

There are 4 total unresolved issues (including 3 from previous reviews).

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 18d6d35. Configure here.

Comment thread self-hosted-cloud-agent/agentcore/scripts/delete-listed-sessions.sh
cursoragent and others added 5 commits September 8, 2026 19:39
The Cursor worker CLI rejects --label together with --labels-file, so
the process exited 1 and never registered. Keep repo= in the JSON file
only.
Clarify it is the example repo used to demonstrate Cloud Agent capacity, not production software and not this cookbook.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants