René's URL Explorer Experiment


Title: refactor: extract OpenAI message converter from SessionManager by Lellansin · Pull Request #140 · lessweb/deepcode-cli · GitHub

Open Graph Title: refactor: extract OpenAI message converter from SessionManager by Lellansin · Pull Request #140 · lessweb/deepcode-cli

X Title: refactor: extract OpenAI message converter from SessionManager by Lellansin · Pull Request #140 · lessweb/deepcode-cli

Description: 变更内容 创建 src/common/openai-message-converter.ts(277 行),将 OpenAI 消息转换逻辑从 SessionManager 中拆分为独立模块 OpenAIMessageConverter 提供 3 个公开 API: buildMessages(messages, thinkingEnabled, model) — 构建 OpenAI 消息数组 getTrailingPendingToolCallMessage(messages) — 获取尾部待执行 tool calls findToolFunction(toolCalls, toolCallId) — 供 appendToolMessages 查找 tool 函数 session.ts 从 2884 行缩减至 2644 行(净减少 240 行),仅保留编排逻辑 新增 src/tests/openai-message-converter.test.ts(20 个独立单测),覆盖内容处理、工具调用配对、compaction 过滤等场景 测试无依赖 SessionManager,纯数据进数据出 背景 SessionManager 承载了过多职责——消息格式转换(工具配对、thinking mode 注入、多模态过滤)与 LLM 编排、session 生命周期混在一起,导致: 类体积膨胀(2884 行) 转换逻辑无法独立测试(现有测试通过 (manager as any).buildOpenAIMessages() 访问) 后期切换模型提供商或优化转换策略需改动 SessionManager 本次抽取将 14 个 private 转换方法收敛到 OpenAIMessageConverter,SessionManager 通过构造函数注入 renderInitPrompt 回调解耦 /init 模板渲染,其余纯逻辑无外部依赖。

Open Graph Description: 变更内容 创建 src/common/openai-message-converter.ts(277 行),将 OpenAI 消息转换逻辑从 SessionManager 中拆分为独立模块 OpenAIMessageConverter 提供 3 个公开 API: buildMessages(messages, thinkingEnabled, model) — 构建 OpenAI 消息数...

X Description: 变更内容 创建 src/common/openai-message-converter.ts(277 行),将 OpenAI 消息转换逻辑从 SessionManager 中拆分为独立模块 OpenAIMessageConverter 提供 3 个公开 API: buildMessages(messages, thinkingEnabled, model) — 构建 OpenAI 消息数...

Opengraph URL: https://github.com/lessweb/deepcode-cli/pull/140

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:7c7151ec-963b-3bbc-1cfe-004817dc95b7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8CEA:1E79:16CBC2E:20BC43F:6A4D218E
html-safe-nonce9f3317786fd2f21c2a68f523bdd84bb86bb34a82eae652078182975ffc93a87b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Q0VBOjFFNzk6MTZDQkMyRToyMEJDNDNGOjZBNEQyMThFIiwidmlzaXRvcl9pZCI6IjIxODI3OTg3MjIwMjIwNTYzMzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacae97b078a6cef7084aa4bf29a46152362e859a7a58da9f8de475af0f6d5ecfdd
hovercard-subject-tagpull_request:3773611593
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/lessweb/deepcode-cli/pull/140/files
twitter:imagehttps://avatars.githubusercontent.com/u/2081487?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/2081487?s=400&v=4
og:image:alt变更内容 创建 src/common/openai-message-converter.ts(277 行),将 OpenAI 消息转换逻辑从 SessionManager 中拆分为独立模块 OpenAIMessageConverter 提供 3 个公开 API: buildMessages(messages, thinkingEnabled, model) — 构建 OpenAI 消息数...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git
octolytics-dimension-user_id118287711
octolytics-dimension-user_loginlessweb
octolytics-dimension-repository_id1223512305
octolytics-dimension-repository_nwolessweb/deepcode-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1223512305
octolytics-dimension-repository_network_root_nwolessweb/deepcode-cli
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release93f17a978ee60bc4668e1d7b90e6bd2d622261fd
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/lessweb/deepcode-cli/pull/140/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flessweb%2Fdeepcode-cli%2Fpull%2F140%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flessweb%2Fdeepcode-cli%2Fpull%2F140%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=lessweb%2Fdeepcode-cli
Reloadhttps://github.com/lessweb/deepcode-cli/pull/140/files
Reloadhttps://github.com/lessweb/deepcode-cli/pull/140/files
Reloadhttps://github.com/lessweb/deepcode-cli/pull/140/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/140/files
lessweb https://github.com/lessweb
deepcode-clihttps://github.com/lessweb/deepcode-cli
Notifications https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Fork 150 https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Star 1.7k https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Code https://github.com/lessweb/deepcode-cli
Issues 43 https://github.com/lessweb/deepcode-cli/issues
Pull requests 22 https://github.com/lessweb/deepcode-cli/pulls
Actions https://github.com/lessweb/deepcode-cli/actions
Projects https://github.com/lessweb/deepcode-cli/projects
Security and quality 0 https://github.com/lessweb/deepcode-cli/security
Insights https://github.com/lessweb/deepcode-cli/pulse
Code https://github.com/lessweb/deepcode-cli
Issues https://github.com/lessweb/deepcode-cli/issues
Pull requests https://github.com/lessweb/deepcode-cli/pulls
Actions https://github.com/lessweb/deepcode-cli/actions
Projects https://github.com/lessweb/deepcode-cli/projects
Security and quality https://github.com/lessweb/deepcode-cli/security
Insights https://github.com/lessweb/deepcode-cli/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Flessweb%2Fdeepcode-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli%2Fissues%2Fnew%2Fchoose
qorzjhttps://github.com/qorzj
lessweb:mainhttps://github.com/lessweb/deepcode-cli/tree/main
Lellansin:refactor/openai-message-converterhttps://github.com/Lellansin/deepcode-cli/tree/refactor/openai-message-converter
Conversation 0 https://github.com/lessweb/deepcode-cli/pull/140
Commits 3 https://github.com/lessweb/deepcode-cli/pull/140/commits
Checks 9 https://github.com/lessweb/deepcode-cli/pull/140/checks
Files changed https://github.com/lessweb/deepcode-cli/pull/140/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/140/files
refactor: extract OpenAI message converter from SessionManager https://github.com/lessweb/deepcode-cli/pull/140/files#top
Show all changes 3 commits https://github.com/lessweb/deepcode-cli/pull/140/files
d88fe1c refactor: extract OpenAI message converter from SessionManager Lellansin May 29, 2026 https://github.com/lessweb/deepcode-cli/pull/140/commits/d88fe1c79631f45b25a03deee295256e205ef141
cd433cd test: add unit tests for OpenAIMessageConverter Lellansin May 30, 2026 https://github.com/lessweb/deepcode-cli/pull/140/commits/cd433cd696c0f2aea07960dccc2c2dbad8e12190
9044b6c chore: resolve merge conflict with origin/main Lellansin Jun 2, 2026 https://github.com/lessweb/deepcode-cli/pull/140/commits/9044b6cf8f5c8e8a3862d6fa418acf99d86c3d52
Clear filters https://github.com/lessweb/deepcode-cli/pull/140/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/140/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/140/files
openai-message-converter.ts https://github.com/lessweb/deepcode-cli/pull/140/files#diff-1f1ca495f0dfc2d8563c75830a34ef1264f8fff20e107a661b6287c1084b421f
session.ts https://github.com/lessweb/deepcode-cli/pull/140/files#diff-96998a2148aa3d52ad3e80303d0ad88fc43a4afd08966b5330a5657021ae52bb
openai-message-converter.test.ts https://github.com/lessweb/deepcode-cli/pull/140/files#diff-1c89ae65e2369aaa82ed88598743acaad9cbb9883b4c5d7f5bcc2aca3cc107c5
src/common/openai-message-converter.tshttps://github.com/lessweb/deepcode-cli/pull/140/files#diff-1f1ca495f0dfc2d8563c75830a34ef1264f8fff20e107a661b6287c1084b421f
View file https://github.com/Lellansin/deepcode-cli/blob/9044b6cf8f5c8e8a3862d6fa418acf99d86c3d52/src/common/openai-message-converter.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/lessweb/deepcode-cli/pull/140/{{ revealButtonHref }}
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/140/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/140/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.