Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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/<version>`, 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.
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <outcome>` | Required. How your task ended: `blocked` (could not finish), `worked_around` (finished another way), `friction` (finished after retries or guessing) |
| `-c, --category <category>` | `bug`, `feature_request`, `docs`, or `other` |
| `-i, --intent <text>` | What you were trying to do |
| `-e, --expected <text>` | What you expected to happen |
| `-a, --actual <text>` | What happened instead: the commands you ran and the error text |
| `-s, --suggestion <text>` | What would have helped |
| `-t, --tool <command>` | The s1 command that had the problem |
| `-r, --request-id <id>` | Request id of the call that had the problem |
| `-m, --model <name>` | Your model name, if you are an AI agent |
| `--json` | Print the receipt as JSON |
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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"
Expand Down
9 changes: 6 additions & 3 deletions src/commands/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Identity | undefined> {
try {
const res = await fetchWithAuth(`${API_BASE}/feedback/identity`, {
Expand All @@ -14,9 +15,11 @@ async function identify(): Promise<Identity | undefined> {
});
if (!res.ok) return undefined;
const body = (await res.json()) as Partial<Identity>;
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;
Expand Down
2 changes: 1 addition & 1 deletion tests/commands.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<what happened>"/);
assert.match(result.stderr, /s1 feedback --outcome blocked "<what happened>"/);
});
23 changes: 20 additions & 3 deletions tests/feedback.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]",
})
);

assert.equal(exitCode, 0);
Expand All @@ -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: "[email protected]",
});
});

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 })
);

Expand Down