fix: ChatGPT 会话回合检测增加 fallback 选择器#23
Conversation
Automated ReviewLGTM from automated reviewer. Please still verify both ChatGPT and Claude manually before merge. Checklist
Findings
Verdict: |
|
@codex pls review this |
There was a problem hiding this comment.
💡 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".
| const roleAttr = turn.getAttribute('data-turn') || turn.getAttribute('data-message-author-role') || ''; | ||
| const role = /^user$/i.test(roleAttr) ? 'user' : 'assistant'; |
There was a problem hiding this comment.
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 👍 / 👎.
| const alreadyPinged = comments.some(c => (c.body || '').includes(pingText)); | ||
| if (alreadyPinged) { | ||
| core.info('Codex already pinged on this PR, skip duplicate comment.'); | ||
| return; |
There was a problem hiding this comment.
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 👍 / 👎.
|
@codex based on current diff, do you see any critical issues? Please answer with "No critical issues found" or list issues. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex do you see any critical issues of a2f756f? Please answer with "No critical issues found" or list issues. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex Please review this PR. If you find no critical issues, reply with "LGTM". If you find critical issues, describe them clearly. |
Automated ReviewLGTM from automated reviewer. Please still verify both ChatGPT and Claude manually before merge. Checklist
Findings
Verdict: |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
背景
修复 issue #22 中
no_turns_detected的自动探测问题。变更
[data-testid='conversation-turn']、[data-message-author-role])readChatGPTTurns在主选择器无结果时启用 fallback 候选读取selectors.json版本到0.3.1并同步新增选择器说明
Closes #22