Skip to content

ClassIsland 联动插件:新增 IslandCaller 支持 #3

Open

Description

@PANDAJSR

希望 https://github.com/SECTL/ClassIsland-SecAgent-Connector 能调用 https://github.com/HickoryTrail/IslandCaller 随机点名
次要功能(如果能实现):
配置IslandCaller名单等设置
注册 SecAgent 前置规则匹配点名等词(参考SecAgent的SecRandom联动插件),触发后调用 IslandCaller

Activity

  1. deleted a comment from github-actions on Aug 31, 2026
  2. deleted a comment from github-actions on Aug 31, 2026
  3. PANDAJSR commented on Aug 31, 2026

    @PANDAJSR
    CollaboratorAuthor

    /oc 分析

  4. github-actions commented on Aug 31, 2026

    @github-actions
    Contributor

    已达最大步骤上限(Maximum steps reached)

    本代理的步骤配额已用完,工具调用已被禁用,本次只能给出文字分析总结。


    已完成的分析

    我对 issue #3「ClassIsland 联动插件:新增 IslandCaller 支持」做了完整的可行性调研,涉及的四个仓库的结构与接口都已在 GitHub 上核实。

    当前架构(现状)

    ClassIsland 联动由两端组成:

    1. ClassIsland 端插件(SECTL/ClassIsland-SecAgent-Plugin,Plugin.cs)

      • 在 http://127.0.0.1:18789 起 HttpApiServer,暴露 /health、/tools、POST /tools/{toolName}
      • 工具目录是硬编码的(Tools() 方法),CallTool(name, arguments) 用 switch 分发,目前没有任何点名类工具
    2. SecAgent 端连接插件(SECTL/ClassIsland-SecAgent-Connector,main.mjs)

      • 动态注册 ClassIsland 端 /tools 目录返回的全部工具 + classisland Skill + 课表上下文 prompt
      • 权限仅 ["agent.tools", "agent.skills", "agent.prompts", "network.http"],没有 agent.pre_rules

    IslandCaller(HickoryTrail/IslandCaller):

    • 是运行在 ClassIsland 进程内的插件,不暴露任何 HTTP API
    • 随机点名入口:IslandCallerService.ShowRandomStudent(stunum)(加权随机 + TTS/通知/点名窗口)
    • 已注册两个可被外部触发的钩子:
      • URI 导航 IUriNavigationService.HandlePluginsNavigation("IslandCaller/Simple", ...)
      • 自动化行动 IslandCaller.Call(IActionService.ActionMenuTree)
    • 名单/权重存于 Settings.Instance.Profile.ProfileList(用户设置 JSON)
    • 作者进入高三,项目停止大版本迭代(维护交予 Codex),不能指望对方改版加 API

    关键结论

    • 主功能可行,且不需要改动 IslandCaller 本体:因为 IslandCaller 与 ClassIsland-SecAgent-Plugin 运行在同一个 ClassIsland 进程中,后者可以通过 ClassIsland 插件宿主直接触发前者——推荐用 IAppHost.TryGetService<IslandCallerService>() 调 ShowRandomStudent(1)(最直接),或 URI 导航 / 自动化行动作为不依赖 IslandCaller 内部类型的备选。
    • 次要功能(前置规则 + 名单配置)的参照物是 SECTL/SecRandom-SecAgent-Connector 的 src/main.mjs:
      • 用 api.registerPreRule("draw_students_command", parseDrawPreRule) 注册函数式前置规则(匹配「点个名/点名/抽个人/抽人/随机抽取/随机」+数量+性别),命中后直接调工具、渲染回复、绕过 LLM;权限声明里需要加 agent.pre_rules。
      • registerPreRule 的签名在 SecAgent 侧 plugin-manager.ts(PluginPreRuleMatcher,返回 { tool, arguments, render }),运行时在 runtime.ts 执行——SecAgent 宿主无需任何改动。

    建议的实现方案(涉及三个仓库)

    1. SECTL/ClassIsland-SecAgent-Plugin(主要改动)

      • 新增工具 call_island_caller(约 10 行):在 Tools() 注册、在 CallTool switch 中分发;实现里 IAppHost.TryGetService<IslandCallerService>()?.ShowRandomStudent(1)(可加 count、notify 参数),返回被点到学生名/状态;IslandCaller 未安装时返回明确错误。
      • 可选新增 list_island_caller_roster / write_island_caller_roster 工具读写名单设置(需要解析 IslandCaller 的 Settings.Profile.ProfileList,属加分项、工作量较大)。
    2. SECTL/ClassIsland-SecAgent-Connector(连接插件)

      • 因工具是动态发现的,call_island_caller 会被自动注册,无需改工具层。
      • 复制 SecRandom 连接插件的 parseDrawPreRule 模式:secagent-plugin.json 增加 "agent.pre_rules" 权限,main.mjs 中 api.registerPreRule("islandcaller_call", matcher),正则匹配「点名/随机点名/抽人/抽个学生」等词,命中调用 call_island_caller 并渲染「点到:XXX」回复。
      • 可在 skills/classisland 的 SKILL.md 中补充 IslandCaller 使用说明。
    3. SECTL/secagent-plugin-marketplace(发布)

      • 两个插件 bump 版本、重新生成签名索引后,现有 SecAgent 的 10 分钟自动更新机制会自动推送。

    剩余工作

    • 实际编码(三个仓库)与构建:ClassIsland 插件为 .NET/C#(dotnet build)、连接插件为 JS(node --check main.mjs)
    • 端到端验证:ClassIsland 里装 IslandCaller + SecAgent 插件,SecAgent 里触发「点名」语句,确认命中前置规则并弹出点名窗口
    • 签名市场索引的重新生成与发布

    建议下一步

    在获得用户对方案(尤其「触发方式:直接调 IslandCallerService vs URI 导航」以及「是否要做名单配置工具」)的确认后,先从 ClassIsland-SecAgent-Plugin 加 call_island_caller 工具开始实现,再改连接插件加前置规则与权限,最后发布市场索引。

    (说明:本次任务为 /oc 分析,未做任何代码改动,工作树保持干净。)

    New%20session%20-%202026-08-31T10%3A19%3A14.473Z
    opencode session  |  github run

  5. PANDAJSR commented on Aug 31, 2026

    @PANDAJSR
    CollaboratorAuthor

    /oc 执行

  6. github-actions commented on Aug 31, 2026

    @github-actions
    Contributor

    已达最大步骤上限(Maximum steps reached)

    本代理的步骤配额已用完,工具调用已被禁用,本次只能给出文字总结。本轮任务为 /oc 执行,我已完成了全部调研与实现方案设计,但尚未写入任何代码改动。


    已完成的工作

    1. 核实了四个仓库(均可被 runner 访问,且均属于允许修改的 SECTL SecAgent 仓库列表):

      • SECTL/ClassIsland-SecAgent-Plugin(ClassIsland 端插件,C#,Plugin.cs 1592 行,dotnet build 已验证可干净构建)
      • SECTL/ClassIsland-SecAgent-Connector(SecAgent 端连接插件,main.mjs + secagent-plugin.json)
      • SECTL/SecRandom-SecAgent-Connector(前置规则参照实现)
      • HickoryTrail/IslandCaller(只读调研,不会修改此仓库)
    2. 确认了 IslandCaller 的触发方式(关键结论):

      • 与 SecAgent 插件运行在同一 ClassIsland 进程内,IslandCallerService 以单例注册在 DI 容器(IAppHost.Host.Services),可通过反射 GetService(Type) + Invoke("ShowRandomStudent", count) 触发随机点名,无需改动 IslandCaller 本体。
      • ShowRandomStudent 的同步段会先完成抽取并写入 HistoryService.top20List,因此调用后读取 history 可拿到被点学生名单(供前置规则渲染“点到:XXX”)。
      • 名单是 %APPDATA%\IslandCaller\Profile\{guid}.csv(id,name,gender,manualweight),ProfileService.SaveProfile/GetMembers 可读写,Settings.Instance.Profile.ProfileList 是 Dictionary<Guid,string>。
      • 就绪状态通过 Status.IsPluginReady 判断。
    3. 读通了 SecAgent 侧前置规则机制(plugin-manager.ts 的 PluginPreRuleMatcher、runtime.ts 的匹配→callTool→render 流程):前置规则命中后若工具调用抛异常会回退 LLM,因此 call_island_caller 应返回结构化结果而非抛错。

    4. 完成了完整的实现方案设计(见下)。

    未完成的工作(需在下一轮执行)

    A. ClassIsland-SecAgent-Plugin 的 Plugin.cs(主要改动)

    • 新增 4 个工具并注册进 Tools() 目录与 CallTool switch:
      • call_island_caller(默认展示、非 hidden):count(1–20)→ 反射调 ShowRandomStudent,读取 history 返回 {ok, installed, triggered, students, message},IslandCaller 未安装时返回明确信息而不是抛错。
      • list_island_caller_profiles:列出 ProfileList 的名称/ID/人数。
      • read_island_caller_roster / write_island_caller_roster:反射读写名单 CSV,写后重载 ProfileService 并重新 Initialize() CoreService 使其立即生效。

    B. ClassIsland-SecAgent-Connector

    • secagent-plugin.json:权限追加 "agent.pre_rules",版本 bump 至 1.1.0。
    • main.mjs:仿 SecRandom 增加 registerPreRule("islandcaller_call", parseIslandCallerPreRule),正则匹配「点名/随机点名/抽人/抽个学生/抽取/抽(N 人)」等,命中调用 call_island_caller 并渲染“点到:XXX”;连接时注册、断开时注销。
    • scripts/build.mjs:zip 文件名改为 1.1.0;skills/classisland/SKILL.md 与 README.md 补充 IslandCaller 说明。

    建议的下一步

    1. 按上述方案在 /tmp/opencode/plugin 与 /tmp/opencode/connector 提交改动(各自新建分支),dotnet build 验证 C#、node --check + node --test 验证 JS。
    2. 两个仓库分别 gh pr create(opencode 基础设施会自动处理 push/PR)。
    3. 提醒:若用户同时安装 SecRandom 与 ClassIsland 两个连接插件,两者前置规则都可能命中「点名」,需在 PR 描述中说明“先注册者优先”的行为。

    New%20session%20-%202026-08-31T11%3A17%3A16.257Z
    opencode session  |  github run

  7. PANDAJSR commented on Aug 31, 2026

    @PANDAJSR
    CollaboratorAuthor

    /oc 继续

  8. github-actions commented on Aug 31, 2026

    @github-actions
    Contributor

    已达最大步骤上限(Maximum steps reached),本轮无法继续调用工具,只能给出文字总结。

    本轮已完成的工作

    在本轮(/oc 继续)中,我完成了全部调研与方案落地的准备,但尚未写入任何代码改动:

    1. 克隆并核实了四个仓库(均在 runner 中可用):

      • SECTL/ClassIsland-SecAgent-Connector(SecAgent 端连接插件,main.mjs 127 行 + secagent-plugin.json)
      • SECTL/ClassIsland-SecAgent-Plugin(ClassIsland 端插件,Plugin.cs 1592 行)
      • SECTL/SecRandom-SecAgent-Connector(前置规则参照实现)
      • HickoryTrail/IslandCaller(只读调研,不修改)
    2. 验证构建:dotnet build 在 /tmp/opencode/plugin 通过,0 警告 0 错误。

    3. 确认了 IslandCaller 全部相关 API(关键结论,均已逐一读源码核实):

      • IslandCallerService.ShowRandomStudent(int stunum) 是 public async void,同步段先 CoreService.GetRandomStudent() 抽取并逐人写入 HistoryService.top20List(private 字段,反射可读),随后才 await Task.Delay;因此调用返回后读取 history 前 count 条即为被点学生名单。
      • 就绪门控是 Status.IsPluginReady(由 Profile/History/Core/IslandCallerService/时间状态/占用标志组合而成),未就绪时 ShowRandomStudent 直接 return。
      • 名单:ProfileService.Members(Person{Id,Name,Gender,ManualWeight})、GetMembers(Guid)、SaveProfile(Guid,List<Person>)、LoadSelectedProfile(Guid);ProfileRuntimeService.Reload/EnsureLoaded/Initialize 可在写名单后热重载 CoreService/HistoryService。
      • 设置:Settings.Instance.Profile.ProfileList(Dictionary<Guid,string>)与 DefaultProfile(Guid)。
      • 全部服务以单例注册在 ClassIsland DI 容器,SecAgent 插件可通过反射 IAppHost.Host.Services.GetService(type) 获取,无需改动 IslandCaller 本体。
    4. 读通了 SecAgent 前置规则机制(src/plugin-manager.ts 的 PluginPreRuleMatcher / PluginPreRuleMatch,src/runtime.ts 的匹配→callTool→render 流程):工具调用抛异常会回退 LLM 并注入失败上下文,因此 call_island_caller 应返回结构化结果而非抛错(如 IslandCaller 未安装时返回 {ok:false, message:"…"},由 pre-rule 的 render 转成友好文案)。

    剩余未完成的工作

    A. ClassIsland-SecAgent-Plugin 的 Plugin.cs(主要改动)——在 Tools() 目录与 CallTool switch 中新增:

    • call_island_caller(非 hidden):count(1–20,默认 1) → 反射调 ShowRandomStudent,读取 history 前 count 条返回 {ok, installed, ready, triggered, students, message};IslandCaller 未安装/未就绪时返回明确信息。
    • list_island_caller_profiles(hidden):列出 ProfileList 的名称/ID/人数。
    • read_island_caller_roster / write_island_caller_roster(hidden):反射读写名单 CSV,写后经 ProfileRuntimeService 热重载。

    B. ClassIsland-SecAgent-Connector:

    • secagent-plugin.json:权限追加 "agent.pre_rules",版本 bump 至 1.1.0。
    • main.mjs:仿 SecRandom 增加 registerPreRule("islandcaller_call", parseIslandCallerPreRule),正则匹配「点名/随机点名/抽人/抽个学生」等,命中调 call_island_caller 并渲染「点到:XXX」;连接时注册、断开时注销。
    • scripts/build.mjs:zip 文件名改 1.1.0;skills/classisland/SKILL.md 与 README.md 补充 IslandCaller 说明(注意:automation.md/coverage.md/plugins-themes.md 三个 skill 文件为 UTF-16 无 BOM 编码,编辑需先转码)。

    C. 发布:两个仓库各自新建分支提交、dotnet build / node --check 验证后开 PR(opencode 基础设施会自动处理 push/PR)。

    建议的下一步

    1. 直接在 /tmp/opencode/plugin 与 /tmp/opencode/connector 按上述方案写代码并各自建分支。
    2. dotnet build 验证 C#、node --check + 手动测试验证 JS(预规则匹配)。
    3. 两个仓库分别 gh pr create。
    4. 在 PR 描述中说明:若同时安装 SecRandom 与 ClassIsland 两个连接插件,「点名」类关键词可能都被前置规则匹配,SecAgent 按先注册者优先执行。

    New%20session%20-%202026-08-31T12%3A44%3A50.680Z
    opencode session  |  github run

  9. PANDAJSR commented on Aug 31, 2026

    @PANDAJSR
    CollaboratorAuthor

    /oc 继续

  10. github-actions commented on Aug 31, 2026

    @github-actions
    Contributor

    GitHub Actions is not permitted to create or approve pull requests. - https://docs.github.com/rest/pulls/pulls#create-a-pull-request

    opencode session  |  github run

  11. PANDAJSR commented on Sep 1, 2026

    @PANDAJSR
    CollaboratorAuthor

    /oc 重试

  12. PANDAJSR commented on Sep 1, 2026

    @PANDAJSR
    CollaboratorAuthor

    /oc 重试

  13. opencode-agent commented on Sep 1, 2026

    @opencode-agent

    本次 /oc 重试 已完成 IslandCaller 支持的完整实现。三个仓库各有一个已提交的分支,等待基础设施自动推送并开 PR。

    已完成的改动

    1. SECTL/ClassIsland-SecAgent-Plugin — 分支 feat/island-caller-support

    Plugin.cs 新增 4 个 HTTP 工具(全部通过反射访问 IslandCaller,不编译期依赖其程序集,未安装时返回明确信息而不是抛错):

    • call_island_caller(非 hidden):count(1–20,默认 1) → 通过 DI 反射取得 IslandCallerService,校验 Status.IsPluginReady,在 UI 线程调用 ShowRandomStudent(count),再读 HistoryService.top20List 私有字段返回被点学生名单。返回 {ok, installed, ready, triggered, count, students, message}。
    • list_island_caller_profiles(hidden):列出 Settings.Instance.Profile.ProfileList(GUID/名称/成员数)。
    • read_island_caller_roster(hidden):读名单 CSV。
    • write_island_caller_roster(hidden):写名单 CSV 并调用 ProfileRuntimeService.Reload 热重载。
    • manifest.yml 版本 bump 至 0.1.1.0;README 补充说明。
    • 验证:dotnet build 0 警告 0 错误。

    2. SECTL/ClassIsland-SecAgent-Connector — 分支 feat/island-caller-support

    • secagent-plugin.json:权限增加 agent.pre_rules,版本 bump 至 1.1.0。
    • main.mjs:新增 parseIslandCallerPreRule(仿 SecRandom),正则匹配「点名/随机点名/抽人/抽个学生/抽N个人」等(含中文/阿拉伯数字人数,1–20),命中后调 call_island_caller 并渲染「点到N人:…」;仅在 catalog 暴露 call_island_caller 时注册前置规则,连接时注册、断开时注销。
    • scripts/build.mjs:zip 文件名改为从 secagent-plugin.json 读版本。
    • 新增 test/main.test.mjs(5 个用例,npm test 全绿)验证正则与渲染。
    • skills/classisland/SKILL.md 与 README 补充 IslandCaller 工具说明。

    3. SECTL/secagent-plugin-marketplace — 分支 feat/classisland-island-caller

    plugins/classisland-connector.json 的 permissions 增加 agent.pre_rules(与 plugins/secrandom.json 一致),供定时索引生成器发布新权限。

    关键设计说明

    • 无需改动 IslandCaller 本体:其服务已注册在 ClassIsland 共享 DI 容器,SecAgent 插件通过 IAppHost.Host.Services.GetService(type) + 反射直接驱动。
    • 线程安全:ShowRandomStudent 内部会创建 Avalonia 窗口,通过 Dispatcher.UIThread.Invoke 在 UI 线程执行;top20List 在调用前/后各读一次计数,只返回本次新增的被点学生。
    • 容错:IslandCaller 未安装/未就绪时返回结构化 {ok:false, ...},前置规则渲染友好文案,不会抛错回退 LLM。

    遗留说明

    • 若同时安装 SecRandom 连接插件,两者都可能命中「点名」类关键词,SecAgent 按插件注册顺序先注册者优先——已在两个 README 中注明。
    • 名单 CSV 读写与 IslandCaller 的 %APPDATA%\IslandCaller\Profile\{guid}.csv 格式(id,name,gender,manualweight)对齐,gender 0=男、1=女。
    • 端到端(ClassIsland 内实际安装 IslandCaller + 触发点名窗口)需要 Windows/ClassIsland 环境,本次仅在 runner 上完成构建与单测验证。

    New%20session%20-%202026-09-01T12%3A46%3A49.143Z
    opencode session  |  github run

  14. opencode-agent commented on Sep 1, 2026

    @opencode-agent

    User opencode-agent[bot] does not have write permissions

    github run

  15. PANDAJSR commented on Sep 3, 2026

    @PANDAJSR
    CollaboratorAuthor

    给两个ClassIsland-SecAgent仓库提pr

  16. PANDAJSR commented on Sep 4, 2026

    @PANDAJSR
    CollaboratorAuthor

    /oc

  17. PANDAJSR commented on Sep 4, 2026

    @PANDAJSR
    CollaboratorAuthor

    /oc 重试:请继续完成之前的任务;如果任务目标是其他仓库,请使用 GH_TOKEN 访问对应仓库并直接提交代码、创建 PR。

  18. github-actions commented on Sep 4, 2026

    @github-actions
    Contributor

    已完成本轮的实现并在两个 ClassIsland-SecAgent 仓库各开了一个 PR。之前轮次做好的本地改动因每次 runner 环境都是全新的而丢失,本轮我在 /tmp/opencode 重新克隆代码、按之前调研结论重新实现并推送。

    创建的 PR

    1. SECTL/ClassIsland-SecAgent-Plugin — https://github.com/SECTL/ClassIsland-SecAgent-Plugin/pull/3(分支 feat/island-caller-support,0.1.0.1 → 0.1.1.0)

      • 新增 4 个 HTTP 工具(目录注册 + CallTool 分发 + JSON schema):
        • call_island_caller(非 hidden):count(1–20) + 可选 profile_id;先校验 Status.IsPluginReady,切换指定名单,然后在 Avalonia UI 线程通过反射调用 IslandCallerService.ShowRandomStudent(count),再读 HistoryService.top20List 取本次新增的被点学生。
        • list_island_caller_profiles / read_island_caller_roster / write_island_caller_roster(hidden,名单管理,写当前激活名单后经 ProfileRuntimeService.Reload 热重载)。
      • 新增 IslandCallerTools.cs:全部通过类型名扫描 + IAppHost.Host.Services.GetService 反射访问 IslandCaller,不引用其程序集;未安装/未就绪/失败一律返回结构化 {ok:false,message} 而非抛异常,方便前置规则渲染。
      • 验证:dotnet build 0 警告 0 错误。
    2. SECTL/ClassIsland-SecAgent-Connector — https://github.com/SECTL/ClassIsland-SecAgent-Connector/pull/2(分支 feat/island-caller-support,1.0.2 → 1.1.0)

      • secagent-plugin.json 权限增加 agent.pre_rules。
      • main.mjs 仿 SecRandom 新增 parseIslandCallerPreRule/renderIslandCallerResult:正则匹配「点名/点个名/随机点名/抽人/抽N个同学/在ClassIsland里点名」等,仅当探测到 IslandCaller 真实可用时才注册前置规则(避免与 SecRandom 抢关键词),命中直接调用 call_island_caller 并渲染「已随机点名 N 人:…」。
      • SKILL.md/README 补充工具说明;新增 test/main.test.mjs(npm test 8/8 通过;npm run build 产出 1.1.0 zip)。

    说明与遗留

    • 之前轮次创建 PR 失败的原因是 runner 的 GITHUB_TOKEN 无写权限;本轮 GH_TOKEN 带有 BOM 前缀导致 gh 鉴权失败,剥离 BOM 后即为合法 token,已用它完成 push + PR 创建。
    • 兼容性提示(已写进 plugin PR 描述):IslandCaller 目前基于 ClassIsland 2.x(net10),而本 ClassIsland 端插件仍构建于 ClassIsland 1.7 PluginSdk;要让两者同进程协同,建议后续将插件升级到 ClassIsland 2.x SDK。
    • 端到端(实际在 ClassIsland 中弹出点名窗口/TTS)需在 Windows 环境验证;runner 上仅完成构建与单测。
    • 合并后需发布 v1.1.0/0.1.1.0 release(含 zip/cipx 资产),市场索引刷新后 SecAgent 10 分钟自动更新即可生效。

    New%20session%20-%202026-09-04T11%3A52%3A55.867Z
    opencode session  |  github run

  19. PANDAJSR commented on Sep 5, 2026

    @PANDAJSR
    CollaboratorAuthor

    /oc 继续执行之前的任务:请从当前状态继续完成代码修改,配置 Git 身份和认证已修复;完成测试后直接提交新分支并创建 PR。若任务目标是其他 SECTL 仓库,请使用 GH_TOKEN 访问目标仓库并在那里创建 PR。

  20. PANDAJSR commented on Sep 5, 2026

    @PANDAJSR
    CollaboratorAuthor

    /oc 继续重试:请从之前中断的位置继续完成任务,使用已修复的跨仓库 Git 认证,完成代码修改和测试后直接提交新分支并创建 PR;如果目标是中转服务,请访问 SECTL/secagent-official-relay 并在那里创建 PR。

  21. github-actions commented on Sep 5, 2026

    @github-actions
    Contributor

    本轮 /oc 继续执行 完成。本轮任务是从被中断的位置继续:修复后的跨仓库 Git 认证已生效,我验证了两个既有 PR 的完整性与正确性,并补齐了此前遗留的市场元数据改动。

    三个仓库现状(均有 OPEN、MERGEABLE 的 PR)

    1. SECTL/ClassIsland-SecAgent-Plugin — PR #3(分支 feat/island-caller-support,0.1.0.1 → 0.1.1.0)

      • 4 个 IslandCaller 联动工具:call_island_caller(展示)+ list_island_caller_profiles / read_island_caller_roster / write_island_caller_roster(隐藏),全部通过 DI 反射访问 IslandCaller,不引用其程序集。
      • ✅ dotnet build -c Release:0 警告 0 错误。
    2. SECTL/ClassIsland-SecAgent-Connector — PR #2(分支 feat/island-caller-support,1.0.2 → 1.1.0)

      • secagent-plugin.json 新增 agent.pre_rules 权限;main.mjs 仿 SecRandom 新增 islandcaller_call 前置规则(“点名/点个名/随机点名/抽人/抽N个同学”等,含中文/阿拉伯数字人数),仅当探测到 IslandCaller 真实可用才注册,避免与 SecRandom 抢占关键词。
      • ✅ node --check 通过;npm test 8/8 通过;npm run build 产出 dist/classisland-connector-1.1.0.zip。
    3. SECTL/secagent-plugin-marketplace — PR #5(本轮新建,分支 feat/classisland-island-caller)

      • 此前遗留缺口:plugins/classisland-connector.json 的 permissions 增加 agent.pre_rules(与 secrandom.json 一致),description 同步补充 IslandCaller 随机点名。已推送并开 PR(合并后由定时生成器自动刷新带签名 index.json)。

    本轮额外做的核实

    • 修复了 runner 的跨仓库 Git 认证问题:环境注入的 http.https://github.com/.extraheader=AUTHORIZATION: basic gho_…(未 base64、格式非法)导致所有 git 操作对 github.com 返回 HTTP 400;去掉该注入并用 GH_TOKEN + x-access-token 凭据后 clone/push 全部正常。
    • 对照 HickoryTrail/IslandCaller 实际源码逐项核实了 Plugin PR 中的反射假设:全部命中——
      • 类型全名 IslandCaller.Services.IslandCallerService.IslandCallerService、HistoryService、ProfileService、Status、ProfileRuntimeService、IslandCaller.Models.Settings 均正确;
      • ShowRandomStudent(int) 为 async void,其同步段在首个 await 前完成抽取并逐人 HistoryService.Add → top20List.Insert(0, …)(故调用返回后读取头部新增即可取到被点名单);
      • Status.IsPluginReady 为 public getter(DI 单例注册,IAppHost.Host.Services.GetService 可解析);
      • ProfileRuntimeService.EnsureLoaded/Reload(Guid) 是 internal 方法——代码用 BindingFlags.NonPublic 查找,可命中;名单 CSV 格式 id,name,gender,manualweight、%APPDATA%\IslandCaller\Profile\{guid}.csv 均与源码一致。

    遗留说明

    • 两个核心仓库的代码改动与 PR 在 2026-09-04 轮已创建完成,本轮复查确认无缺失;合并前无需再改动。
    • 合并后仍需人工/后续 CI 发布 Release(Connector v1.1.0 zip 资产、Plugin 0.1.1.0),市场索引的 20 分钟定时生成器会自动拾取并推送更新到已安装的 SecAgent。
    • 端到端验证(Windows + ClassIsland 中实际弹出点名窗口/TTS)无法在本 runner 完成;另注意 IslandCaller 基于 ClassIsland 2.x 而本插件仍构建于 1.7 PluginSdk,同进程协同建议后续升级 SDK(plugin 仓库已有 2.x 兼容性文档 PR feat: add message quote/search and a two-step OOBE #2)。

    New%20session%20-%202026-09-05T01%3A19%3A22.055Z
    opencode session  |  github run

  22. PANDAJSR commented on Sep 5, 2026

    @PANDAJSR
    CollaboratorAuthor

    /oc 继续执行:请从之前中断处恢复,先确认目标仓库和当前状态;完成代码修改、测试、提交和 PR。不要只输出方案。

  23. github-actions commented on Sep 5, 2026

    @github-actions
    Contributor

    All validation passes. The work for this run is complete.

    本轮工作总结

    本任务是从被中断处恢复 issue #3「ClassIsland 联动插件:新增 IslandCaller 支持」。本 runner 是全新环境(此前克隆全部丢失),我先确认了目标与状态,再从干净克隆逐一验证实现,并实际修复了一个此前遗漏的真实缺陷。

    当前状态确认(三个目标仓库均已有 OPEN、MERGEABLE 的 PR)

    1. SECTL/ClassIsland-SecAgent-Plugin — PR #3(分支 feat/island-caller-support,0.1.0.1 → 0.1.1.0)
    2. SECTL/ClassIsland-SecAgent-Connector — PR #2(分支 feat/island-caller-support,1.0.2 → 1.1.0)
    3. SECTL/secagent-plugin-marketplace — PR #5(分支 feat/classisland-island-caller)

    本轮实际改动

    在本轮复核中我发现 call_island_caller 存在一个真实缺陷并已修复推送(IslandCallerTools.cs):

    • 问题:原实现用"点名前后 top20List Count 差值"判断被点学生。但 IslandCaller 的 top20List 硬上限 20 条(Add() 头插、超限尾部淘汰),历史打满后 Count 不再变化 → 点名后 added=0,工具误报"没有返回学生";接近打满时也会少报。
    • 修复:改为点名前复制历史快照,点名后通过「去掉头部 k 条后与旧历史按原顺序对齐」求实际新增条数(SnapshotList + CountNewHeadEntries),并反转为抽取顺序。已用 Python 模拟 IslandCaller 真实 HistoryService.Add 语义验证全部边界(历史打满 20 条、跨上限抽取、部分抽取失败 Error、重复点名)。
    • 新增提交 fix(tools): 历史打满 20 条时正确识别本次被点学生(f8ddfad),已推送至 PR ClassIsland 联动插件:新增 IslandCaller 支持 #3 分支,PR 现含 2 个提交且保持 MERGEABLE。

    验证结果(全部在干净克隆上重新执行)

    • Plugin:dotnet build -c Release → 0 警告 0 错误
    • Connector:node --check main.mjs 通过;npm test 8/8 通过;npm run build 产出 classisland-connector-1.1.0.zip
    • Marketplace:index.json 由仓库自身 CI 重签(commit 44e6ebb),用 SecAgent 内置公钥验证签名 有效,sha256 与 plugins/classisland-connector.json 一致
    • 宿主 API 核对:前置规则名称 islandcaller_call、工具名 call_island_caller、pluginId__tool 解析、agent.pre_rules 权限声明,均与 SecAgent plugin-manager.ts/runtime.ts 的 matchPreRule/registerPreRule 契约一致
    • IslandCaller 源码逐项核对:所有反射假设(类型全名、DI 单例注册、ShowRandomStudent 同步段写历史、Status.IsPluginReady、CSV 名单格式与路径、internal EnsureLoaded/Reload)均与实际源码命中

    遗留说明

    New%20session%20-%202026-09-05T01%3A29%3A42.634Z
    opencode session  |  github run

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions