Skip to content

Conversation

@xbghc
Copy link
Owner

@xbghc xbghc commented Sep 17, 2025

变更内容

  • (简述本次改动)

文档同步检查

  • 我已同步更新文档(docs/*)或此改动不影响对外接口
    • 影响 gitcode 库 → docs/gitcode
    • 影响 CLI → docs/cli

自检清单

  • 通过 pnpm build
  • 通过 pnpm lint / pnpm format
  • 如需,附上截图或输出示例

@chatgpt-codex-connector
Copy link

Codex Review: Here are some suggestions.

https://github.com/xbghc/gitany-actions/blob/b7230789e84946a8016245e5417edfd0d9862b92/packages/core/src/issue/watcher.ts#L198-L207
[P1] Preserve old issue watcher baseline on upgrade

The new issue watcher only restores comment state from the lastCommentByIssue array written by this commit. Existing installations persist lastCommentIdByIssue with numeric IDs. After upgrading, loadPersistedStateSync ignores the old field and returns an empty map, so the first poll treats every historical comment as unseen and re-fires onComment for all of them. That can spam AI replies or other automations. The loader should accept both the new and legacy keys (converting the stored last ID into a singleton set) so upgrades don’t retrigger past comments.


https://github.com/xbghc/gitany-actions/blob/b7230789e84946a8016245e5417edfd0d9862b92/packages/core/src/pr/watcher.ts#L242-L255
[P1] Migrate persisted PR watcher state

Similarly, the PR watcher now reads lastCommentIdsByPr but previous releases persisted lastCommentIdByPr. Ignoring the legacy key causes the state to be empty when upgrading, so the next poll reports all existing PR comments as new. That can double-send replies or re-run expensive processing. loadPersistedStateSync should fall back to lastCommentIdByPr and convert the stored max ID into a set, ensuring older cache files remain valid.


Reply with @codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

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