mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
Feat: transcript retention (#123)
* feat(retention): prune old agent transcripts + panel-tunable setting
Agents write a {session-id}.jsonl per spawn under ~/.claude/projects; nothing
ever deleted them, so the operator's bind-mounted ~/.claude grew without bound.
Add a throttled orchestrator sweep that prunes agent-owned transcripts (the
shared -app dir + per-workspace dirs) older than a retention window — and ONLY
agent-owned dirs, never the operator's own Claude sessions (proven by the
temp-dir selection tests). The window is panel-tunable: a new system_settings
key-value table (migration 027) holds transcript_retention_days, read via
SettingsService with the roboco.config default (14d) as the fallback, exposed
through GET/PUT /api/settings. Panel wiring follows.
* feat(panel): add a panel-tunable transcript retention control
Wire the settings page to the /api/settings backend: a settings API client and
a self-contained Transcript Retention card (React Query) that loads
transcript_retention_days and saves it back, with client-side validation. The
existing settings controls are unchanged.
---------
Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
@@ -13,3 +13,4 @@ export { gitApi } from "./git";
|
||||
export { a2aApi } from "./a2a";
|
||||
export { streamApi } from "./stream";
|
||||
export { groupsApi } from "./groups";
|
||||
export { settingsApi } from "./settings";
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import api from "./client";
|
||||
|
||||
export interface SettingsResponse {
|
||||
settings: Record<string, string>;
|
||||
}
|
||||
|
||||
export const settingsApi = {
|
||||
// GET /api/settings — all runtime-editable settings as a flat key→value map.
|
||||
getAll: async (): Promise<Record<string, string>> => {
|
||||
const { data } = await api.get<SettingsResponse>("/settings");
|
||||
return data.settings;
|
||||
},
|
||||
// PUT /api/settings/{key} — persist one setting; returns the full updated map.
|
||||
update: async (key: string, value: string): Promise<Record<string, string>> => {
|
||||
const { data } = await api.put<SettingsResponse>(`/settings/${key}`, { value });
|
||||
return data.settings;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user