Skip to content

promote: staging → main (WAF UA fix)#153

Merged
mabry1985 merged 2 commits intomainfrom
staging
Apr 23, 2026
Merged

promote: staging → main (WAF UA fix)#153
mabry1985 merged 2 commits intomainfrom
staging

Conversation

@mabry1985
Copy link
Copy Markdown
Contributor

@mabry1985 mabry1985 commented Apr 23, 2026

Summary

Promotes #151/#152 (OpenAI SDK User-Agent override for Cloudflare WAF) from `staging` to `main` for release.

Test plan

  • Fix verified end-to-end: live gateway returns 200 with `User-Agent: protoAgent/0.1`, 403 with `User-Agent: OpenAI/Python`
  • CI green
  • Post-deploy: restart `protoagent-local` container on new image → confirm WAF passthrough

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Chores
    • Version updated to 0.2.1
    • Improved deployment workflow configuration for automated homepage updates
    • Updated LLM client configuration

mabry1985 and others added 2 commits April 22, 2026 19:39
* chore: release v0.2.0

First tagged release. Contents of community-improvements project:

M1 — Security Hardening (A2A bearer auth, audit redaction, origin verification)
M2 — Memory On By Default (session persistence + load-on-start)
M3 — Skill Loop (skill-v1 emission + SQLite FTS5 index + curator)

Plus: .gitignore cleanup for .automaker-lock + .worktrees, docs coverage of
security layer, skill-loop architecture, and new env vars.

Manual bump because prepare-release.yml requires GH_PAT secret (not configured).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: release v0.2.1

Bug fixes from v0.2.0 smoke testing:
- Agent card now advertises bearer scheme when A2A_AUTH_TOKEN is set
- Session memory persistence actually fires (moved from unreachable on_session_end to after_agent)
- Test suite collects cleanly in fresh Docker env
- MemoryMiddleware activates standalone (without knowledge_store)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(ci): update repo homepage after docs deploy (#149)

Writes the deployed GitHub Pages URL back to the repo's `homepage`
field so it renders in the About sidebar on the repo page.

Co-authored-by: Automaker <automaker@localhost>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(llm): override OpenAI SDK User-Agent to bypass Cloudflare WAF

Cloudflare's managed WAF on the proto-labs.ai zone returns 403 "Your
request was blocked" for any request whose User-Agent starts with
`OpenAI/Python` or `AsyncOpenAI/Python` — which is exactly what
langchain_openai.ChatOpenAI sends by default via the bundled OpenAI
SDK. /v1/models succeeded (different SDK path / UA) while
/v1/chat/completions failed, making the break look like a key/ACL
issue when it was a header signature match.

Reproduction (before fix):
  curl -H 'User-Agent: OpenAI/Python 1.54.0' -H 'Authorization: Bearer <key>' \
    https://api.proto-labs.ai/v1/chat/completions -d '{...}'
  -> HTTP 403 "Your request was blocked."

The same call with User-Agent: curl/*, python-httpx/*, or any
non-OpenAI string returns 200. `tools/lg_tools.py:226` already sets a
protoAgent UA for outbound HTTP fetches — reuse that identifier here
so every egress presents a consistent, allowlisted UA.

Alternative fixes considered:
- A Cloudflare Custom WAF Skip rule on the hostname: cleaner at the
  edge but requires a zone-scoped token and couples agent operability
  to infra config.
- Stripping the UA header at cloudflared: not possible; WAF fires
  before the tunnel sees the request.

The in-client override is the most portable fix: self-hosters on a
different edge keep working, operators behind Cloudflare stop getting
403s.

---------

Co-authored-by: Automaker <automaker@localhost>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Ava <ava@protolabs.ai>
promote: dev → staging (WAF UA fix)
@mabry1985 mabry1985 merged commit 4ef3a5f into main Apr 23, 2026
1 check was pending
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 28cdd0d2-f6bd-4948-8749-bd470a9695ed

📥 Commits

Reviewing files that changed from the base of the PR and between f1dcd3f and 2cb089b.

📒 Files selected for processing (3)
  • .github/workflows/docs.yml
  • graph/llm.py
  • pyproject.toml

Walkthrough

The pull request updates the GitHub Actions documentation workflow to automatically update the repository's homepage field to the deployed Pages URL after deployment. It also adds custom HTTP headers to the ChatOpenAI client configuration and bumps the project version to 0.2.1.

Changes

Cohort / File(s) Summary
GitHub Actions Documentation Workflow
.github/workflows/docs.yml
Grants administration: write permission and adds a step to update the repository's homepage field to the deployed GitHub Pages URL using the GitHub CLI and GITHUB_TOKEN authentication.
LLM Client Configuration
graph/llm.py
Supplies default_headers to the ChatOpenAI client to override the HTTP User-Agent header for requests.
Project Metadata
pyproject.toml
Bumps project version from 0.1.0 to 0.2.1.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch staging

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant