You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by wy...@apache.org on 2026/10/18 03:49:14 UTC

(maka) branch rust-preview updated: perf(event-log): filter archive calls before materialization

This is an automated email from the ASF dual-hosted git repository.

M4n5ter pushed a commit to branch rust-preview
in repository https://gitbox.apache.org/repos/asf/maka.git


The following commit(s) were added to refs/heads/rust-preview by this push:
     new 9c7ee0c268 perf(event-log): filter archive calls before materialization
9c7ee0c268 is described below

commit 9c7ee0c2688f1f065aa0aa126ce6383ffe57d81c
Author: Wang <m4...@gmail.com>
AuthorDate: Sun Oct 18 11:49:08 2026 +0800

    perf(event-log): filter archive calls before materialization
    
    Generated-by: Codex
---
 platform/event-log/src/archive/target.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/platform/event-log/src/archive/target.rs b/platform/event-log/src/archive/target.rs
index a134a80a2c..7ae4f0df0e 100644
--- a/platform/event-log/src/archive/target.rs
+++ b/platform/event-log/src/archive/target.rs
@@ -54,6 +54,8 @@ pub(super) async fn read(
     session: &str,
     id: &str,
 ) -> Result<Option<Target>, StoreError> {
+    // Filter before SQLite materializes the compound acceptance query, so only
+    // matching calls carry their full inputs into its temporary rows.
     let row = sqlx::query(concat!("WITH ", crate::model_items::accepted_calls!(),
         " SELECT t.sequence, t.event_id, t.operation_id, json_extract(t.event_json, '$.invocation') AS ti,
          json_extract(d.event_json, '$.invocation') AS di, json_extract(d.event_json, '$.fact.call') AS call,
@@ -82,6 +84,10 @@ pub(super) async fn read(
                FROM runtime_events t JOIN runtime_events d ON d.operation_id=t.operation_id
                  AND d.invocation_id=t.invocation_id AND d.kind='tool_dispatched'
                WHERE t.event_id=?1)
+             AND json_extract(call,'$.id')=(SELECT json_extract(d.event_json,'$.fact.call.tool_call_id')
+               FROM runtime_events t JOIN runtime_events d ON d.operation_id=t.operation_id
+                 AND d.invocation_id=t.invocation_id AND d.kind='tool_dispatched'
+               WHERE t.event_id=?1)
          ) c ON c.invocation_id = t.invocation_id
            AND c.step_id = json_extract(d.event_json, '$.fact.call.origin.step_id')
            AND json_extract(c.call,'$.id') = json_extract(d.event_json,'$.fact.call.tool_call_id')


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org