Skip to content

fix: log LLM error response bodies#2012

Open
RerankerGuo wants to merge 15 commits into
MemTensor:dev-v2.0.23from
RerankerGuo:fix/log-llm-error-response-body
Open

fix: log LLM error response bodies#2012
RerankerGuo wants to merge 15 commits into
MemTensor:dev-v2.0.23from
RerankerGuo:fix/log-llm-error-response-body

Conversation

@RerankerGuo

Copy link
Copy Markdown

Fixes #1775.

Summary

  • Include a truncated response body in LLM JSON non-2xx warning logs.
  • Add a matching warning log for non-2xx streaming LLM responses before throwing.
  • Keep the thrown MemosError details unchanged while making provider rejection details visible in logs.
  • Add regression tests for JSON and streaming non-ok response logging.

Validation

  • npm test -- --run tests/unit/llm/fetcher.test.ts
  • npm run lint
  • Attempted: make format; blocked because poetry is not installed in this environment.

@Memtensor-AI Memtensor-AI changed the base branch from main to dev-v2.0.22 July 1, 2026 13:14
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Automated Test Results: ENVIRONMENT FAILURE

Cloud test-engine rerun against dev-v2.0.22 did not produce a reliable code verdict because the cloud environment failed before executable test phases completed.

  • Run: tr-f415ef73-834 on cloud test-engine 10010
  • Raw verdict: fail_code_bug
  • Summary: Tests failed. Failed cases:

This should be retried after the cloud dependency cache is healthy; do not treat it as proof of a code bug.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Automated Test Results: ENVIRONMENT RETRY

The previous cloud run failed before executable test phases because dependency environment preparation did not complete. The shared memos-local-plugin dependency cache is now present on the cloud test-engine host, so this PR has been requeued.

  • Retry run: tr-73877358-8e7 on cloud test-engine 10010
  • Branch tested: refs/pull/2012/head

I will post the final pass/fail result when this retry completes.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Automated Test Results: PASSED

Cloud test-engine rerun against dev-v2.0.22 completed successfully.

  • Run: tr-73877358-8e7 on cloud test-engine 10010
  • memos_local_plugin/unit: 12 passed, 0 failed, 0 skipped

Manual code review is still required before merge.

@CarltonXiang CarltonXiang deleted the branch MemTensor:dev-v2.0.23 July 3, 2026 07:25
@syzsunshine219 syzsunshine219 reopened this Jul 3, 2026
@syzsunshine219 syzsunshine219 added the needs-audit Requires manual audit before merge label Jul 3, 2026
@syzsunshine219 syzsunshine219 changed the base branch from dev-v2.0.22 to main July 3, 2026 08:20
harvey_xiang and others added 5 commits July 3, 2026 16:34
## Description

Please include a summary of the change, the problem it solves, the
implementation approach, and relevant context. List any dependencies
required for this change.

Related Issue (Required):  Fixes #issue_number

## 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?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration

- [ ] 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](https://github.com/MemTensor/MemOS-Docs) (if applicable) |
我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档
issue/PR(如果适用)
- [ ] I have linked the issue to this PR (if applicable) | 我已将 issue
链接到此 PR(如果适用)
- [ ] I have mentioned the person who will review this PR | 我已提及将审查此 PR
的人

## Reviewer Checklist
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] Made sure Checks passed
- [ ] Tests have been provided
Translated an untranslated JSON `description` field in
`docs/cn/open_source/modules/dream.md` from English to Chinese.
@RerankerGuo RerankerGuo marked this pull request as ready for review July 8, 2026 05:43
@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/log-llm-error-response-body branch from e928f3a to 6d90109 Compare July 8, 2026 07:45
@Memtensor-AI Memtensor-AI changed the base branch from main to dev-v2.0.23 July 8, 2026 11:27
@Memtensor-AI Memtensor-AI added the area:plugin Plugin, adapter, bridge, or apps layer | 插件、适配器、桥接层或 apps 目录 label Jul 8, 2026
@Memtensor-AI Memtensor-AI requested a review from bittergreen July 8, 2026 11:43
@Memtensor-AI Memtensor-AI added the status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 label Jul 8, 2026
@Memtensor-AI

Memtensor-AI commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Routing this PR to @syzsunshine219 for review/follow-up.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

✅ Automated Test Results: PASSED

All tests passed (12/12 executed). memos_local_plugin/unit: 12/12. Duration: 3s [advisory, non-gating] AI-generated tests on branch test/auto-gen-3230000a8cad852c-20260708223451: 53/53 passed — these do NOT affect the PR verdict; review the branch manually.

Branch: fix/log-llm-error-response-body

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

Labels

area:plugin Plugin, adapter, bridge, or apps layer | 插件、适配器、桥接层或 apps 目录 needs-audit Requires manual audit before merge status:in-progress Someone or AI is working on it | 人工或 AI 正在处理

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LLM provider 400 errors from SiliconFlow + missing response body logging (memos-local-plugin)

6 participants