fix: align compaction cuts and native usage accounting
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* GET /api/activity — the dock's one poll: every running background
|
||||
* process, every view (chat, home, everywhere). Composition only — the
|
||||
* feed lives in server/observability.ts; cost folds client-side via
|
||||
* core/prices.ts. See that module's header for why /api/jobs stays
|
||||
* feed lives in server/observability.ts; costs are projected server-side
|
||||
* through Pi's catalog and public calculator. See that module's header for why /api/jobs stays
|
||||
* chat-scoped and untouched.
|
||||
*/
|
||||
import { activityFeed } from "@/src/server";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { compactionInFlight, deleteChatSession, getChat, isTurnRunning, sessionCoverage, stores, type ChatDeleteMode } from "@/src/server";
|
||||
import { compactionInFlight, deleteChatSession, getChat, isTurnRunning, sessionCoverage, sessionCost, stores, type ChatDeleteMode } from "@/src/server";
|
||||
|
||||
export async function GET(_req: Request, { params }: { params: Promise<{ id: string }> }) {
|
||||
const { id } = await params;
|
||||
@@ -17,6 +17,7 @@ export async function GET(_req: Request, { params }: { params: Promise<{ id: str
|
||||
return Response.json({
|
||||
...chat,
|
||||
messages: chat.messages,
|
||||
pricing: sessionCost(chat),
|
||||
turnInFlight: isTurnRunning(id),
|
||||
compacting: compactionInFlight(id),
|
||||
coverage: sessionCoverage(id),
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* three usage channels (chat extraction runs, notes-source runs,
|
||||
* cluster-naming runs). Thin transport over src/server's graphCosts();
|
||||
* the fold itself is pure core (core/cost-summary.ts). Dollars are
|
||||
* inferred from PRICES at read time — never stored, so a price sync
|
||||
* inferred from Pi's catalog/calculator at read time — never stored, so a catalog update
|
||||
* re-prices the whole history for free.
|
||||
*
|
||||
* Scope (user-decided): the graph pipeline ONLY — teaching turns and
|
||||
|
||||
Reference in New Issue
Block a user