Skip to content

feat(openclaw): wire recall trace runtime#2568

Open
Mijamind719 wants to merge 1 commit into
codex/openclaw-recall-trace-corefrom
codex/openclaw-recall-trace-runtime
Open

feat(openclaw): wire recall trace runtime#2568
Mijamind719 wants to merge 1 commit into
codex/openclaw-recall-trace-corefrom
codex/openclaw-recall-trace-runtime

Conversation

@Mijamind719

Copy link
Copy Markdown
Collaborator

Summary

Stacked PR 3/5 extracted from #2386, based on #2567.

This wires the recall trace core into OpenClaw plugin runtime paths:

  • creates a RecallTraceRecorder when traceRecall is enabled
  • records trace entries for auto-recall, ov_search, memory_recall, and ov_archive_search
  • adds the ov_recall_trace tool and /ov-recall-trace command
  • adds ov_recall_trace to runtime/manifest tool contracts and the recall_trace tool group
  • adds focused tests for registration and ov_search trace querying

Intentionally not included in this slice:

  • Gateway HTTP recall trace routes
  • large documentation updates
  • setup/install flow changes
  • resource import enhancements

Validation

  • npm test -- --run tests/ut/tools.test.ts tests/ut/manifest-contracts.test.ts tests/ut/config.test.ts
  • npm run typecheck
  • npm test
  • npm run build

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

2386 - Fully compliant

Compliant requirements:

Recall trace wired for auto-recall, ov_search, memory_recall, ov_archive_search; ov_recall_trace tool/command added; tests updated

2567 - Fully compliant

Compliant requirements:

Recall trace core integrated into runtime

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🏅 Score: 90
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Missing targetUriInput in ov_search trace entries

When ov_search runs without an explicit input URI (searching resources and skills), the trace search entries do not include targetUriInput, unlike when an input URI is provided. This could cause inconsistency in trace queries or display.

  searches.push({
    resourceType: inferRecallResourceType(targetUri) ?? "resource",
    targetUriResolved: targetUri,
    limit,
    durationMs: Date.now() - started,
    total: found.total ?? items.length,
    results: items,
  });
  return found;
} catch (err) {
  searches.push({
    resourceType: inferRecallResourceType(targetUri) ?? "resource",
    targetUriResolved: targetUri,
    limit,
    durationMs: Date.now() - started,
    total: 0,
    results: [],
    error: err instanceof Error ? err.message : String(err),
  });
Missing targetUriInput in ov_archive_search trace entry

The archive search trace entry includes targetUriResolved but not targetUriInput. For consistency, consider adding targetUriInput set to the same value as targetUriResolved.

searches: [{
  resourceType: "archive",
  targetUriResolved: `viking://session/${ovSessionId}/archives`,
  limit: cfg.traceRecallMaxResultsPerSearch,
  durationMs: 0,
  total: result.matches?.length ?? 0,
  results: traceResults,
  archiveId,
  caseInsensitive: true,
}],

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant