Repository navigation
fix: deduplicate learning retries across tool invocations - #250
Conversation
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Tiny Sweeper reviewTiny Sweeper reviewed this change across 6 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below. State: Ready for maintainer review Review snapshot
Completeness: Complete What changedThe review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below. FeaturesNone identified with supported citations. TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
e2e
Evidence and run details
|
There was a problem hiding this comment.
tinysweeper found nothing blocking. Approving.
$0.0037 · 64,809 in / 3,153 out · 4,459 cached (7%) · gpt-5.6-luna, glm-5.3-flash
critique: $0.0027 · 35,456 in / 1,027 out · 4,139 cached (12%) · gpt-5.6-luna
security: $0.0009 · 10,007 in / 344 out · 0 cached (0%) · gpt-5.6-luna
tests: $0.0000 · 4,978 in / 145 out · 64 cached (1%) · glm-5.3-flash
description: $0.0000 · 4,517 in / 65 out · 64 cached (1%) · glm-5.3-flash
e2e: $0.0001 · 6,339 in / 716 out · 64 cached (1%) · glm-5.3-flash
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cefb3e9b2e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if let Some(call) = identity.meta_mut().tool_call.as_mut() { | ||
| call.id = None; |
There was a problem hiding this comment.
Preserve IDs for existing tool-call items
When upgrading a store containing an item with meta.tool_call.id, that item remains labeled with the previous fingerprint, which included the ID, while this code now computes a different fingerprint after clearing it. CortexEngine::store_items looks up only the newly computed ID, so re-storing the same learning after an upgrade writes a duplicate instead of returning the existing record as a replay; reconstructed items also no longer satisfy the documented id == item.fingerprint() invariant. Add a compatibility lookup or migration for the legacy fingerprint before changing this public identity behavior.
AGENTS.md reference: AGENTS.md:L248-L249
Useful? React with 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Repeated
memory.learncalls with identical content received new item IDs because the provider-assigned invocation ID participated inStoreItem::fingerprint. In a real chat this produced duplicate learnings and a save/delete cycle instead of an answer.Exclude only
meta.tool_call.idfrom identity while retaining it in stored provenance. Namespace, content, confidence and tool name still distinguish items; conversation tool calls remain part of transcript identity. Existing records are preserved; this changes fingerprints for future writes carrying an invocation ID and does not migrate historical duplicates.Validation: the regression failed against the original fingerprint and passes after the change;
cargo test -p tinymemory-api --all-featurespasses (94 unit tests, 6 integration tests, 3 doctests);cargo clippy -p tinymemory-api --all-features --all-targets -- -D warningspasses.Summary by CodeRabbit