Skip to content

fix: salvage partial L3 abstraction drafts#2054

Closed
RerankerGuo wants to merge 1 commit into
MemTensor:mainfrom
RerankerGuo:fix/salvage-l3-abstraction-drafts
Closed

fix: salvage partial L3 abstraction drafts#2054
RerankerGuo wants to merge 1 commit into
MemTensor:mainfrom
RerankerGuo:fix/salvage-l3-abstraction-drafts

Conversation

@RerankerGuo

Copy link
Copy Markdown

Description

Fixes #1668.

L3 abstraction now normalizes partially structured provider output before deciding whether to reject it. Salvageable drafts can use string or object entries for environment, inference, and constraints; common label, description, and evidence aliases are normalized; tag strings are split into arrays; and a missing title can be derived from recovered content.

Drafts that remain completely empty after normalization still fail with LLM_OUTPUT_MALFORMED, so unusable output is not persisted.

Related Issue (Required): Fixes #1668

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • cd apps/memos-local-plugin && npm test -- --run tests/unit/memory/l3/abstract.test.ts passed with 8 tests.
  • cd apps/memos-local-plugin && npm run lint passed.
  • make format could not run in this environment because poetry is not installed: make: poetry: Command not found.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation, if applicable
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@RerankerGuo RerankerGuo marked this pull request as ready for review July 8, 2026 05:42
@RerankerGuo

Copy link
Copy Markdown
Author

This draft is now Ready for review. Cloud test-engine rerun on dev-v2.0.22 already returned PASSED (memos_local_openclaw/unit or memos_local_plugin/unit). Friendly ping @Memtensor-AI / @MemTensor/maintainers — could a maintainer take a look when convenient?

@RerankerGuo

Copy link
Copy Markdown
Author

Hi @Memtensor-AI / @CarltonXiang — friendly ping on this draft.

Quick observation: this PR still has base branch main, but MemTensor/MemOS's current merge flow is into dev-v2.0.22 (every recent PR #2065 / #2058 / #2047 / #2046 / #2042 / #2034 / #2033 / #2026 lands on dev-v2.0.22). The bot already retargeted the base SHA for testing and cloud test-engine returned PASSED against dev-v2.0.22 on every rerun.

Could a maintainer please change the base branch from maindev-v2.0.22 (Edit → base branch dropdown) so this can enter the normal merge queue? The head commit is a single focused change and does not depend on any main-only commits.

Thanks!

@RerankerGuo

Copy link
Copy Markdown
Author

Hi @syzsunshine219 — looks like you've merged 35 of the last 50 PRs on this repo. Friendly ping on this one.

This draft (and the other 21 OPEN PRs I have here) is small, single-commit, has cloud test-engine PASSED, and is fully mergeable. The only thing blocking it is that the base branch dropdown still says main — every recent merge (e.g. #2038, #2037, #2034, #2032) landed on dev-v2.0.22.

When you have a moment, would you mind one of:

  1. Flipping the base branch on this PR from maindev-v2.0.22 (Edit → base branch dropdown), or
  2. Telling me which base branch you'd prefer and I'll re-push accordingly.

Both fix and feature PRs in this batch are independent — each can be reviewed/merged on its own. Happy to rebase / split / drop any that don't fit the direction.

Thanks!

@RerankerGuo RerankerGuo force-pushed the fix/salvage-l3-abstraction-drafts branch from 7ffd53c to 3da7f5f Compare July 8, 2026 07:45
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. This PR addresses the same issue as #1672 / #1668.

We usually continue with the earlier active PR when the implementations are comparable. #1672 was opened first and already covers the L3 abstraction salvage behavior in more detail, including the common malformed wire shapes and additional tests, so we are going to continue the review there.

The smaller patch surface and local test/lint notes in this PR are still useful, and we will carry those points into the #1672 review if needed.

Closing this PR as a duplicate implementation to keep the review queue focused. Thanks again for the work here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(memos-local-plugin): L3 abstraction rejects salvageable structured outputs too aggressively

2 participants