@cocorograph/hub-agent 0.7.92 → 0.7.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/main.mjs +6 -4
package/package.json
CHANGED
package/src/main.mjs
CHANGED
|
@@ -3527,19 +3527,21 @@ async function dispatch(msg, ctx) {
|
|
|
3527
3527
|
// (main.mjs 内 clearChatSignal 呼び出し箇所参照) と対称に、SDK チャットの
|
|
3528
3528
|
// attach 時点でも前セッションのチャット信号を引き継がない。
|
|
3529
3529
|
// - fresh (resume 無し): 新規セッションで session_id はまだ確定しない
|
|
3530
|
-
// (SDK が最初の assistant イベントで通知する)
|
|
3531
|
-
//
|
|
3530
|
+
// (SDK が最初の assistant イベントで通知する)。ただし null を送ると frontend
|
|
3531
|
+
// は「同一会話で一時的に0%になった」と判断して旧値を保持するため、stream_id
|
|
3532
|
+
// 由来の一意な仮IDを先に送る。実 session_id が来た時点で置換される。
|
|
3532
3533
|
// - resume: bound session の jsonl から実 context% を解決し、cli_kind='claude' +
|
|
3533
3534
|
// 実 session_id で identity を確定させて即時 push する (症状③)。
|
|
3534
3535
|
const resolvedCwd = cwdArg || process.env.HOME || process.cwd()
|
|
3535
3536
|
if (resolvedCwd) {
|
|
3536
3537
|
if (!resumeSessionId) {
|
|
3538
|
+
const freshContextSessionId = `fresh:${stream_id}`
|
|
3537
3539
|
clearChatSignal(resolvedCwd, "claude")
|
|
3538
3540
|
recordChatActivity(resolvedCwd, "claude", {
|
|
3539
3541
|
status: "waiting",
|
|
3540
3542
|
contextPct: 0,
|
|
3541
3543
|
inputPending: false,
|
|
3542
|
-
sessionId:
|
|
3544
|
+
sessionId: freshContextSessionId,
|
|
3543
3545
|
})
|
|
3544
3546
|
pushImmediateChatState({
|
|
3545
3547
|
client: ctx.client,
|
|
@@ -3547,7 +3549,7 @@ async function dispatch(msg, ctx) {
|
|
|
3547
3549
|
logger: ctx.logger,
|
|
3548
3550
|
cwd: resolvedCwd,
|
|
3549
3551
|
cliKind: "claude",
|
|
3550
|
-
sessionId:
|
|
3552
|
+
sessionId: freshContextSessionId,
|
|
3551
3553
|
contextPct: 0,
|
|
3552
3554
|
}).catch(() => {})
|
|
3553
3555
|
} else {
|