Skip to content

feat: 支持格式化输出#203

Merged
MagicalAstrogy merged 2 commits into
betafrom
mag/schema_support
Apr 25, 2026
Merged

feat: 支持格式化输出#203
MagicalAstrogy merged 2 commits into
betafrom
mag/schema_support

Conversation

@MagicalAstrogy
Copy link
Copy Markdown
Owner

也就是模型里面的 json_schema/response_format.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 25, 2026

🔍 PR Test Report

🧪 Test Results

✅ All tests passed!

Type Passed Failed Total
Test Suites 16 0 16
Tests 383 0 383

📊 Coverage Report

Metric Coverage Details
Lines 58.97% 1088/1845
Statements 58.64% 1112/1896
Functions 53.96% 109/202
Branches 59.39% 572/963

Coverage Thresholds

  • ✅ Lines: 58.97% (Passed, threshold: 50%)
  • ✅ Statements: 58.64% (Passed, threshold: 50%)
  • ✅ Functions: 53.96% (Passed, threshold: 50%)
  • ✅ Branches: 59.39% (Passed, threshold: 50%)

Generated at 2026-04-25T13:34:20.574Z

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: 929800159a

ℹ️ 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".

Comment thread src/store.ts
...data.额外模型解析配置,
破限方案: data.额外模型解析配置.发送预设 ? '使用当前预设' : '使用内置破限',
启用自动请求: data.自动触发额外模型解析,
应答格式: data.额外模型解析配置.使用函数调用 ? '工具调用' : '聊天消息',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve explicit response format in old-settings migration

This migration path always derives 应答格式 from 使用函数调用, so an explicit saved format can be lost when a config still matches the old schema branch (the union parses old settings first and strips unknown keys). In practice, users with mixed legacy/new settings can be silently switched away from '格式化输出', which changes runtime behavior without user intent; prefer carrying through an existing 应答格式 value before falling back to the legacy boolean.

Useful? React with 👍 / 👎.

}

function cleanStructuredPayload(input: string): string {
return input.replaceAll(/```.*/gm, '').trim();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep inline fenced JSON when sanitizing formatted output

The sanitizer removes any line containing triple backticks via /```.*/gm, which deletes the entire payload for single-line fenced responses like json { ... } ; extractFromFormattedOutput then fails and the update round is treated as invalid even though the JSON itself is valid. This causes avoidable parse failures in formatted-output mode and should strip fence markers without dropping same-line JSON content.

Useful? React with 👍 / 👎.

@MagicalAstrogy
Copy link
Copy Markdown
Owner Author

LGFM

@MagicalAstrogy MagicalAstrogy merged commit a080ea2 into beta Apr 25, 2026
1 check passed
@StageDog StageDog deleted the mag/schema_support branch May 4, 2026 15:14
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.

1 participant