Skip to content

🔧 refactor: simplify response ID to use topicId directly#13410

Merged
arvinxx merged 1 commit intocanaryfrom
fix/response-id-simplify
Mar 30, 2026
Merged

🔧 refactor: simplify response ID to use topicId directly#13410
arvinxx merged 1 commit intocanaryfrom
fix/response-id-simplify

Conversation

@arvinxx
Copy link
Copy Markdown
Member

@arvinxx arvinxx commented Mar 30, 2026

Summary

  • Simplify response ID format: Remove resp_ prefix and random suffix encoding. Response ID now equals topicId directly.
  • Simplify extraction: extractTopicIdFromResponseId now returns the ID as-is instead of parsing encoded format.
  • Update item ID generation: Replace responseId.slice(5) with responseId for sub-item IDs (fc_, msg_, fco_ prefixes).

This prepares for client-side function tool execution (LOBE-6536) where previous_response_id equals topicId for conversation continuity.

Fixes LOBE-6536

Test plan

  • Verify multi-turn conversations work with new response ID format
  • Verify previous_response_id correctly resolves to topicId
  • Verify streaming events contain correct item IDs

🤖 Generated with Claude Code

Remove resp_ prefix and random suffix encoding from response IDs.
Response ID now equals topicId directly, simplifying multi-turn
conversation support via previous_response_id.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Mar 30, 2026 1:49pm

Request Review

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine

@lobehubbot
Copy link
Copy Markdown
Member

@nekomeowww - This is a backend API refactor in packages/openapi/src/services/responses.service.ts that simplifies the response ID format. Please take a look.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4053489ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.97%. Comparing base (53d0ee9) to head (c405348).
⚠️ Report is 3 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff            @@
##           canary   #13410     +/-   ##
=========================================
  Coverage   66.97%   66.97%             
=========================================
  Files        1930     1930             
  Lines      156495   156495             
  Branches    18761    15836   -2925     
=========================================
+ Hits       104816   104818      +2     
+ Misses      51559    51557      -2     
  Partials      120      120             
Flag Coverage Δ
app 58.76% <ø> (+<0.01%) ⬆️
database 96.66% <ø> (ø)
packages/agent-runtime 89.11% <ø> (ø)
packages/context-engine 86.51% <ø> (ø)
packages/conversation-flow 92.36% <ø> (ø)
packages/file-loaders 87.02% <ø> (ø)
packages/memory-user-memory 66.68% <ø> (ø)
packages/model-bank 99.85% <ø> (ø)
packages/model-runtime 84.48% <ø> (ø)
packages/prompts 67.76% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 90.41% <ø> (ø)
packages/web-crawler 88.82% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 67.08% <ø> (ø)
Services 49.21% <ø> (ø)
Server 67.44% <ø> (+<0.01%) ⬆️
Libs 51.03% <ø> (ø)
Utils 89.08% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arvinxx arvinxx merged commit 296c6f3 into canary Mar 30, 2026
34 of 35 checks passed
@arvinxx arvinxx deleted the fix/response-id-simplify branch March 30, 2026 13:31
@lobehubbot
Copy link
Copy Markdown
Member

❤️ Great PR @arvinxx ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.

cy948 pushed a commit to cy948/lobe-chat that referenced this pull request Mar 31, 2026
Remove resp_ prefix and random suffix encoding from response IDs.
Response ID now equals topicId directly, simplifying multi-turn
conversation support via previous_response_id.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants