Skip to content

fix: ChatGPT 会话回合检测增加 fallback 选择器#23

Merged
FuugaMo merged 5 commits into
masterfrom
auto-fix/issue-22-chatgpt-turn-fallback
Mar 15, 2026
Merged

fix: ChatGPT 会话回合检测增加 fallback 选择器#23
FuugaMo merged 5 commits into
masterfrom
auto-fix/issue-22-chatgpt-turn-fallback

Conversation

@NogaUwU
Copy link
Copy Markdown
Collaborator

@NogaUwU NogaUwU commented Mar 14, 2026

背景

修复 issue #22no_turns_detected 的自动探测问题。

变更

  • 为 ChatGPT 增加更宽松的回合选择器([data-testid='conversation-turn'][data-message-author-role]
  • readChatGPTTurns 在主选择器无结果时启用 fallback 候选读取
  • 更新 selectors.json 版本到 0.3.1 并同步新增选择器

说明

  • 保持最小改动,不影响 Claude 路径
  • 分支导航逻辑不变,仅增强 turn 检出鲁棒性

Closes #22

@github-actions
Copy link
Copy Markdown

review
node scripts/review-pr.js

Automated Review

LGTM from automated reviewer. Please still verify both ChatGPT and Claude manually before merge.

Checklist

  • selectors.json touched: yes
  • content.js touched: yes
  • sidepanel/viewer touched: no

Findings

  • No structural findings from the lightweight reviewer.

Verdict: lgtm

@FuugaMo
Copy link
Copy Markdown
Owner

FuugaMo commented Mar 15, 2026

@codex pls review this

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: 75971f6d0f

ℹ️ 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 content.js
Comment on lines +577 to +578
const roleAttr = turn.getAttribute('data-turn') || turn.getAttribute('data-message-author-role') || '';
const role = /^user$/i.test(roleAttr) ? 'user' : 'assistant';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Resolve fallback turn role before defaulting to assistant

In readChatGPTTurns, fallback candidates can be container elements ([data-testid='conversation-turn'] or main article) where the author role is stored on a nested node, not on the container itself. Because roleAttr is read only from turn, missing attributes are forced to assistant, which misclassifies user turns and breaks path/tree accuracy on the layouts this fallback is intended to recover.

Useful? React with 👍 / 👎.

Comment on lines +27 to +30
const alreadyPinged = comments.some(c => (c.body || '').includes(pingText));
if (alreadyPinged) {
core.info('Codex already pinged on this PR, skip duplicate comment.');
return;
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 Allow synchronize events to post a new Codex ping

The de-dup check returns as soon as any historical comment contains pingText, so once one ping exists, all future synchronize runs skip createComment. That makes the newly added synchronize trigger effectively inert for updated commits, because no fresh review request is posted after subsequent pushes.

Useful? React with 👍 / 👎.

@FuugaMo
Copy link
Copy Markdown
Owner

FuugaMo commented Mar 15, 2026

@codex based on current diff, do you see any critical issues? Please answer with "No critical issues found" or list issues.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

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

@FuugaMo
Copy link
Copy Markdown
Owner

FuugaMo commented Mar 15, 2026

@codex do you see any critical issues of a2f756f? Please answer with "No critical issues found" or list issues.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

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

@FuugaMo
Copy link
Copy Markdown
Owner

FuugaMo commented Mar 15, 2026

@codex Please review this PR. If you find no critical issues, reply with "LGTM". If you find critical issues, describe them clearly.

@FuugaMo FuugaMo merged commit 3b36a92 into master Mar 15, 2026
2 checks passed
@github-actions
Copy link
Copy Markdown

review
node scripts/review-pr.js

Automated Review

LGTM from automated reviewer. Please still verify both ChatGPT and Claude manually before merge.

Checklist

  • selectors.json touched: yes
  • content.js touched: yes
  • sidepanel/viewer touched: no

Findings

  • No structural findings from the lightweight reviewer.

Verdict: lgtm

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

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

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AUTO] · chatgpt · no_turns_detected · turns, turnRoleAttr, messageIdAttr, branchCounter, branchPrev, branchNext

3 participants