Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def memory_bind(obj, store: str, source: pathlib.Path) -> None:
f"agentbricks memory stores create --name {store}",
"Create the store now without deploying",
),
("agentbricks dev", "Re-run to pick up the store locally"),
("agentbricks dev", "Local development keeps long-term memory off"),
("agentbricks deploy <name>", "Create it if missing and grant the app access"),
],
)
Expand Down Expand Up @@ -233,7 +233,7 @@ def stores_create(obj, display_name, description) -> None:
(f"agentbricks memory stores get {store_id}", "View this store's details"),
(
f"agentbricks memory bind {display_name}",
"Bind this store to the agent (wired in on dev/deploy)",
"Bind this store to the agent (used after deploy)",
),
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def sessions_bind(obj, store: str, source: pathlib.Path) -> None:
f"agentbricks sessions stores create --name {store}",
"Create the store now without deploying",
),
("agentbricks dev", "Re-run to pick up the store locally"),
("agentbricks dev", "Local development keeps history in-process (lost on restart)"),
("agentbricks deploy <name>", "Create it if missing and grant the app access"),
],
)
Expand Down Expand Up @@ -164,7 +164,7 @@ def stores_create(obj, name, description, metadata) -> None:
(f"agentbricks sessions stores get {name}", "View this store's details"),
(
f"agentbricks sessions bind {name}",
"Bind this store to the agent (wired in on dev/deploy)",
"Bind this store to the agent (used after deploy)",
),
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,5 @@ async def append_session_items(request: Request, payload: SessionItemsRequest) -
@app.get("/api/demo/session/items", include_in_schema=False)
async def list_session_items(request: Request) -> dict:
session_id = _request_session_id(request)
if _session_store():
result = await _managed_call(_state_client().list_session_items, session_id)
return _chat_session_items(result)
# Managed session items contain checkpoints; the graph applies pending writes and reducers.
return await _checkpoint_history(session_id, _request_actor(request))
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _client(monkeypatch, *, configured=False, history=False, session_id="routing
else:
monkeypatch.delenv("AGENT_MEMORY_STORE", raising=False)
monkeypatch.delenv("AGENT_SESSION_STORE", raising=False)
if history:
if history or configured:
monkeypatch.setattr(ui, "_checkpoint_history", _session_history)
# Keep model discovery deterministic and offline (no AI Gateway listing call).
monkeypatch.setattr(ui, "_default_model", lambda: "system.ai.claude-sonnet-4-5")
Expand Down Expand Up @@ -549,7 +549,7 @@ def test_managed_memory_and_session_routes(monkeypatch):
assert [
item["data"]["content"]
for item in client.get("/api/demo/session/items").json()["session_items"]
] == ["s1", "saved reply"]
] == ["s1", "checkpoint reply"]

opened = client.post("/api/demo/sessions/s2/open")
assert opened.json() == {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -973,24 +973,6 @@ async function refreshSessionView({ hydrateChat = false } = {}) {
await refreshSessions();
}

async function recordSessionItems(items) {
if (!state.config?.session.managed || !items.length) return;
try {
const sessionId = await ensureManagedSession();
const response = await fetch(demoUrl("/api/demo/session/items"), {
method: "POST",
headers: { "Content-Type": "application/json", ...routingHeaders() },
body: JSON.stringify({ items }),
});
const result = await jsonResponse(response);
addEvent("session.items.append", result);
await refreshSessionView();
} catch (error) {
stateMessage(elements.sessionItems, error instanceof Error ? error.message : String(error), "error");
addEvent("session.error", { message: String(error) });
}
}

async function invokeSync(payload) {
const response = await fetch("/api/invocations", {
method: "POST",
Expand Down Expand Up @@ -1096,16 +1078,7 @@ async function sendText(text, mode = state.mode) {
setBusy(true, mode === "background" ? "Starting background run" : mode === "streaming" ? "Streaming" : "Running");
try {
await dispatch({ messages: [{ role: "user", content }] }, mode);
const items = [{ role: "user", content, transport: mode, instance_id: state.instanceId }];
if (state.lastAssistantText) {
items.push({
role: "assistant",
content: state.lastAssistantText,
transport: mode,
instance_id: state.instanceId,
});
}
await recordSessionItems(items);
await refreshSessionView();
return state.lastAssistantText;
} catch (error) {
finishDraft();
Expand All @@ -1130,18 +1103,7 @@ async function resume(decision) {
setBusy(true, "Resuming");
try {
await dispatch(payload, "streaming");
const items = [
{ role: "human_decision", content: decision, instance_id: state.instanceId },
];
if (state.lastAssistantText) {
items.push({
role: "assistant",
content: state.lastAssistantText,
transport: "streaming",
instance_id: state.instanceId,
});
}
await recordSessionItems(items);
await refreshSessionView();
} catch (error) {
appendError(error);
} finally {
Expand Down
Loading