agents / agent-think
AGENTS.md5.8k starsChanged 5 months agoMITView on GitHub
A Think agent (@cloudflare/think) that reproduces and fixes cloudflare/agents GitHub issues inside a container-backed @cloudflare/workspace VFS. Anyone trusted on the repo triggers it from an issue comment: e.g. @agent-think reproduce this issue or @agent-think open a PR fixing this. It runs the matching skill (reproduce / open-pr) in a real Linux container and reports back on the issue as the agent-think GitHub App — never impersonating the triggering user. - Replace CI-runner automations (the /repro + /pr Actions shape from…
- Reads credentials
Trending
More talk lately.about the whole repository
Who's talking about cloudflare/agents
- @threepointone.bsky.social“cloudflare agents: repo: github.com/cloudflare/a... platform docs: developers.cloudflare.com/agents/ …”Bluesky · Feb 25, 2025 · 66 likes
- mastra-ai/mastra“[FEATURE] Code Mode (generate + run code to orchestrate tool/MCP calls)”GitHub · Dec 9, 2025 · 6 reactions
- Chemically-Motivated-Solutions/promptcrafting-mcp“chore(deps): bump the npm_and_yarn group across 3 directories with 4 updates”GitHub · Apr 2, 2026 · 3 reactions
- @github-trending-js.bsky.social“📦 cloudflare / agents ⭐ 1,655 (+76) 🗒 TypeScript Build and deploy AI Agents on Cloudflare”Bluesky · May 2, 2025 · 3 likes
- abstractedfox/agents“Python package resolution”GitHub · Jul 21, 2026 · 2 reactions
The biggest 5 of 43 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 43
Talked about on GitHub, Bluesky and Hacker News (43 times).
On GitHub · 33
- Dec 9, 2025[FEATURE] Code Mode (generate + run code to orchestrate tool/MCP calls) — mastra-ai/mastra6 reactions · 5 comments
- Apr 2, 2026chore(deps): bump the npm_and_yarn group across 3 directories with 4 updates — Chemically-Motivated-Solutions/promptcrafting-mcp3 reactions · 1 comment
- Jul 21, 2026Python package resolution — abstractedfox/agents2 reactions
- Jun 20, 2026chore(deps): bump the npm_and_yarn group across 2 directories with 13 updates — Chemically-Motivated-Solutions/promptcrafting-mcp2 reactions · 1 comment
- May 26, 2026Bump the npm_and_yarn group across 1 directory with 18 updates — GlacierEQ/context-engineering-intro2 reactions · 4 comments
28 more on GitHub
- May 23, 2026Bump the npm_and_yarn group across 1 directory with 9 updates — HarleyCoops/JinaMCP2 reactions · 1 comment
- Apr 14, 2026chore(deps): bump agents from 0.0.87 to 0.11.0 in /templates/cloudflare-mcp-server in the npm_and_yarn group across 1 directory — sipyourdrink-ltd/bernstein2 reactions · 2 comments
- Mar 23, 2026chore(deps): Bump agents from 0.2.35 to 0.7.9 in /packages/api — LoveLogicAILLC/secretforge-ai2 reactions · 4 comments
- Mar 16, 2026chore(deps): Bump agents from 0.2.35 to 0.7.6 in /packages/web — LoveLogicAILLC/secretforge-ai2 reactions · 6 comments
- Mar 16, 2026chore(deps): Bump agents from 0.2.35 to 0.7.6 in /packages/api — LoveLogicAILLC/secretforge-ai2 reactions · 5 comments
- Feb 23, 2026chore(deps): Bump agents from 0.2.35 to 0.5.1 in /packages/web — LoveLogicAILLC/secretforge-ai2 reactions · 6 comments
- Feb 20, 2026Bump the npm_and_yarn group across 3 directories with 8 updates — cbwinslow/opendiscourse_mcp2 reactions · 1 comment
- Jan 24, 2026chore(deps): Bump agents from 0.2.35 to 0.3.6 — LoveLogicAILLC/secretforge-ai2 reactions · 6 comments
- Jan 24, 2026chore(deps): Bump agents from 0.2.35 to 0.3.6 in /packages/web — LoveLogicAILLC/secretforge-ai2 reactions · 6 comments
- Jan 24, 2026chore(deps): Bump agents from 0.2.35 to 0.3.6 in /packages/api — LoveLogicAILLC/secretforge-ai2 reactions · 6 comments
- Aug 11, 2025Unknown connection regression — modelcontextprotocol/inspector2 reactions · 6 comments
- Jul 11, 2025Add instrumentation for `agents` — getsentry/sentry-javascript2 reactions · 10 comments
- Oct 5, 2026build(deps): Bump the minor-and-patch group across 1 directory with 20 updates — Themis128/cloudless.gr1 reaction · 4 comments
- Oct 2, 2026Add `Code Mode` meta tools to Reshapr tools — reshaprio/reshapr1 reaction · 2 comments
- Sep 28, 2026chore(deps): bump the npm-minor-and-patch group across 1 directory with 4 updates — grigoreo-dev/otask-mcp1 reaction · 1 comment
- Sep 25, 2026chore(deps): bump the patch-updates group across 1 directory with 12 updates — ClashKingInc/ClashKingDashboard1 reaction · 1 comment
- Sep 18, 2026chore(deps): bump the patch-updates group with 10 updates — ClashKingInc/ClashKingDashboard1 reaction · 1 comment
- Aug 27, 2026chore(deps): bump the minor-and-patch group across 1 directory with 14 updates — Themis128/cloudless.gr1 reaction · 2 comments
- Jul 29, 2026fix(cloudflare): Also skip cf: prefixed DOs — getsentry/sentry-javascript1 reaction
- Jun 5, 2026Bump agents from 0.13.3 to 0.14.1 — martinthommesen/snow-mcp1 reaction · 1 comment
- Feb 20, 2026chore(deps): Bump the npm_and_yarn group across 4 directories with 4 updates — Fadil369/givc-core-academy1 reaction
- Feb 20, 2026chore(symbolai-worker)(deps): bump agents from 0.2.35 to 0.5.1 in /symbolai-worker — llu77/-lmm1 reaction · 3 comments
- Feb 3, 2026Bump agents from 0.0.109 to 0.3.7 — vivekrp/youfirst-mcp1 reaction
- Feb 3, 2026Bump agents from 0.0.94 to 0.3.7 in /mcp-server-deepwiki-gpt — Cam10001110101/chatgpt-connector-deepwiki1 reaction
- Feb 3, 2026Bump agents from 0.0.65 to 0.3.7 — hackhit/remote-mcp-server-authless1 reaction
- Dec 1, 2025chore(symbolai-worker)(deps): bump the security group in /symbolai-worker with 2 updates — llu77/-lmm1 reaction · 2 comments
- Nov 7, 2025Bump ai and agents — vivekrp/youfirst-mcp1 reaction
- Nov 5, 2025will this be merged soon? — fghf136813721430ghase/fghf136813721430ghase1 reaction
On Bluesky · 9
- Feb 25, 2025cloudflare agents: repo: github.com/cloudflare/a... platform docs: developers.cloudflare.com/agents/ starter kit:… — @threepointone.bsky.social66 likes and reposts · 4 replies
- May 2, 2025📦 cloudflare / agents ⭐ 1,655 (+76) 🗒 TypeScript Build and deploy AI Agents on Cloudflare — @github-trending-js.bsky.social3 likes and reposts
- Mar 7, 2026Cloudflare's official SDK for building and deploying AI Agents - production-grade infrastructure for the agentic era!… — @u11g.com2 likes and reposts
- Feb 27, 2026Cloudflare Agents lets you deploy millions of persistent AI agents that cost nothing when idle - each with its own state, WebSocket sync,… — @arifsolmaz.bsky.social2 likes and reposts
- Feb 21, 2026📦 cloudflare / agents ⭐ 3,303 (+56) 🗒 TypeScript Build and deploy AI Agents on Cloudflare — @github-trending.bsky.social2 likes and reposts
4 more on Bluesky
- Feb 21, 2026📦 cloudflare / agents ⭐ 3,303 (+56) 🗒 TypeScript Build and deploy AI Agents on Cloudflare — @github-trending-js.bsky.social2 likes and reposts
- May 3, 2025📦 cloudflare / agents ⭐ 1,655 (+76) 🗒 TypeScript Build and deploy AI Agents on Cloudflare — @github-trending.bsky.social2 likes and reposts
- Mar 4, 2025Link: github.com/cloudflare/a... — @tinztwinshub.bsky.social1 likes and repost
- Oct 3, 2026Cloudflare Agents is an open-source SDK for stateful agents on Cloudflare Durable Objects. This investigation will examine its runtime,… — @smith.wiki0 likes and reposts · 1 reply
On Hacker News · 1
- Mar 4, 2025Cloudflare Agents1 point
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- design/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- examples/AGENTS.mdAGENTS.md
- examples/webmcp-react/AGENTS.mdAGENTS.md
- guides/AGENTS.mdAGENTS.md
- packages/agents/AGENTS.mdAGENTS.md
- packages/agents/src/tests/capabilities/AGENTS.mdAGENTS.md
- open-prSkill
- reproduceSkill
- debug-planSkill
- pirate-voiceSkill
- release-notesSkill
- test-planSkill
- workspace-digestSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Reproductions a human can see: Every repro deploys with a minimal Vite frontend — click the workers.dev link, press _Trigger bug_, watch …
- Distinctive: line 88
Member-gated: Only comment authors with OWNER / MEMBER / COLLABORATOR association can drive it (it runs code and opens PRs).
- Very specific: line 163
/tempis deliberately outside the VFS mount: Put long logs there and tail them with container bash so neither the VFS nor tool results …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
agent-think
A Think agent (@cloudflare/think) that reproduces and fixes cloudflare/agents
GitHub issues inside a container-backed @cloudflare/workspace VFS. Anyone
trusted on the repo triggers it from an issue comment:
@agent-think <instruction>e.g. @agent-think reproduce this issue or @agent-think open a PR fixing this.
It runs the matching skill (reproduce / open-pr) in a real Linux container and
reports back on the issue as the agent-think GitHub App — never
impersonating the triggering user.
Aims
- Replace CI-runner automations (the
/repro+/prActions shape from PR #1844) with one persistent Worker + pre-warmed container: webhook to running agent in seconds, durable turns that survive eviction, one shared workspace/thread per issue. - Reproductions a human can see. Every repro deploys with a minimal Vite
frontend — click the
workers.devlink, press Trigger bug, watch expected-vs-actual in the page (deployed viawrangler deploy --temporarywith a claimable preview account). - Multiplayer for the team: sessions are per-issue, not per-user, and the live thread UI (behind Cloudflare Access) shows any run in flight.
How it works
@agent-think <instruction> (GitHub issue comment)
│ issue_comment webhook
▼
gh-app (GitLab: cloudflare/ai-agents/team-apps, apps/gh-app — PRIVATE)
│ verify sig · member-gate · mint installation token · react 👀 · dedup(KV)
│ RPC: env.AGENT_THINK.dispatch({repo, issueNumber, instruction, installationToken})
▼
agent-think (this dir — PUBLIC-safe, holds no App creds)
├─ AgentThink WorkerEntrypoint (src/index.ts)
│ dispatch: getAgentByName(env.ThinkAgent, session) → setContext → start()
│ getSubmissionStatus: read one durable submission's state over private RPC
│ start() ONLY submits the durable turn — returns in ~1s
│ failed-run continuation refreshes GitHub auth through gh-app's private
│ AgentThinkTokenBroker binding before submitting into the same session
├─ ThinkAgent DO (src/agent.ts) — owns durable turn/transcript state only
├─ WorkspaceAgent DO (src/workspace-agent.ts) — same stable per-issue name;
│ exclusively owns Workspace VFS + backend connection. File tools and
│ both bash backends share its RPC stub; the container backend claims
│ from the warm pool per turn:
│ resolveContainerId(env, id) → env.Sandbox.get(idFromName(uuid))
├─ Sandbox DO (src/sandbox.ts) — container host (wsd); handed out by pool
├─ WarmPool DO (src/warm-pool.ts) — keeps exactly one unassigned container warm
├─ CommandCenterAgent DO (src/command-center.ts) — singleton ("main")
│ registry of every thread + per-thread counters; ThinkAgent reports
│ lifecycle events fire-and-forget; failed runs are claimed atomically
│ before an operator continuation
└─ UI (React SPA, src/client.tsx): `/` command center (metrics, failed-run
continuation, and ChatGPT-style thread sidebar, live via agents state
sync); /thread/:session live thread viewReactions are the liveness protocol (an "on it" comment was tried and removed
as noise): 👀 from gh-app = webhook seen and dispatched; 🚀 from the agent =
the MODEL's own first action (the system prompt tells it to gh api the
reaction from the container), so it proves the whole chain — turn awake,
container attached, gh authed, model responding. 👀 without 🚀 within a couple
of minutes = the run is dead, not slow. Results arrive as an issue comment
when the run finishes; gh-app posts ❌ if dispatch itself fails.
Session name = <repo-slug>-<issue> (e.g. cloudflare-agents-1859). Both
verbs on one issue reuse the same DO/workspace/thread, and submitMessages
uses idempotency key repo#issue, so webhook redeliveries and repeat mentions
join the existing turn instead of forking a second one.
Skills use Think's native R2 SkillSource and activation tools, independent of the container's coding filesystem.
Rules we hold ourselves to
- agent-think holds NO GitHub App credentials. gh-app (private) mints a
short-lived installation token per dispatch. In the container the token goes
to a 0600 file over stdin (
gh auth login --with-token) — never in a model prompt, process argument, or log. That is what makes this dir safe to keep in a public repo. - The agent acts as the App, never as a person. Branches, commits, PRs, and comments are authored by agent-think[bot].
- Member-gated. Only comment authors with OWNER / MEMBER / COLLABORATOR association can drive it (it runs code and opens PRs).
dispatch()does no container work. gh-app calls it insidectx.waitUntil, which the runtime cancels ~30s after the webhook response. Anything slow (container attach, gh auth) must live inside the durable turn, where no caller can cancel it. Keep dispatch ~1s forever.- No Cloudflare Workflow. An earlier shape wrapped the turn in a Workflow;
its 10-min step timeout + retry-from-scratch was the main death mode. Think's
native durable
submitMessagesis the durability layer. - One Workspace owns
/workspace. Think internals and read/write/edit call the durable VFS directly. The lightweight shell operates on the same VFS, and the container backend runs against its mounted view. Workspace owns its sync policy; agent-think adds no path router or ignore policy. Paths outside/workspaceremain container-local. Skills use Think's native R2 source. - Run identity is durable input, not prompt configuration. The first user
message carries an
<agent-think-run>JSON envelope (repo, issue, instruction, requester, triggering comment). Skills fail closed without it. This survives context-block prompt assembly, eviction, and continuation. - Container ownership follows the turn. The first container use claims a warm container. The Workspace keeps that connection for the turn. Terminal cleanup closes it, stops and drops the used container, and restores the one-container warm slot. There are no renewable leases, sticky idle assignments, or TTL policy.
- Bash has two backends. The lightweight VFS-backed
shellis the default for text and file commands. Selectcontainerfor gh, npm, node, native binaries, network access, builds, tests, and deploys. File tools call the VFS directly. - Repros must be clickable. The reproduce skill mandates a minimal Vite + React page (exact 7-file recipe in the skill) so maintainers see the failing behavior without cloning anything.
Edge cases you will hit
enable_abortsignal_rpcis required (wrangler.jsoncANDtest/wrangler.jsonc). The container backend's health probe passes anAbortSignalintohost.fetchPort(...), which crosses Workers RPC in the cross-DO topology. Without the flag workerd rejects every probe, the backend "restarts" perfectly healthy containers in a loop, and connects die at stage=health after ~30s. This one cost us a day.wrangler tailis lossy. It drops lines mid-run and shows nothing at all for gh-app. Ground truth is: KVhandled:*markers (gh-app's EVENT_STATE), issue reactions/comments, and the thread UI. The structuredagent-think {...json}log lines (start / submitted / tool / git-auth-* / turn:done / turn:error) reconstruct a run when tail does cooperate.- Stale containers after a deploy. The platform can keep a container
alive across a deploy while the new isolate has no lifecycle monitor for it.
The Sandbox constructor reconciles by destroy → poll
running→ start; do NOT "simplify" it back tohost.restart()— on an inherited container destroy() resolves before the container actually stops and the inner start() throws "already running", leaving the wedged container in place. - miniflare cannot boot Cloudflare Containers. The fast unit suite runs on
a stripped
test/wrangler.jsonc(nocontainers, no cron) and never touches the container path; that path is only covered by the e2e suite (wrangler dev --local+ real docker) or in prod. - The workers.dev domain is behind Cloudflare Access.
cloudflared access login https://agent-think.agents-b8a.workers.devbefore curling it; thread links only work for people on the account's Access policy. - Building the image behind WARP (or any TLS-inspecting proxy): drop the
proxy CA at
ca/warp-ca.crt(gitignored;ca/.keepkeeps the COPY source alive). Without it the Docker build's HTTPS fetches fail with certificate errors. Hosts without WARP need nothing. - Editing
skills/**does nothing until you reseed R2 (npm run seed:r2, or-- --localfor local dev). The deployed worker reads skills from the bucket, not from the repo. - Deploy order matters: agent-think first (creates the
AgentThinkentrypoint), then gh-app (whose service binding points at it). - Dedup semantics: gh-app marks
handled:comments:<id>BEFORE dispatch, so a failed dispatch is not retried by webhook redelivery — that's what the ❌ comment is for. Issue-level triage marks only after success (retryable). - A re-mention with a fresh token mid-turn is fine:
#ensureGitAuthre-auths whenever the context token changes (checked everybeforeTurn). - WebSocket upgrades need
run_worker_first. The assets layer passes ordinary no-asset-match requests through to the worker, but NOT WebSocket upgrades — a WS to/agents/*dies at the assets router unless the path is inrun_worker_first. Symptom: the UI's HTTP calls work while everywss://connect fails. (This bit us on the command center; the repro-skill recipe carries the same rule.) /tempis deliberately outside the VFS mount. Put long logs there and tail them with container bash so neither the VFS nor tool results absorb the full output.- Deploys reset in-flight turns. A deploy lazily resets every DO onto the new code; a running turn loses its container connection and burns minutes on Think's (working) recovery — it re-auths and resumes, but don't deploy while runs are active. Check for recent turn activity first (observability logs / the command center).
Development
pnpm test # fast unit suite: workers pool + MSW, no container
pnpm test:e2e # real `wrangler dev --local` + docker container + real turn
# needs .env (cp .env_example .env, set GH_TOKEN)
# first run builds the image — slow; see WARP note above
pnpm run deploy # vite build (thread UI) + wrangler deploy (worker + image)
npm run seed:r2 # push skills/** to the R2 bucket (add -- --local for dev)- Vitest configs live next to their suites:
test/vitest.config.ts(Workers runtime module/DO tests) andtests-e2e/vitest.config.ts(real Wrangler + Docker infrastructure, with only inference replaced by a test subclass).vite.config.tsat the root builds only the thread UI intodist/client. - Local-only HTTP surface (gated on
LOCAL_DEV=1, set automatically by the e2e harness):POST /dev/dispatchandGET /dev/messages/:session— drive the full agent path without gh-app or webhooks. - Deploys target the
agentsCloudflare account (CLOUDFLARE_ACCOUNT_ID=b8afc92c7a87f699592038b756153d22). - Model:
gpt-5.6-solwith max reasoning through the OpenAI Responses API and team AI Gateway token, with a client-side fallback toclaude-opus-4-8when the primary dispatch fails. Responses usestore: false, so agent-think does not persist provider reasoning state. - Agent-think uses the monorepo's Agents, AI Chat, and Think workspace
packages and opts into full message/tool payload spans. The turn safety cap
is 250 steps.
Production reads
CLOUDFLARE_AIG_TOKENfrom a Worker secret and attributes every request to theagents-team-agent-thinkproject. Local agent turns read the same variable from.env.
Where the pieces live
- This package: the public agent (Worker, DOs, container image, skills, thread UI).
- gh-app (webhook ingress + GitHub App auth + triage/release automations):
GitLab
cloudflare/ai-agents/team-apps,apps/gh-app— private, holds the App credentials and theAGENT_THINKservice binding.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

