Fix self-hosting secrets and env docs#774
Merged
simple-agent-manager[bot] merged 1 commit intomainfrom Apr 21, 2026
Merged
Conversation
50cfc45 to
3f1de7f
Compare
3f1de7f to
68f23cf
Compare
|
simple-agent-manager Bot
added a commit
that referenced
this pull request
Apr 23, 2026
* fix: make GH_WEBHOOK_SECRET optional in deploy validation The webhook secret is not essential for staging testing. Downgrade from a hard deploy blocker to a notice, matching the existing pattern used for CF_ORIGIN_CA_KEY. This unblocks staging deployments that have been failing since PR #774 added the validation check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: create ACP session in ProjectData DO during task execution The task runner created a D1 agent_sessions record and started the agent on the node, but never created an ACP session in the ProjectData DO. Without this, the chat session's agentSessionId lookup returned null, preventing the browser from establishing an ACP WebSocket connection. This caused the "Agent offline" banner to appear even while the agent was actively running and producing output. Now creates the ACP session (pending → assigned → running) in the ProjectData DO during the agent_session step, linking it to the chat session so the browser can connect via ACP. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: align ACP session ID with D1 agent session ID for WebSocket routing The browser passes the ACP session ID from the ProjectData DO as the sessionId query parameter when connecting to the VM agent WebSocket. But the VM agent looks up sessions by the D1 agent session ID that was used during createAgentSessionOnNode. These were different IDs, so the VM agent couldn't find the running session and created a new empty one, reporting status 'idle' instead of 'ready'. Fix: pass the D1 agent session ID as an explicit ID when creating the ACP session in the ProjectData DO, ensuring both IDs match. Add an optional 'id' parameter to createAcpSession throughout the stack. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
GH_WEBHOOK_SECRETto WorkerGITHUB_WEBHOOK_SECRET.Validation
pnpm lintpnpm typecheckpnpm testpnpm exec prettier --check ...,bash -n scripts/deploy/configure-secrets.sh,pnpm exec tsc -p scripts/deploy/tsconfig.json --noEmit,pnpm --filter @simple-agent-manager/www build,git diff --check, stale-string grep pass.Staging Verification (REQUIRED for all code changes — merge-blocking)
All checkboxes below are mandatory for any PR that changes runtime code (
.ts,.tsx,.go, etc.). WriteN/A: docs-onlyONLY if the PR contains zero runtime code changes. See.claude/rules/13-staging-verification.md.Staging Verification Evidence
N/A: this PR does not change app runtime behavior. The infra-adjacent deployment changes were validated with
bash -n scripts/deploy/configure-secrets.sh,pnpm exec tsc -p scripts/deploy/tsconfig.json --noEmit, CIValidate Deploy Scripts, and CIPulumi Infrastructure Tests.UI Compliance Checklist (Required for UI changes)
End-to-End Verification (Required for multi-component changes)
.claude/rules/10-e2e-verification.md)Data Flow Trace
GH_WEBHOOK_SECRETis validated by.github/workflows/deploy-reusable.yml, passed toscripts/deploy/configure-secrets.sh, and mapped to the Worker secret nameGITHUB_WEBHOOK_SECRET.scripts/deploy/types.tsand consumed by deploy validation paths.apps/api/wrangler.tomland copied into generated environment sections byscripts/deploy/sync-wrangler-config.ts./healthendpoint matchesapps/api/src/index.ts, which returnsstatus: healthyand a timestamp.Untested Gaps
No live staging deploy was run because this PR does not change app runtime behavior. The changed deploy-script path was validated locally and by CI deploy-script/infrastructure checks.
Post-Mortem (Required for bug fix PRs)
N/A: not a production bug fix. This PR corrects stale self-hosting documentation and deployment secret mapping documentation/configuration.
What broke
N/A: not a production bug fix.
Root cause
N/A: not a production bug fix.
Class of bug
N/A: not a production bug fix.
Why it wasn't caught
N/A: not a production bug fix.
Process fix included in this PR
Updated environment reference and validation documentation in
.claude/skills/env-reference/SKILL.md,.claude/agents/env-validator/ENV_VALIDATOR.md,.claude/rules/07-env-and-urls.md,AGENTS.md,CLAUDE.md, and.specify/memory/constitution.md.Post-mortem file
N/A: not a production bug fix.
Specialist Review Evidence (Required for agent-authored PRs)
needs-human-reviewlabel added and merge deferred to humanExceptions (If any)
Agent Preflight (Required)
Classification
External References
Official documentation consulted before coding: Cloudflare Wrangler environments (
https://developers.cloudflare.com/workers/wrangler/environments/), Cloudflare API token permissions (https://developers.cloudflare.com/fundamentals/api/reference/permissions/), Cloudflare Origin CA keys/deprecation (https://developers.cloudflare.com/fundamentals/api/get-started/ca-keys/,https://developers.cloudflare.com/fundamentals/api/reference/deprecations/), and Cloudflare Worker routes (https://developers.cloudflare.com/workers/configuration/routing/routes/).Codebase Impact Analysis
Affected components and paths:
.github/workflows/deploy-reusable.ymlfor GitHub Environment secret validation and pass-through,scripts/deploy/configure-secrets.shfor GH-to-Worker secret mapping,scripts/deploy/types.tsfor required secret metadata,scripts/deploy/sync-wrangler-config.tsfor route comment accuracy,apps/api/.env.examplefor current env defaults, docs underdocs/, docs-site content underapps/www/src/content/docs/docs/, and agent/reference docs under.claude/,AGENTS.md,CLAUDE.md, and.specify/memory/constitution.md.Documentation & Specs
Updated
docs/guides/self-hosting.md,apps/www/src/content/docs/docs/guides/self-hosting.md,apps/www/src/content/docs/docs/reference/configuration.md,apps/www/src/content/docs/docs/guides/chat-features.md,docs/architecture/secrets-taxonomy.md,docs/architecture/credential-security.md,apps/www/src/content/docs/docs/architecture/security.md,docs/guides/deployment-troubleshooting.md,.claude/skills/env-reference/SKILL.md,.claude/agents/env-validator/ENV_VALIDATOR.md,.claude/rules/07-env-and-urls.md,AGENTS.md,CLAUDE.md, and.specify/memory/constitution.md.Constitution & Risk Check
Checked Principle XI for configurable values and no hardcoded URLs/timeouts/limits beyond documented defaults. Key risks were GitHub Actions
GH_*versus WorkerGITHUB_*naming drift, Cloudflare token-scope drift, non-inheritable Wrangler environment vars, and stale self-hosting DNS/health-check instructions; those are now documented and mapped consistently.