From 39a85d3bc8dac570ccf4fb7c7389904c86e831dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=A1=B6?= Date: Thu, 26 Nov 2026 20:57:14 +0800 Subject: [PATCH] Send the reporter's email with s1 feedback, Agentback 0.7 (2.6.0) s1 feedback reads the account's email from GET /feedback/identity and passes it with the signed account. Agentback 0.3 -> 0.7: s1 feedback now requires --outcome and accepts --expected/--actual/--suggestion/--tool. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 4 ++++ README.md | 13 +++++++++---- package-lock.json | 12 ++++++------ package.json | 4 ++-- src/commands/feedback.ts | 9 ++++++--- tests/commands.test.mjs | 2 +- tests/feedback.test.mjs | 23 ++++++++++++++++++++--- 7 files changed, 48 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 713a408..47f03d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.6.0 - 2026-11-26 + +`s1 feedback` reports carry your account's email next to the signed account, read from the gateway's `GET /feedback/identity`, so the Search1API team can reply. Updates the Agentback SDK to 0.7.0: `s1 feedback` now requires `-o/--outcome blocked|worked_around|friction` (how your task ended) and accepts `-e/--expected`, `-a/--actual`, `-s/--suggestion` and `-t/--tool`. The hint printed under a failed command shows the new form. + ## 2.5.0 - 2026-11-26 `s1` names itself to Search1API in `X-Search1API-Client: cli/`, and the coding agent running it (from `AI_AGENT`, or markers such as `CLAUDECODE`, `CODEX_SANDBOX`, `GEMINI_CLI`) in `X-Search1API-Client-App`, so API analytics can tell CLI and agent-skill traffic apart. Analytics only; it does not affect billing or auth. Importing the package as a library sends neither header. diff --git a/README.md b/README.md index 10db668..0dc0f40 100644 --- a/README.md +++ b/README.md @@ -298,18 +298,23 @@ s1 balance ### feedback -Report a wrong result, an error you could not resolve, or a missing capability to the Search1API team. Agents can use it too. When you are logged in, the report is linked to your account so the team can follow up. +Report a wrong result, an error you could not resolve, or a missing capability to the Search1API team. Agents can use it too. When you are logged in, the report is linked to your account, with its email, so the team can follow up. ```bash -s1 feedback "bingcn returned no results for a Chinese query" -s1 feedback --category feature_request --intent "monitor a site" "Need a webhook when a page changes" -echo "details..." | s1 feedback - +s1 feedback --outcome worked_around "bingcn returned no results for a Chinese query" +s1 feedback --outcome blocked --category feature_request --intent "monitor a site" "Need a webhook when a page changes" +echo "details..." | s1 feedback --outcome friction - ``` | Option | Description | |--------|-------------| +| `-o, --outcome ` | Required. How your task ended: `blocked` (could not finish), `worked_around` (finished another way), `friction` (finished after retries or guessing) | | `-c, --category ` | `bug`, `feature_request`, `docs`, or `other` | | `-i, --intent ` | What you were trying to do | +| `-e, --expected ` | What you expected to happen | +| `-a, --actual ` | What happened instead: the commands you ran and the error text | +| `-s, --suggestion ` | What would have helped | +| `-t, --tool ` | The s1 command that had the problem | | `-r, --request-id ` | Request id of the call that had the problem | | `-m, --model ` | Your model name, if you are an AI agent | | `--json` | Print the receipt as JSON | diff --git a/package-lock.json b/package-lock.json index 625b498..f3f3a00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "search1api-cli", - "version": "2.5.0", + "version": "2.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "search1api-cli", - "version": "2.5.0", + "version": "2.6.0", "hasInstallScript": true, "license": "MIT", "dependencies": { - "agentback": "^0.3.0", + "agentback": "^0.7.0", "chalk": "^5.4.1", "commander": "^13.1.0", "update-notifier": "^7.3.1" @@ -206,9 +206,9 @@ } }, "node_modules/agentback": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/agentback/-/agentback-0.3.0.tgz", - "integrity": "sha512-GZmEqgqPZaL7DXYSrxYap12Dwyb+pBCoee59HoDOuf16UNJL8uRwxSzFrsxMM5+w857V2GSehvOkf97qdaaK+Q==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/agentback/-/agentback-0.7.0.tgz", + "integrity": "sha512-Gl6ap2jf/o5zXVGL8FnyHqyD2doHN6ZelhJFyNgfLCGsRheyC52A5+xpo+GGgO3IJ9fiDWI0Z/QfgPhUR/IynQ==", "license": "MIT", "engines": { "node": ">=20" diff --git a/package.json b/package.json index 453b260..d5b3539 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "search1api-cli", - "version": "2.5.0", + "version": "2.6.0", "description": "CLI tool for Search1API - web search, maps, news, crawl, deepcrawl, sitemap, and trending", "type": "module", "exports": { @@ -53,7 +53,7 @@ "scripts" ], "dependencies": { - "agentback": "^0.3.0", + "agentback": "^0.7.0", "chalk": "^5.4.1", "commander": "^13.1.0", "update-notifier": "^7.3.1" diff --git a/src/commands/feedback.ts b/src/commands/feedback.ts index 20a4170..8ad9d22 100644 --- a/src/commands/feedback.ts +++ b/src/commands/feedback.ts @@ -4,8 +4,9 @@ import { runFeedbackCommand } from "agentback/cli"; import { fetchWithAuth } from "../auth.js"; import { AGENTBACK_PROJECT_KEY, API_BASE } from "../config.js"; -// Signed so Agentback can trust which Search1API user sent the report. Without -// a working credential the report is sent without an account. +// Signed so Agentback can trust which Search1API user sent the report, with +// their email when the gateway has one so it can be answered. Without a +// working credential the report is sent without an account. async function identify(): Promise { try { const res = await fetchWithAuth(`${API_BASE}/feedback/identity`, { @@ -14,9 +15,11 @@ async function identify(): Promise { }); if (!res.ok) return undefined; const body = (await res.json()) as Partial; + const email = + typeof body.email === "string" && body.email ? body.email : undefined; return typeof body.account === "string" && typeof body.signature === "string" - ? { account: body.account, signature: body.signature } + ? { account: body.account, signature: body.signature, email } : undefined; } catch { return undefined; diff --git a/tests/commands.test.mjs b/tests/commands.test.mjs index dea2c68..ae94542 100644 --- a/tests/commands.test.mjs +++ b/tests/commands.test.mjs @@ -89,5 +89,5 @@ test("points agents at s1 feedback when a command fails", () => { }); assert.equal(result.status, 1); assert.match(result.stderr, /^Error: /); - assert.match(result.stderr, /s1 feedback ""/); + assert.match(result.stderr, /s1 feedback --outcome blocked ""/); }); diff --git a/tests/feedback.test.mjs b/tests/feedback.test.mjs index c39bacc..f3fd128 100644 --- a/tests/feedback.test.mjs +++ b/tests/feedback.test.mjs @@ -36,8 +36,23 @@ async function runFeedback(args, identityResponse) { test("feedback is sent under the signed-in Search1API account", async () => { const { calls, stdout, exitCode } = await runFeedback( - ["-c", "bug", "--intent", "find docs", "bingcn", "returned", "nothing"], - () => Response.json({ account: "user_123", signature: "a".repeat(64) }) + [ + "-c", + "bug", + "--outcome", + "worked_around", + "--intent", + "find docs", + "bingcn", + "returned", + "nothing", + ], + () => + Response.json({ + account: "user_123", + signature: "a".repeat(64), + email: "user@example.com", + }) ); assert.equal(exitCode, 0); @@ -48,14 +63,16 @@ test("feedback is sent under the signed-in Search1API account", async () => { message: "bingcn returned nothing", intent: "find docs", category: "bug", + outcome: "worked_around", source: "cli", account: "user_123", account_signature: "a".repeat(64), + email: "user@example.com", }); }); test("feedback is still sent when the account lookup fails", async () => { - const { calls, exitCode } = await runFeedback(["--json", "it broke"], () => + const { calls, exitCode } = await runFeedback(["--json", "--outcome", "blocked", "it broke"], () => Response.json({ error: "Unauthorized" }, { status: 401 }) );