Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(feedback): set product user agent (#2073)

Max34d2f50d892e
diff --git a/docs/plans/feedback-intake-launch.md b/docs/plans/feedback-intake-launch.md
index a1ef24f4e..09edbdeb3 100644
--- a/docs/plans/feedback-intake-launch.md
+++ b/docs/plans/feedback-intake-launch.md
@@ -314,3 +314,24 @@ status-query outcome after observed429, status-independent POST body handling,
interruption after the durable observation, fresh404-gated recovery, monotonic
server receipt precedence and the existing one-write race. Any new finding in
this lifecycle class returns to PM before another edit or push.
+
+## Post-merge public edge compatibility finding (2026-09-20)
+
+After PR #2066 was merged, the first read-only request through the allocated
+public edge exposed a client compatibility defect. The default
+`Python-urllib/3.x` user agent was rejected by the edge with Cloudflare 1010,
+while the same GET request with `avibe-feedback-intake/1` reached the application
+and returned the expected empty receipt (`404` and `{}`). A browser user agent
+also reached the application. This was an edge admission policy interaction;
+the receiver protocol, status-only POST contract, receipt semantics, and fixed
+destination were unchanged. No credential or GitHub write was involved.
+
+The smallest correction fixes the existing use-avibe helper's product
+`User-Agent` to `avibe-feedback-intake/1` for every request. Content-Type,
+redirect blocking, proxy disabling, deadlines, POST status handling, unknown
+outcome protection, and GET-only resume remain unchanged. A focused consumer
+test sends both GET and POST through the helper's real `urllib.request.Request`
+and loopback HTTP path and asserts that the product user agent arrives at the
+server for both methods. The public-edge observation is operational evidence,
+not a CI dependency; no external request or public Issue creation is required
+for this correction.
diff --git a/skills/use-avibe/scripts/feedback_intake.py b/skills/use-avibe/scripts/feedback_intake.py
index 9cb69f1c9..75e3d5306 100644
--- a/skills/use-avibe/scripts/feedback_intake.py
+++ b/skills/use-avibe/scripts/feedback_intake.py
@@ -45,7 +45,8 @@ def _share_base():
def _request(path, *, body=None, on_status=None):
req = urllib.request.Request(_share_base() + path, data=body,
- headers={"Content-Type": "application/json"})
+ headers={"Content-Type": "application/json",
+ "User-Agent": "avibe-feedback-intake/1"})
opener = urllib.request.build_opener(NoRedirect(), urllib.request.ProxyHandler({}))
try:
response = opener.open(req, timeout=10)
diff --git a/tests/test_feedback_intake.py b/tests/test_feedback_intake.py
index e8147af3c..ac1fe7c8c 100644
--- a/tests/test_feedback_intake.py
+++ b/tests/test_feedback_intake.py
@@ -30,6 +30,13 @@ def load_worker():
return module
+def load_client():
+ spec = importlib.util.spec_from_file_location("feedback_client", HELPER)
+ module = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(module)
+ return module
+
+
def make_payload(request_id=None, **overrides):
value = dict(schema_version=1, request_id=request_id or str(uuid.uuid4()), kind="bug",
title="Workbench: 中文 ☃", body="Observed: 中文 ☃\n\nExpected: newlines & # $(data).", public_consent=True)
@@ -552,6 +559,55 @@ def test_helper_429_retries_only_same_saved_attempt(github, tmp_path):
thread.join(2)
+def test_helper_sends_product_user_agent_for_get_and_post(monkeypatch):
+ class Handler(BaseHTTPRequestHandler):
+ def log_message(self, *args):
+ pass
+
+ def do_GET(self): # noqa: N802
+ self.server.requests.append((self.command, self.headers, b""))
+ raw = b"{}"
+ self.send_response(404)
+ self.send_header("Content-Type", "application/json")
+ self.send_header("Content-Length", str(len(raw)))
+ self.end_headers()
+ self.wfile.write(raw)
+
+ def do_POST(self): # noqa: N802
+ body = self.rfile.read(int(self.headers["Content-Length"]))
+ self.server.requests.append((self.command, self.headers, body))
+ raw = b'{"ok":true}'
+ self.send_response(202)
+ self.send_header("Content-Type", "application/json")
+ self.send_header("Content-Length", str(len(raw)))
+ self.end_headers()
+ self.wfile.write(raw)
+
+ server = ThreadingHTTPServer(("127.0.0.1", 0), Handler)
+ server.requests = []
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
+ thread.start()
+ monkeypatch.setenv("AVIBE_FEEDBACK_TEST_MODE", "1")
+ monkeypatch.setenv(
+ "AVIBE_FEEDBACK_TEST_SHARE_BASE_URL",
+ f"http://127.0.0.1:{server.server_port}",
+ )
+ try:
+ client = load_client()
+ assert client._request("/api/feedback-status?request_id=missing") == (404, {})
+ assert client._request("/api/feedback", body=b"{}") == (202, None)
+ assert [request[0] for request in server.requests] == ["GET", "POST"]
+ assert all(
+ request[1]["User-Agent"] == "avibe-feedback-intake/1"
+ for request in server.requests
+ )
+ assert server.requests[1][2] == b"{}"
+ finally:
+ server.shutdown()
+ thread.join(2)
+ server.server_close()
+
+
def test_runtime_manifest_validation_survives_optimized_python(tmp_path):
manifest = tmp_path / "bad-manifest.json"
archive = tmp_path / "vibe-show-runtime-node-linux-x64.tgz"