@ramarivera/coding-agent-langfuse 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backfill.js +4 -5
- package/package.json +1 -1
package/dist/backfill.js
CHANGED
|
@@ -522,8 +522,8 @@ function opencodeEvents(homeDir, rowLimit) {
|
|
|
522
522
|
let sessions = [];
|
|
523
523
|
let messages = [];
|
|
524
524
|
try {
|
|
525
|
-
sessions = sqliteJsonByRowid(db, "session", "id, directory, time_created, time_updated, title, version, slug, project_id", undefined, rowLimit);
|
|
526
|
-
messages = sqliteJsonByRowid(db, "message", "id, session_id, time_created, time_updated, case when length(data) <= 1000000 then data else null end as data, length(data) <= 1000000 as __include", undefined, rowLimit);
|
|
525
|
+
sessions = sqliteJsonByRowid(db, "session", "id, directory, time_created, time_updated, title, version, slug, project_id", undefined, rowLimit, 5_000);
|
|
526
|
+
messages = sqliteJsonByRowid(db, "message", "id, session_id, time_created, time_updated, case when length(data) <= 1000000 then data else null end as data, length(data) <= 1000000 as __include", undefined, rowLimit, 500);
|
|
527
527
|
}
|
|
528
528
|
catch (error) {
|
|
529
529
|
console.error(`Skipping OpenCode history from ${db}: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -583,13 +583,12 @@ function opencodeEvents(homeDir, rowLimit) {
|
|
|
583
583
|
function sqliteJson(db, sql) {
|
|
584
584
|
const output = execFileSync("sqlite3", ["-readonly", "-json", db, sql], {
|
|
585
585
|
encoding: "utf8",
|
|
586
|
-
maxBuffer:
|
|
586
|
+
maxBuffer: 1024 * 1024 * 1024,
|
|
587
587
|
stdio: ["ignore", "pipe", "ignore"],
|
|
588
588
|
});
|
|
589
589
|
return JSON.parse(output || "[]");
|
|
590
590
|
}
|
|
591
|
-
function sqliteJsonByRowid(db, table, columns, whereClause, rowLimit) {
|
|
592
|
-
const pageSize = 5_000;
|
|
591
|
+
function sqliteJsonByRowid(db, table, columns, whereClause, rowLimit, pageSize) {
|
|
593
592
|
const rows = [];
|
|
594
593
|
let lastRowid = 0;
|
|
595
594
|
while (rowLimit === undefined || rows.length < rowLimit) {
|