GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(suggestions): 兼容 LLM 输出中字段/对象间的全角逗号 by longsizhuo · Pull Request #401 · InvolutionHell/involutionhell

Conversation

@longsizhuo

@longsizhuo longsizhuo commented Oct 2, 2026

Copy link
Copy Markdown
Member

问题

Vercel 运行时日志里 /api/suggestions 持续出现「解析建议 JSON 失败」(#399 部署后 10/02 仍复现)。GLM 返回的建议用 ”,“ 分隔字段:

{"title":"基础概念”,“label":"基础知识”,“action":"..."}

中文引号被替换后仍残留全角逗号 ,,JSON.parse 和逐对象兜底都失败,欢迎页建议直接为空。

修改

  • 解析逻辑从 app/api/suggestions/route.ts 抽到 lib/ai/parse-suggestions.ts(行为不变),新增两条归一化:"," → ","、},{ → },{。值内部的全角逗号不受影响。
  • tests/parse-suggestions.test.ts:用线上原始文本做用例;去掉新增归一化后该用例失败,加上后全部 96 个测试通过。eslint / prettier / tsc 均通过。

🤖 Generated with Claude Code

https://claude.ai/code/session_01A7it9BgUVs3SDYtb28PpC7


Generated by Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
fix(suggestions): 兼容 LLM 输出中字段/对象间的全角逗号
7a5dd06
GLM 生成的建议 JSON 偶尔用 `”,“` 分隔字段,替换中文引号后仍残留全角逗号,
JSON.parse 与逐对象兜底都失败,欢迎页建议为空。解析逻辑抽到
lib/ai/parse-suggestions.ts 并补单测(含线上原始文本)。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A7it9BgUVs3SDYtb28PpC7
@vercel

vercel Bot commented Oct 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

Project Deployment Actions Updated
involutionhell-github-io Ready Ready Preview Oct 2, 2026 7:10pm UTC
website-preview Ready Ready Preview Oct 2, 2026 7:10pm UTC
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot deployed to Preview – website-preview October 2, 2026 19:06
View deployment
@vercel
vercel Bot deployed to Preview – involutionhell-github-io October 2, 2026 19:10
View deployment

This branch was successfully deployed

2 active deployments
Preview – involutionhell-github-io — 7a5dd06b Deployed Oct 2, 2026 by vercel[bot]
View deployment
Preview – website-preview — 7a5dd06b Deployed Oct 2, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@longsizhuo @claude
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.