sessions: an agent left off in the first "allow selected" is asked about once more, on Sessions and Usage › Requests

baysonfox on X: with magpie installed after Antigravity 2.0, the app's
sessions and calls made without magpie never showed in Usage, while agy
CLI's did. The first consent named the app off beside agy, and a named
agent was never "new" again, so nothing asked about it and nothing on
Usage said why. The reader is fine: the app's calls come from its own
SQLite steps (antigravityRead), read once allowed.

Nothing is turned on by magpie: the gate is the user's privacy choice.
Instead:
- settings.SessionReads gets Kept: agents turned off on their own (a
  sessions/reads post without `all`: Keep off, a Settings › Privacy row,
  `magpie sessions read off <agent>`). A post setting it on takes it out.
- readsNow's New: off, found here and not Kept (was: never named). So an
  agent left off in the first choice's list is asked about once more,
  as one found later already was.
- Usage › Requests shows a line above its rows for those agents
  (readsLater in the usage plugin): Count {names} / Don't count, the
  same {agents} posts as the Sessions page's laterCard. Gone after
  either answer; sessions/reads read at most once a minute.
- Old data: an agent turned off in Settings before Kept existed has no
  entry and is asked once more, for every user with such an agent.

Tests:
- TestSessionReadsUncheckedAgentAskedAgain (count, keep off): sandbox
  HOME with testdata/agy-sessions and the real Antigravity 2.30
  conversation (antigravity-2.30-tools); after the first choice the app
  is off and New, has no rows in /api/usage/requests; Count brings its
  rows in, Keep off keeps none, and neither is asked again. Red on the
  old code (New false after the first choice).
- TestSessionReadsTurnedOffNotAskedAgain: off on its own, under all true
  and all false, is neither on nor New.
- usage-reads-note.test.cjs: the Requests line in Chromium and WebKit,
  en/zh/zh-TW/ja/de at 900/420/390px, both answers, buttons inside the
  line, no sideways scroll; red on the old code (no #ledReads).

Run on mica (mote was full: load 40+, another GUI suite on it), rebased
on 389169f76:
- gofmt -l clean
- go vet on gui, sessions, settings, cli and tui; GOOS=linux -tags nogui
  and GOOS=windows vet on gui, sessions, settings and cli; go build ./...
- go test -count=1 -timeout 45m on internal/gui, sessions, settings, cli
  and tui: all ok except gui's TestGatewayModeListsNoOwnSessions, red
  the same on an untouched 389169f76 copy (#7064)
- GUI, both engines: usage-reads-note, sessions-reads, i18n-keys,
  i18n-en-no-cjk, usage-ledger, usage-request-page, usage-no-reading,
  usage-ledger-fit, ledger-hscroll, usage-phone-head, sessions-usage-off.
  Only usage-ledger's "newest live route needs no return-to-live button"
  was red (en, zh, both engines), red the same on the untouched
  389169f76 copy (#3104). i18n-keys first caught "Leave off" as otel's
  word; renamed to "Don't count".
- After rebasing on dc507aefd: gofmt, vet, the TestSessionReads tests
  and usage-reads-note, i18n-keys, i18n-en-no-cjk and sessions-reads
  again: all ok, 98 of 98 GUI tests.

Broken by hand: recording Kept on every off post (all sent too) turns
TestSessionReadsNewAgent, ...UncheckedAgentAskedAgain and
...TurnedOffNotAskedAgain red.

Not tried: the whole GUI suite (both machines had another GUI suite
running), the full go test ./..., and a real Antigravity 2.0 install
in the GUI; the live Antigravity data was not touched.
This commit is contained in:
yetone
2026-11-18 20:59:55 +08:00
parent dc507aefd3
commit 5cf1d3846a
10 changed files with 297 additions and 13 deletions
+14 -5
View File
@@ -441,11 +441,20 @@ covers them), and `sessions/manage` carries the same as `reads`. While
`asked` is false the Sessions page shows the consent (`consentCard` in
the sessions plugin): each agent found with a switch, off; Allow selected
saves `all: false` with each agent picked or not, Allow all `all: true`.
A choice with `all` false reads no agent it doesn't name, so one found
after it (Antigravity 2.0 installed after Allow selected: baysonfox on
X) is `new` in `found` (on disk, not named, not read), and the Sessions
page asks about those once (`laterCard`): Show their sessions sends
each `true`, Keep off `false`, so it isn't new again.
A choice with `all` false reads no agent it doesn't name. An agent off
and found here is `new` in `found` unless it was turned off on its own:
a post without `all` that sets it `false` (Keep off, a Settings ›
Privacy row, `magpie sessions read off <agent>`) records it in
`sessionReads.kept`, and one that sets it `true` takes it out. So an
agent found after the first choice, and one left off in that choice's
list (Antigravity 2.0 beside agy CLI: baysonfox on X, whose app calls
made without magpie were counted nowhere), are asked about once more:
on the Sessions page (`laterCard`: Show their sessions sends each
`true`, Keep off `false`) and above Usage › Requests' rows (`readsLater`
in the usage plugin's `page.js`: Count / Don't count, the same posts).
An agent turned off in Settings before `kept` existed has no entry and
is asked once (`TestSessionReadsUncheckedAgentAskedAgain`,
`TestSessionReadsTurnedOffNotAskedAgain`).
Settings › Privacy, *Agents' session history* (`renderSessionReads` in
the sessions plugin's `settings.js`), has *Agents found later* (`all`, sent with each listed agent
at the value its row shows) and a row per agent.
+4
View File
@@ -1805,6 +1805,10 @@ body.masked :hover > .acct-eye, body.masked .pq-card:hover .acct-eye, body.maske
.led-hscroll::-webkit-scrollbar-button, .led-hscroll::-webkit-scrollbar-corner { display: none; }
.reads-note { margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.reads-note p { margin: 0; }
.reads-later { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 9px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.reads-later[hidden] { display: none; }
.reads-later p { margin: 0; flex: 1 1 260px; min-width: 0; color: var(--muted); line-height: 1.45; }
.reads-later-acts { display: flex; gap: 4px; margin-left: auto; }
.led-none { padding: 18px 16px; color: var(--muted); text-align: center; line-height: 1.5; }
.led-sk { padding: 11px 14px; }
.led-sk + .led-sk { border-top: 1px solid var(--line-2); }
@@ -76,6 +76,7 @@ magpie.plugin("usage", (ctx) => {
<button class="text" id="ledExport" type="button" title="Save every request listed, all pages, as a CSV file in Downloads" data-tt><span data-t>Export CSV</span></button>
</div>
<p class="usage-note" id="ledScope" data-t>Gateway and session-log calls; local rejections excluded from totals.</p>
<div class="reads-later" id="ledReads" role="group" hidden></div>
<div class="led-dash" id="ledDash" hidden>
<div class="led-strip" id="ledKpi"></div>
<section class="led-up" id="ledUp" hidden></section>
@@ -252,6 +252,8 @@ magpie.strings({
"Calls through the gateway and the calls Claude Code's and Codex's own session files record are counted here, with no provider set up.": "不设置任何提供商也行:经过网关的调用,以及 Claude Code 和 Codex 自己会话文件里记录的调用,都会计入这里。",
"magpie reads no agent's session files until you allow it, so {names} calls aren't counted here yet.": "magpie 在你允许之前不会读取任何 Agent 的会话文件,所以 {names} 的调用还没有计入这里。",
"Count {names}": "统计 {names}",
"magpie doesn't read the session files of {names}, so their calls that didn't go through magpie aren't counted here.": "magpie 没有读取 {names} 的会话文件,所以它们未经 magpie 的调用没有计入这里。",
"Don't count": "不统计",
"inside output": "计入输出",
"{when} · {tokens} tokens · {n} call": "{when} · {tokens} token · {n} 次调用",
"{when} · {tokens} tokens · {n} calls": "{when} · {tokens} token · {n} 次调用",
@@ -550,6 +552,8 @@ magpie.strings({
"Calls through the gateway and the calls Claude Code's and Codex's own session files record are counted here, with no provider set up.": "不設定任何供應商也行:經過閘道的呼叫,以及 Claude Code 和 Codex 自己會話檔案裡記錄的呼叫,都會計入這裡。",
"magpie reads no agent's session files until you allow it, so {names} calls aren't counted here yet.": "magpie 在你允許之前不會讀取任何 Agent 的會話檔案,所以 {names} 的呼叫還沒有計入這裡。",
"Count {names}": "統計 {names}",
"magpie doesn't read the session files of {names}, so their calls that didn't go through magpie aren't counted here.": "magpie 沒有讀取 {names} 的會話檔案,所以它們未經 magpie 的呼叫沒有計入這裡。",
"Don't count": "不統計",
"inside output": "計入輸出",
"{when} · {tokens} tokens · {n} call": "{when} · {tokens} token · {n} 次呼叫",
"{when} · {tokens} tokens · {n} calls": "{when} · {tokens} token · {n} 次呼叫",
@@ -848,6 +852,8 @@ magpie.strings({
"Calls through the gateway and the calls Claude Code's and Codex's own session files record are counted here, with no provider set up.": "プロバイダーを設定しなくても、ゲートウェイ経由の呼び出しと、Claude Code や Codex 自身のセッションファイルに記録された呼び出しがここに集計されます。",
"magpie reads no agent's session files until you allow it, so {names} calls aren't counted here yet.": "magpie は許可するまでエージェントのセッションファイルを読まないため、{names} の呼び出しはまだ集計されていません。",
"Count {names}": "{names} を集計する",
"magpie doesn't read the session files of {names}, so their calls that didn't go through magpie aren't counted here.": "magpie は {names} のセッションファイルを読んでいないため、magpie を経由しなかった呼び出しはここに集計されていません。",
"Don't count": "集計しない",
"inside output": "出力に含む",
"{when} · {tokens} tokens · {n} call": "{when} · {tokens} トークン · {n} 回の呼び出し",
"{when} · {tokens} tokens · {n} calls": "{when} · {tokens} トークン · {n} 回の呼び出し",
@@ -1146,6 +1152,8 @@ magpie.strings({
"Calls through the gateway and the calls Claude Code's and Codex's own session files record are counted here, with no provider set up.": "Auch ohne eingerichteten Anbieter werden hier die Aufrufe über das Gateway und die in den Sitzungsdateien von Claude Code und Codex selbst verzeichneten Aufrufe gezählt.",
"magpie reads no agent's session files until you allow it, so {names} calls aren't counted here yet.": "magpie liest keine Sitzungsdateien von Agenten, bis Sie es erlauben; deshalb sind die Aufrufe von {names} hier noch nicht gezählt.",
"Count {names}": "{names} zählen",
"magpie doesn't read the session files of {names}, so their calls that didn't go through magpie aren't counted here.": "magpie liest die Sitzungsdateien von {names} nicht, daher werden deren Aufrufe, die nicht über magpie liefen, hier nicht gezählt.",
"Don't count": "Nicht zählen",
"inside output": "in der Ausgabe enthalten",
"{when} · {tokens} tokens · {n} call": "{when} · {tokens} Token · {n} Aufruf",
"{when} · {tokens} tokens · {n} calls": "{when} · {tokens} Token · {n} Aufrufe",
+52
View File
@@ -362,6 +362,57 @@ async function readsNote(host) {
host.append(box);
}
// readsLater: the agents found here whose session files magpie doesn't
// read, and which were never turned off on their own (reads.found[].new):
// one installed after "allow selected", or left off in its list
// (baysonfox on X: Antigravity 2.0 beside agy CLI, whose calls made
// without magpie were counted nowhere). Requests says so above its rows
// and asks once: Count reads them, Don't count keeps them off and the line
// is gone for good. sessions/reads is read again at most once a minute.
let readsLaterAt = 0, readsLaterGot = null, readsLaterKey = "";
async function readsLater() {
const box = $("#ledReads");
if (!box) return;
if (Date.now() - readsLaterAt > 60e3) {
readsLaterAt = Date.now();
try { readsLaterGot = await api("sessions/reads"); } catch { readsLaterGot = null; }
}
const r = readsLaterGot;
const found = r?.asked && !r.gateway ? (r.found || []).filter((x) => x.new) : [];
const key = found.map((x) => x.agent).join(",") + "|" + locale;
if (key === readsLaterKey && box.childElementCount === (found.length ? 2 : 0)) return;
readsLaterKey = key;
box.hidden = !found.length;
if (!found.length) { box.replaceChildren(); return; }
const names = found.map((x) => x.name).join(t(", "));
const p = el("p", "", t("magpie doesn't read the session files of {names}, so their calls that didn't go through magpie aren't counted here.", { names }));
p.id = "ledReadsWhy";
box.setAttribute("aria-labelledby", p.id);
const acts = el("div", "reads-later-acts");
const answer = async (on) => {
for (const b of acts.children) b.disabled = true;
const agents = {};
for (const x of found) agents[x.agent] = on;
try {
readsLaterGot = await api("sessions/reads", { agents });
readsLaterAt = Date.now();
readsLater();
if (on) await loadLedger();
} catch (e) {
status(e.message, "err");
for (const b of acts.children) b.disabled = false;
}
};
const off = el("button", "text", t("Don't count"));
off.type = "button";
off.onclick = () => answer(false);
const go = el("button", "text primary", t("Count {names}", { names }));
go.type = "button";
go.onclick = () => answer(true);
acts.append(off, go);
box.replaceChildren(p, acts);
}
// noCallsIn is what an empty page says of the period it is on
function noCallsIn(p) {
if (periodDays(p)) return "No calls on the days picked.";
@@ -3558,6 +3609,7 @@ function ledProviderMore(p) {
function renderLedger() {
const l = ledger;
readsLater();
const callers = l.callerKeys || [];
const providers = l.providers || [];
const missingAgent = ledAgent && !l.agents.some((a) => a.id === ledAgent);
+6 -7
View File
@@ -19,11 +19,11 @@ type readAgentJSON struct {
Name string `json:"name"`
Icon string `json:"icon"`
On bool `json:"on"`
// New: found here, never named by the user's choice, and not read,
// since that choice reads only the agents it names (All false): an
// agent installed after "allow selected" (baysonfox on X: Antigravity
// 2.0's sessions showed only through the gateway). The Sessions page
// asks about these once.
// New: found here and not read, and never turned off on its own
// (settings.SessionReads.Kept): an agent installed after "allow
// selected", or one left off in its list (baysonfox on X: Antigravity
// 2.0's sessions and calls showed only through the gateway, agy CLI's
// always). The Sessions page and Usage › Requests ask about these once.
New bool `json:"new,omitempty"`
}
@@ -63,8 +63,7 @@ func readsNow() readsJSON {
for _, a := range agents {
j := readAgentJSON{Agent: a, Name: a, Icon: "generic", On: r.Reads(a)}
if r != nil && r.Asked && !j.On {
_, named := r.Agents[a]
j.New = !named && slices.Contains(here, a)
j.New = !r.Kept[a] && slices.Contains(here, a)
}
if l, ok := looks[a]; ok {
j.Name, j.Icon = l.Shared, l.Icon
@@ -0,0 +1,129 @@
package gui
import (
"encoding/json"
"net/http"
"net/http/httptest"
"path/filepath"
"strings"
"testing"
"github.com/yetone/magpie/internal/sessions"
"github.com/yetone/magpie/internal/settings"
)
// baysonfox on X, again: magpie was installed after Antigravity 2.0, so the
// first choice ("allow selected") listed the app and it was left off beside
// agy CLI. Named off, it was never "new", so neither the Sessions page nor
// Usage asked again, and the app's calls made without magpie were counted
// nowhere while agy's were. An agent left off in that first choice is asked
// about once more, on both pages; Show/Count reads it and its calls come
// into Usage › Requests; an agent turned off on its own (Keep off,
// Settings › Privacy) is kept off and not asked again. The app's folder is
// a real Antigravity 2.30 conversation (testdata/antigravity-2.30-tools).
func TestSessionReadsUncheckedAgentAskedAgain(t *testing.T) {
for _, allow := range []bool{true, false} {
t.Run(map[bool]string{true: "count", false: "keep off"}[allow], func(t *testing.T) {
h := sandboxHome(t)
copyTree(t, "../sessions/testdata/agy-sessions", filepath.Join(h, ".gemini", "antigravity-cli"))
copyTree(t, "../sessions/testdata/antigravity-2.30-tools", filepath.Join(h, ".gemini", "antigravity"))
if err := settings.SetSessionReads(func(*settings.SessionReads) *settings.SessionReads { return &settings.SessionReads{} }); err != nil {
t.Fatal(err)
}
sessions.Reset()
t.Cleanup(sessions.Reset)
mux := http.NewServeMux()
sessionManageRoutes(mux, folderOnly{})
usageRoutes(mux, folderOnly{})
call := func(method, path, body string) []byte {
t.Helper()
w := httptest.NewRecorder()
mux.ServeHTTP(w, httptest.NewRequest(method, path, strings.NewReader(body)))
if w.Code != 200 {
t.Fatalf("%s %s: %d %s", method, path, w.Code, w.Body)
}
return w.Body.Bytes()
}
app := func(r readsJSON) readAgentJSON {
t.Helper()
for _, f := range r.Found {
if f.Agent == "antigravity" {
return f
}
}
t.Fatalf("antigravity not found: %+v", r.Found)
return readAgentJSON{}
}
appRows := func() int {
t.Helper()
var page ledgerJSON
if err := json.Unmarshal(call("GET", "/api/usage/requests?period=all", ""), &page); err != nil {
t.Fatal(err)
}
n := 0
for _, row := range page.Rows {
if row.Agent == "antigravity" {
n++
}
}
return n
}
// the first choice, as the Sessions page's consent posts allow
// selected: every agent found named, the app left off
var r readsJSON
json.Unmarshal(call("POST", "/api/sessions/reads", `{"all":false,"agents":{"agy":true,"antigravity":false}}`), &r)
if a := app(r); a.On || !a.New {
t.Fatalf("the app left off in the first choice = %+v, want off and asked about again", a)
}
if n := appRows(); n != 0 {
t.Fatalf("%d of the app's calls counted before it was allowed", n)
}
body := `{"agents":{"antigravity":false}}`
if allow {
body = `{"agents":{"antigravity":true}}`
}
r = readsJSON{}
json.Unmarshal(call("POST", "/api/sessions/reads", body), &r)
if a := app(r); a.New || a.On != allow {
t.Fatalf("after the answer: %+v", a)
}
if s := settings.Shared().SessionReads; s == nil || s.All || !s.Agents["agy"] {
t.Fatalf("the answer changed the rest of the choice: %+v", s)
}
// the conversation's model calls, read from its database
if n := appRows(); allow && n == 0 || !allow && n != 0 {
t.Fatalf("allowed %v: %d of the app's calls in Usage › Requests", allow, n)
}
// asked once: a later read still says the same
r = readsJSON{}
json.Unmarshal(call("GET", "/api/sessions/reads", ""), &r)
if a := app(r); a.New {
t.Fatalf("asked about again after the answer: %+v", a)
}
})
}
}
// An agent turned off on its own, in Settings › Privacy or by Keep off, is
// the user's answer: it is not asked about again, under either first choice.
func TestSessionReadsTurnedOffNotAskedAgain(t *testing.T) {
for _, all := range []bool{true, false} {
h := sandboxHome(t)
copyTree(t, "../sessions/testdata/antigravity-2.30", filepath.Join(h, ".gemini", "antigravity"))
if err := settings.SetSessionReads(func(*settings.SessionReads) *settings.SessionReads { return &settings.SessionReads{} }); err != nil {
t.Fatal(err)
}
on := true
if err := sessions.SetReads(&all, map[string]bool{"antigravity": on}); err != nil {
t.Fatal(err)
}
if err := sessions.SetReads(nil, map[string]bool{"antigravity": false}); err != nil {
t.Fatal(err)
}
for _, f := range readsNow().Found {
if f.Agent == "antigravity" && (f.On || f.New) {
t.Fatalf("all %v, turned off in Settings: %+v", all, f)
}
}
}
}
+57 -1
View File
@@ -30,7 +30,18 @@ function serve(lang, store, posts) {
if (url.pathname === "/api/providers") return json({ providers: [], presets: [], excluded: [], gateway: { running: true, window: true, calls: [], groups: [] } });
if (url.pathname === "/api/plugins") return json({ plugins: [] });
if (url.pathname === "/api/sessions/reads") {
if (req.method() === "POST") { posts.push(req.postDataJSON()); store.asked = true; }
if (req.method() === "POST") {
const b = req.postDataJSON();
posts.push(b);
store.asked = true;
if (store.later && "antigravity" in b.agents) store.app = b.agents.antigravity;
}
// later: asked, agy CLI read and the Antigravity app left off in
// that first choice, so it is new until answered (baysonfox on X)
if (store.later) return json({ asked: true, all: false, found: [
{ agent: "agy", name: "Antigravity CLI", icon: "antigravity-color", on: true },
{ agent: "antigravity", name: "Antigravity", icon: "antigravity-color", on: store.app === true, new: store.app === undefined },
] });
return json({ asked: store.asked, all: false, found: found() });
}
if (url.pathname === "/api/speeds") return json([]);
@@ -91,6 +102,51 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
}
}
// baysonfox on X: the Antigravity app was left off in the first choice
// beside agy CLI, and its calls made without magpie were counted nowhere,
// with nothing on Usage saying why. Requests says so above its rows and asks
// once: Count reads it, Don't count keeps it off; either way the line goes.
const LATER = "magpie doesn't read the session files of {names}, so their calls that didn't go through magpie aren't counted here.";
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
for (const [lang, width] of LANGS) {
for (const on of [true, false]) {
test(`${engine} ${lang} ${width}px: Requests asks about an agent left off in the first choice (${on ? "Count" : "Don't count"})`, async (t) => {
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
t.after(() => browser.close());
const page = await (await browser.newContext({ viewport: { width, height: 800 }, reducedMotion: "reduce" })).newPage();
page.setDefaultTimeout(8000);
page.setDefaultNavigationTimeout(60000);
const errors = [];
page.on("pageerror", (e) => errors.push(e.message));
const store = { asked: true, later: true }, posts = [];
await page.route("**/*", serve(lang, store, posts));
await page.goto("http://magpie.test/?view=usage");
await page.locator(":is(#usageTab .opt, .nav-s):visible").nth(1).click();
const line = page.locator("#ledReads");
await line.locator("p").waitFor();
const want = await page.evaluate(([s]) => t(s, { names: "Antigravity" }), [LATER]);
if (lang !== "en") assert.notEqual(want, LATER.replace("{names}", "Antigravity"), "translated");
assert.equal(await line.locator("p").textContent(), want);
assert.equal(await line.getAttribute("role"), "group");
// the not-yet-asked note is not shown beside it
assert.equal(await page.locator("#ledWrap .reads-note").count(), 0);
// both buttons inside the line, nothing sideways
const box = await line.boundingBox();
for (const b of await line.locator("button").all()) {
const r = await b.boundingBox();
assert.ok(r.x >= box.x - 0.5 && r.x + r.width <= box.x + box.width + 0.5, "button inside the line");
}
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth > document.documentElement.clientWidth), false, "no sideways scroll");
assert.equal(posts.length, 0, "nothing changed before an answer");
await line.locator("button").nth(on ? 1 : 0).click();
await line.waitFor({ state: "hidden" });
assert.deepEqual(posts, [{ agents: { antigravity: on } }]);
assert.deepEqual(errors, []);
});
}
}
}
const SPEED = "Live output speed is measured on requests that go through magpie's gateway. For agents that don't, each call's tokens and time are in Usage › Requests, read from their session files.";
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
for (const [lang, width] of LANGS) {
+21
View File
@@ -147,6 +147,12 @@ func SetReads(all *bool, agents map[string]bool) error {
}
r.Agents[a] = on
}
for a := range cur.Kept {
if r.Kept == nil {
r.Kept = map[string]bool{}
}
r.Kept[a] = true
}
}
if all != nil {
r.All = *all
@@ -156,6 +162,21 @@ func SetReads(all *bool, agents map[string]bool) error {
r.Agents = map[string]bool{}
}
r.Agents[a] = on
// an agent turned off on its own (all not sent: Keep off,
// Settings › Privacy) is kept off and not asked about again;
// one left off in the first choice's list is (Kept)
switch {
case on:
delete(r.Kept, a)
case all == nil:
if r.Kept == nil {
r.Kept = map[string]bool{}
}
r.Kept[a] = true
}
}
if len(r.Kept) == 0 {
r.Kept = nil
}
return r
})
+5
View File
@@ -2285,6 +2285,11 @@ type SessionReads struct {
Asked bool `json:"asked"`
All bool `json:"all,omitempty"`
Agents map[string]bool `json:"agents,omitempty"`
// Kept: the agents turned off one by one (Keep off, Settings ›
// Privacy), not only left off among the first choice's list. An agent
// that is off, found here and not kept is asked about once more
// (baysonfox on X: Antigravity 2.0 left off beside agy CLI).
Kept map[string]bool `json:"kept,omitempty"`
}
// Reads says whether agent's session files may be read.