mirror of
https://github.com/morluto/rea.git
synced 2026-11-13 10:12:50 +00:00
fix(analysis): report call-edge truncation
This commit is contained in:
1 parent
24b3dc41df
commit
6039b92be7
2 files changed
+9
-2
No files matched your search
@@ -181,7 +181,11 @@ const recordEdge = (
|
||||
const targetAddress =
|
||||
input.direction === "forward" ? edge.relatedAddress : edge.address;
|
||||
const edgeKey = `${sourceAddress}\u0000${targetAddress}`;
|
||||
if (state.edges.has(edgeKey) || state.edges.size >= input.max_nodes) return;
|
||||
if (state.edges.has(edgeKey)) return;
|
||||
if (state.edges.size >= input.max_nodes) {
|
||||
state.residual.add("Call-path traversal reached the edge limit.");
|
||||
return;
|
||||
}
|
||||
state.edges.set(edgeKey, {
|
||||
source_address: sourceAddress,
|
||||
target_address: targetAddress,
|
||||
|
||||
@@ -318,7 +318,10 @@ describe("enhanced MCP tools", () => {
|
||||
nodes: [{ address: "0x1", depth: 0 }],
|
||||
frontier: ["0x2"],
|
||||
truncated: true,
|
||||
residual_unknowns: [expect.stringContaining("reached the node limit")],
|
||||
residual_unknowns: expect.arrayContaining([
|
||||
expect.stringContaining("reached the node limit"),
|
||||
expect.stringContaining("reached the edge limit"),
|
||||
]),
|
||||
limits: {
|
||||
max_nodes: 1,
|
||||
nodes_visited: 1,
|
||||
|
||||
Reference in new issue
Block a user