feat(FN-2465): stabilize agent log handling and add OpenClaw adapter
- Make agent log ordering deterministic in core store and dev-server retrieval paths - Stabilize AgentLogViewer row identity and hook ordering behavior to prevent regressions - Add targeted tests for store ordering, useAgentLogs hook behavior, and AgentLogViewer rendering - Introduce executable OpenClaw runtime adapter modules, types, and updated plugin packaging/docs
This commit is contained in:
@@ -4667,7 +4667,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
const rows = this.db.prepare(`
|
||||
SELECT * FROM agentLogEntries
|
||||
WHERE taskId = ?
|
||||
ORDER BY timestamp DESC
|
||||
ORDER BY timestamp DESC, id DESC
|
||||
LIMIT ?
|
||||
`).all(taskId, readCount) as Array<Record<string, unknown>>;
|
||||
const entries = rows.map((row) => this.mapAgentLogRow(row)).reverse();
|
||||
@@ -4680,7 +4680,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
const rows = this.db.prepare(`
|
||||
SELECT * FROM agentLogEntries
|
||||
WHERE taskId = ?
|
||||
ORDER BY timestamp ASC
|
||||
ORDER BY timestamp ASC, id ASC
|
||||
`).all(taskId) as Array<Record<string, unknown>>;
|
||||
const entries = rows.map((row) => this.mapAgentLogRow(row));
|
||||
if (offset > 0) {
|
||||
@@ -4719,7 +4719,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
const rows = this.db.prepare(`
|
||||
SELECT * FROM agentLogEntries
|
||||
WHERE taskId = ? AND timestamp >= ? AND timestamp <= ?
|
||||
ORDER BY timestamp ASC
|
||||
ORDER BY timestamp ASC, id ASC
|
||||
`).all(taskId, startIso, end) as Array<Record<string, unknown>>;
|
||||
return rows.map((row) => this.mapAgentLogRow(row));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user