Him188/revise on demand scope #2645
All Vouch review confidence checks passed
Residual risk 0.11 = Change Risk (0.72) × (1 − Review Confidence (0.85)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.72 · 1717 lines diff across 24 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.79 · 5 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.400
Mass File Touch
mass_file_touch
0.080
Real PR Conversation Timeline
7 items
java.lang.VerifyError: Bad type on operand stack |
-- | --
| Exception Details: |
| Location: |
| net/mamoe/mirai/utils/channels/CoroutineOnDemandReceiveChannel.receiveOrNull(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @103: getfield |
| Reason: |
| Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'net/mamoe/mirai/utils/channels/CoroutineOnDemandReceiveChannel' |
| Current Frame: |
| bci: @103 |
| flags: { } |
| locals: { 'net/mamoe/mirai/utils/channels/CoroutineOnDemandReceiveChannel', 'kotlin/coroutines/Continuation', 'java/lang/Object', integer, top, top, top, top, top, top, top, 'java/lang/Object', 'net/mamoe/mirai/utils/channels/CoroutineOnDemandReceiveChannel$receiveOrNull$1', 'java/lang/Object' } |
| stack: { 'java/lang/Object' } |
| Bytecode:
https://scans.gradle.com/s/esafjm3w3klog/tests/:mirai-core:jvmTest/net.mamoe.mirai.internal.network.component.BotAuthControlTest/auth%20test()?top-execution=1
interesting
基本好了
finish) 的行为, 现在它与 Job.cancel 行为相似, 重复 close 不会抛出异常
producer 抛异常不会立即 close channel, 在下一次 receiveOrNull 时才会 close.
假如 producer 抛异常时碰巧有人调用 close, 异常会被忽略.
如果 producer 抛了异常, 而 receiver 没有 receiveOrNull 而 close, 异常也会被忽略.
异常会被包装成 ProducerFailureException, 像这样:
net.mamoe.mirai.utils.channels.ProducerFailureException: Producer failed to produce a value, see cause
at net.mamoe.mirai.utils.channels.CoroutineOnDemandReceiveChannel.receiveOrNull(OnDemandChannelImpl.kt:164)
at net.mamoe.mirai.utils.channels.CoroutineOnDemandReceiveChannel$receiveOrNull$1.invokeSuspend(OnDemandChannelImpl.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.test.TestBuildersKt.runTest$default(Unknown Source)
at net.mamoe.mirai.utils.channels.OnDemandChannelTest.producer exception(OnDemandChannelTest.kt:273)
at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: java.util.NoSuchElementException: Oops
at net.mamoe.mirai.utils.channels.OnDemandChannelTest$producer exception$1$channel$1.invokeSuspend(OnDemandChannelTest.kt:275)
at net.mamoe.mirai.utils.channels.OnDemandChannelTest$producer exception$1$channel$1.invoke(OnDemandChannelTest.kt)
at net.mamoe.mirai.utils.channels.OnDemandChannelTest$producer exception$1$channel$1.invoke(OnDemandChannelTest.kt)
at net.mamoe.mirai.utils.channels.CoroutineOnDemandReceiveChannel$Producer$1.invokeSuspend(OnDemandChannelImpl.kt:46)
(Coroutine boundary)
at net.mamoe.mirai.utils.channels.CoroutineOnDemandReceiveChannel.receiveOrNull(OnDemandChannelImpl.kt:162)
at net.mamoe.mirai.utils.channels.OnDemandChannelTest$producer exception$1.invokeSuspend(OnDemandChannelTest.kt:280)
at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTestCoroutine$2.invokeSuspend(TestBuilders.kt:212)
Caused by: java.util.NoSuchElementException: Oops
...
在 BotAuth 时会最终以 BotAuthorizationException 之类的在 Bot.login 抛出
TODO:
UPDATE: 留到第二个 PR 再做
@Karlatemp 你想 review 吗
//FIXME
没看具体实现, 看了一遍 test 感觉没啥问题, 实际登录测试过?
e: file:///Users/runner/work/mirai/mirai/mirai-core-
utils/src/commonMain/kotlin/UtilsLogger.kt:69:42 This can only be used in tests.
e: file:///Users/runner/work/mirai/mirai/mirai-core-utils/src/commonMain/kotlin/UtilsLogger.kt:69:42 This can only be used in tests
Karlatemp
Him188
挪到 mirai-core-utils, 重新审查状态设计 (降低复杂度), 增加文档 (注释), 增加测试
close #2633