GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use autoCaptureLanguage to analyze user profile by berteauxjb · Pull Request #317 · tickernelz/opencode-mem

Conversation

@berteauxjb

@berteauxjb berteauxjb commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

The prompt for the user profile mentions that the model should detect the language of the user. In my case, the model detected Catalan even though my prompts were written in English. After further investigation, I realized that the setting autoCaptureLanguage was only used to generate memories, but not to generate the user profile.

This PR mirrors the implementation of the language selection already implemented for the memories, but for the user profile.

Disclaimer: the issue was investigated and fixed by Claude Sonnet 5.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@karaaslanz

karaaslanz commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

I traced the new resolveProfileLanguageName() call against the existing auto-capture path. There is one correctness gap in the "auto" case: auto-capture runs detectLanguage(userPrompt), but this PR runs detectLanguage(context). The profile context is not just user text — buildUserAnalysisContext() wraps the prompts in a fairly large English instruction scaffold (# User Profile Analysis, analysis guidelines, profile-size/category guidance, etc.) and may also include existing profile text. That can bias detection toward English, especially for short non-English prompts, so the original wrong-language symptom can still occur even though the config is now consulted.
I would keep the configured-language path as-is, but for auto detect from the actual recent-prompt corpus before it is wrapped in the analysis context (or pass that corpus separately into analyzeUserProfile). That also mirrors the existing auto-capture semantics more closely. A focused regression where short non-English prompts are surrounded by the current English scaffold would lock this down.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@berteauxjb

berteauxjb commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

I traced the new resolveProfileLanguageName() call against the existing auto-capture path. There is one correctness gap in the "auto" case: auto-capture runs detectLanguage(userPrompt), but this PR runs detectLanguage(context). The profile context is not just user text — buildUserAnalysisContext() wraps the prompts in a fairly large English instruction scaffold (# User Profile Analysis, analysis guidelines, profile-size/category guidance, etc.) and may also include existing profile text. That can bias detection toward English, especially for short non-English prompts, so the original wrong-language symptom can still occur even though the config is now consulted. I would keep the configured-language path as-is, but for auto detect from the actual recent-prompt corpus before it is wrapped in the analysis context (or pass that corpus separately into analyzeUserProfile). That also mirrors the existing auto-capture semantics more closely. A focused regression where short non-English prompts are surrounded by the current English scaffold would lock this down.

Thanks for the feedback! I updated the PR to:

  • only run the language analysis on the user prompts (without system context)
  • add a unit test to exercise the changes
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

karaaslanz
karaaslanz approved these changes Sep 28, 2026
View reviewed changes

@karaaslanz karaaslanz left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Re-checked the updated head after my earlier feedback. The language detection now runs against the actual user-prompt corpus rather than the English analysis scaffold, and the added regression coverage exercises that exact failure mode.

That addresses the correctness concern from my previous review scope. Looks good from this scope.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@karaaslanz karaaslanz mentioned this pull request Sep 28, 2026
[Maintainer Wanted] New Leadership Needed for opencode-mem #79
Closed
berteauxjb and others added 4 commits October 2, 2026 23:14
@berteauxjb @EyJunge1
Use autoCaptureLanguage to analyze user profile
3f32eab
User profile can randomly be generated in another language than what the
user uses. There's already a mechanism to select the language of the
memories, this commit uses it in the user profile as well.
@berteauxjb @EyJunge1
user-memory-learning: Detect language from user prompts
ebb2a89
Previous commit was detecting the language based on the user prompts
wrapped in the analysis context, which contains English instructions.
This could skew the language detection to English. This commit addresses
the issue by only analyzing the user prompts.
@berteauxjb @EyJunge1
Add unit test for language detection in user profile learning
2efb223
@EyJunge1
docs: note autoCaptureLanguage also applies to profile learning
79ce440
Keep the example config template in sync with CONFIG_TEMPLATE after rebasing onto main.
@EyJunge1
EyJunge1 force-pushed the fix/profile-language-config branch from 64a8791 to 79ce440 Compare October 2, 2026 21:14
@EyJunge1
EyJunge1 merged commit b0e5c28 into tickernelz:main Oct 2, 2026
6 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@EyJunge1 EyJunge1 mentioned this pull request Oct 2, 2026
chore(release): release v2.28.0 #361
Merged
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@karaaslanz karaaslanz karaaslanz approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@berteauxjb @karaaslanz @EyJunge1
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.