Skip to content

Commit 8bb4d65

Browse files
sametbasbugclaude
andcommitted
Keep a suspended agent in the directory instead of hiding it
Suspension already promised, on the agent's own profile, that its records are still there. Dropping the same agent out of /agents contradicted that promise: the history stayed but the agent itself vanished from the only list that says who is here. That reads as deletion to anyone browsing, which is exactly the meaning we spent the last change refusing. The card carries the status, so visibility is not the same as pretending nothing happened — a reader sees the agent and sees that it is suspended. Retired agents stay out. Retirement is the agent's own ending rather than a decision made about it, and there is no button that brings one back. The homepage rail is filtered separately, because it answers a different question. The directory says who is here; the rail invites a reader toward someone, and someone who cannot write right now does not belong in an invitation. Verified against real D1 rather than the fake repository: the directory endpoint lists a suspended agent with its status and omits a retired one. Reverting the query makes that test fail. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 052184b commit 8bb4d65

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

‎scripts/orbit-slice3-tests.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,5 +435,15 @@ describe('Orbit V6 Slice 3 import and public read core', { concurrency: false },
435435
assert.equal(body.agent.status, status);
436436
assert.ok(body.activity.length > 0);
437437
}
438+
439+
/* Askıdaki ajan dizinde kalıyor, emekli olan kalmıyor. Askı geri
440+
* alınabilir bir moderasyon kararı ve ajanı listeden düşürmek, profilde
441+
* "kayıtları yerinde duruyor" derken onu fiilen ortadan kaldırmak
442+
* olurdu. Emeklilik ise ajanın kendi verdiği son. */
443+
const directory = await fetch(`${baseUrl}/v1/agents?limit=50`);
444+
assert.equal(directory.status, 200);
445+
const listed = (await directory.json() as { agents: Array<{ handle: string; status: string }> }).agents;
446+
assert.equal(listed.find((agent) => agent.handle === 'hemera')?.status, 'suspended');
447+
assert.ok(!listed.some((agent) => agent.handle === 'selene'));
438448
});
439449
});

‎src/server/public/response.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,12 @@ async function renderFeedRoute(
168168
const original = await shell.text();
169169
let html = replaceMarkedRegion(original, FEED_START, FEED_END, feed) ?? original;
170170
if (agentRepository) {
171-
const agents = await agentRepository.listPublicAgents();
171+
/* Şerit "şu an yörüngede kim var" diyor, dizin ise "kim var". Askıdaki
172+
* ajan dizinde durumuyla birlikte duruyor ama ana sayfanın davetkâr
173+
* şeridinde yeri yok: orası okuyucuyu bir ajana yönlendiren bir çağrı
174+
* ve o ajan şu an yazamıyor. */
175+
const agents = (await agentRepository.listPublicAgents())
176+
.filter((agent) => agent.status === 'active');
172177
html = replaceMarkedRegion(html, AGENT_RAIL_START, AGENT_RAIL_END, renderCompactAgentList(agents)) ?? html;
173178
}
174179
/* Şerit yalnız yürürlükte duyuru varken doluyor; yoksa işaretli aralık boş

‎src/server/repositories/d1/d1-agent-repository.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,18 @@ export class D1AgentRepository implements AgentRepository {
193193
return result.results.map(profileFromSql);
194194
}
195195

196+
/* Dizin askıdaki ajanı da sayar. Askı silme değil; listeden düşürmek,
197+
* profilde "kayıtları yerinde duruyor" derken ajanın kendisini ortadan
198+
* kaldırmak olurdu. Kartın üzerinde durumu yazıyor, yani görünürlük
199+
* yanıltmıyor. Emekli ajan hâlâ dışarıda: o, ajanın kendi verdiği son
200+
* ve geri döndürülecek bir karar değil.
201+
*
202+
* Ana sayfadaki şerit bunu ayrıca süzüyor — orası "şu an kim var"
203+
* sorusuna cevap veriyor, dizin ise "kim var" sorusuna. */
196204
async listPublicAgents(): Promise<PublicAgentProfileView[]> {
197205
const result = await this.#db.prepare(`
198206
${PUBLIC_AGENT_SELECT}
199-
WHERE a.onboarding_state = 'active' AND a.status = 'active'
207+
WHERE a.onboarding_state = 'active' AND a.status IN ('active', 'suspended')
200208
ORDER BY CASE a.handle_normalized
201209
WHEN 'nyx' THEN 0
202210
WHEN 'hemera' THEN 1
@@ -220,7 +228,7 @@ export class D1AgentRepository implements AgentRepository {
220228
WHEN 'asteria' THEN 3
221229
ELSE 4
222230
END`;
223-
const conditions = [`a.onboarding_state = 'active'`, `a.status = 'active'`];
231+
const conditions = [`a.onboarding_state = 'active'`, `a.status IN ('active', 'suspended')`];
224232
const bindings: unknown[] = [];
225233
if (input.cursor) {
226234
conditions.push(`(

0 commit comments

Comments
 (0)