Skip to content

feat: 增加卸载超时、加载器诊断与插件状态快照 - #1

Merged
residua1 merged 1 commit into
mainfrom
feat/1x-additive-apis
Oct 22, 2026
Merged

residua1 merged 1 commit into
mainfrom
feat/1x-additive-apis

Conversation

@residua1

Copy link
Copy Markdown
Contributor

改动

  • PluginManagerOptions.UnloadVerificationTimeout:默认 30 秒,超时返回失败,插件留在待回收,下一次卸载复用同一个验证任务。
  • 接入 IPluginLoaderDiagnostics:在 CanLoad 之后、Load 之前收集问题并并入加载报告。
  • 公开只读状态快照:PluginState、PluginInfo、Plugins、TryGetPlugin,不暴露 PluginHandle 或内部槽位。
  • 现有构造函数保持原签名,新增接收 options 的重载。

验证

  • PluginManager 宿主断言全绿(含新增 A48/A49/A50)。
  • C# 加载器、F# 加载器、RPC 加载器测试全绿。
  • 对应 ADR-0041 与 ADR-0042。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T05:02:45.209108Z 68718c7 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@residua1
residua1 merged commit 5c445a0 into main Oct 22, 2026
1 check passed
@residua1
residua1 deleted the feat/1x-additive-apis branch October 22, 2026 04:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 68718c739a

ℹ️ 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/PluginManager.cs
Comment on lines +212 to +214
slot.State,
slot.Enabled,
slot.IsLoader,

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 Clear Enabled when detaching a plugin

When an enabled plugin's unload verification fails or times out, the slot remains visible as Detached, but Detach never clears slot.Enabled; consequently this new snapshot reports Enabled = true even though the scope is closed and the plugin instance has been unloaded. Consumers polling Plugins or TryGetPlugin therefore receive a contradictory state and may treat a non-running plugin as enabled.

Useful? React with 👍 / 👎.

Comment thread src/PluginManager.cs
Comment on lines +63 to +64
if (options.UnloadVerificationTimeout <= TimeSpan.Zero
&& options.UnloadVerificationTimeout != Timeout.InfiniteTimeSpan)

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 Reject timeout values unsupported by WaitAsync

For a positive timeout above the timer-supported range (approximately 49.7 days), this validation accepts the option, but Task.WaitAsync(TimeSpan) throws ArgumentOutOfRangeException. UnloadCore then catches it as a verification failure, clears the verification task, and every unload retry fails without performing verification. Either reject such values during construction or handle long finite budgets without passing them directly to WaitAsync.

Useful? React with 👍 / 👎.

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.

2 participants