Skip to content

Fix #39: memos add 成功但立即 get/list 查不到;且不存在 memos list 子命令 - #40

Closed
Memtensor-AI wants to merge 0 commit into
MemTensor:mainfrom
Memtensor-AI:bugfix/autodev-39-20260826075659787
Closed

Fix #39: memos add 成功但立即 get/list 查不到;且不存在 memos list 子命令#40
Memtensor-AI wants to merge 0 commit into
MemTensor:mainfrom
Memtensor-AI:bugfix/autodev-39-20260826075659787

Conversation

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Description

Fixes issue #39 — the memos add / memos get race and the missing memos list command. memos add printed "memory added" while the server was still asynchronously extracting/storing, so a follow-up memos get frequently returned empty results. memos list was referenced in MemOS CLI.md and skill docs but never registered in main.py.

Fix: (1) Registered memos list as an alias of memos get (same callback, same options, same output). (2) Added --wait / --no-wait (default --wait) and --wait-timeout (default 30s) options to memos add; when a task_id is present in the add response and status is "running", the CLI now polls /get/status until the task reaches a terminal state or the timeout elapses. (3) Rewrote the add success formatter to surface task_id and reflect the true final state (Memory added on completed, "still processing" hint on timeout, "accepted; task_id=..." on --no-wait, Memory add failed on terminal failure). (4) Updated README.md and README-zh.md to document the new options and the list alias.

Verification: full unit-test suite passes (56 tests, +15 new in tests/test_memory_add_wait.py) covering task_id extraction, polling until completion, --no-wait skipping polling, timeout guard, typer wiring, list-alias registration, and all four output branches. Manual memos --help, memos add --help, and memos list --help output confirmed. The change is a strict superset of the old contract — responses without a task_id fall back to the original behaviour, so servers that don't return an async id are unaffected.

Related Issue (Required): Fixes #39

Type of change

Please delete options that are not relevant.

  • 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)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

Not run; documentation-only change.

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have created related documentation issue/PR in MemOS-Docs (if applicable)
  • I have linked the issue to this PR (if applicable)
  • I have mentioned the person who will review this PR

@lijicode please review this PR.

Reviewer Checklist

@Memtensor-AI Memtensor-AI added ai:generated Generated or modified by AI | 由 AI 生成或修改 area:docs 文档、示例 status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Aug 26, 2026
@Memtensor-AI
Memtensor-AI requested a review from lijicode August 26, 2026 09:02
@Memtensor-AI

Memtensor-AI commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 Open Code Review

Target: PR #40
Task: 7c766885a8156d71
Base: main
Head: bugfix/autodev-39-20260826075659787
Head SHA: 8efa86ab222e073b5d476c86bc75535373ba7b98

OpenCodeReview: Review skipped: no items were selected.

Generated by cloud-assistant via Open Code Review.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator Author

🔧 Open Code Review requested Agent fix

Open Code Review found 10 issue(s). I have resumed the development Agent to fix them.

  • Task: 7c766885a8156d71
  • Fix attempt: 1/2
  • Finding delta: 0 repeated / 10 new / 0 likely resolved

The Agent will push a new commit to this PR branch. OCR will recheck after the commit is pushed.

@Memtensor-AI
Memtensor-AI force-pushed the bugfix/autodev-39-20260826075659787 branch from 2a704dc to 8efa86a Compare August 26, 2026 09:18
@Memtensor-AI Memtensor-AI added area:core MOS 编排层 / 框架底座 / 跨模块问题 and removed area:docs 文档、示例 labels Aug 26, 2026
@Memtensor-AI

Copy link
Copy Markdown
Collaborator Author

🔧 Open Code Review Agent fix completed

The development Agent has pushed an OCR fix to this PR branch.

  • Task: 7c766885a8156d71
  • Fix attempt: 1/2
  • Branch: bugfix/autodev-39-20260826075659787
  • Commit: 3dd8deb5302b

Summary:

已针对 PR #40 完成 OCR 第 1 轮 10 条 finding 的最小修复并推送到同一分支。修复:poll 前置 deadline 检查 + 异常日志、duration_ms 排除 polling、output.py 悬空标点/死分支、测试补零超时/null/精确 poll 次数/命令注册 guard。57 个单元测试全绿。

Open Code Review will recheck this PR after the new commit is observed.

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

Labels

ai:generated Generated or modified by AI | 由 AI 生成或修改 area:core MOS 编排层 / 框架底座 / 跨模块问题 status:in-progress Someone or AI is working on it | 人工或 AI 正在处理

Projects

None yet

Development

Successfully merging this pull request may close these issues.

memos add 成功但立即 get/list 查不到;且不存在 memos list 子命令

1 participant