Skip to content

fix: cannot not show embed ID in listMemories - #17211

Merged
JinHai-CN merged 3 commits into
infiniflow:mainfrom
Haruko386:master
Jul 22, 2026
Merged

JinHai-CN merged 3 commits into
infiniflow:mainfrom
Haruko386:master

Conversation

@Haruko386

Copy link
Copy Markdown
Member

Summary

As title

@Haruko386 Haruko386 added the 🐞 bug Something isn't working, pull request that fix bug. label Jul 22, 2026
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 22, 2026
@Haruko386
Haruko386 marked this pull request as draft July 22, 2026 03:13
@Haruko386
Haruko386 marked this pull request as ready for review July 22, 2026 03:13
@Haruko386 Haruko386 added the ci Continue Integration label Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

ListMemories now resolves LLM and embedding model IDs to model@instance@provider display names, reuses results through a per-request cache, and falls back to the original ID when resolution is not possible.

Changes

Memory display resolution

Layer / File(s) Summary
Resolve and cache model display names
internal/service/memory.go
ListMemories resolves LLM and embedding identifiers through tenant model, instance, and provider metadata, caches repeated lookups per request, and preserves empty, preformatted, or unresolved IDs.
Validate tenant model display output
internal/service/memory_message_test.go
Test database migrations include tenant model metadata tables, with tests covering resolved display names and raw-ID fallbacks.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: hz-186

Poem

I’m a bunny with names in my nest,
Caching each model makes hops faster and best.
Model, instance, provider in a row,
If lookup fails, the old name will show.
Wiggle-eared listings now neatly flow!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is too generic and does not meaningfully describe the change or its background. Replace "As title" with a brief Summary explaining the issue, the fix, and any relevant context.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is awkwardly phrased, but it still points to the listMemories embed-ID display fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/service/memory.go`:
- Around line 1443-1444: Update the model display-name resolution in the
listMemories response mapping to pass TenantLLMID and TenantEmbdID to
resolveTenantModelDisplayName for DAO lookups, while retaining LLMID and EmbdID
as the fallback display values. Adjust the helper signature or call sites as
needed so both tenant and raw IDs are available.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e694126c-9a03-4e5f-a924-a19b9b757433

📥 Commits

Reviewing files that changed from the base of the PR and between b175ed5 and 10ff05d.

📒 Files selected for processing (1)
  • internal/service/memory.go

Comment thread internal/service/memory.go Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
internal/service/memory_message_test.go (1)

172-206: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover unresolved tenant model IDs too.

This only exercises the early empty-ID fallback. Add a case with non-empty, unknown TenantLLMID/TenantEmbdID values and assert the raw IDs are returned, so DAO lookup failures remain protected. As per coding guidelines, preserve valid behavior with focused tests.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/service/memory_message_test.go` around lines 172 - 206, Extend
TestListMemoriesFallsBackToRawModelIDWithoutTenantModelID with a focused case
using non-empty but unresolved TenantLLMID and TenantEmbdID values, then assert
ListMemories returns the raw LLMID and EmbdID. Preserve the existing empty-ID
fallback assertions and valid model-resolution behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@internal/service/memory_message_test.go`:
- Around line 172-206: Extend
TestListMemoriesFallsBackToRawModelIDWithoutTenantModelID with a focused case
using non-empty but unresolved TenantLLMID and TenantEmbdID values, then assert
ListMemories returns the raw LLMID and EmbdID. Preserve the existing empty-ID
fallback assertions and valid model-resolution behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6693ea26-a468-42dc-b555-9f6bc92f416f

📥 Commits

Reviewing files that changed from the base of the PR and between 10ff05d and 1c717f9.

📒 Files selected for processing (2)
  • internal/service/memory.go
  • internal/service/memory_message_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/service/memory.go

@JinHai-CN
JinHai-CN merged commit 48b63ab into infiniflow:main Jul 22, 2026
3 checks passed
@Haruko386
Haruko386 deleted the master branch July 23, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants