@aiwayds/dsh-topics-memory 0.25.0 → 0.25.1

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.
Files changed (3) hide show
  1. package/lib/index.js +12 -8
  2. package/package.json +16 -16
  3. package/src/index.ts +12 -8
package/lib/index.js CHANGED
@@ -751,10 +751,11 @@ export async function apply(ctx, config = {}) {
751
751
  // `agent/created` listener and a throw or rejection ROLLS THE ENTIRE AGENT
752
752
  // CREATION BACK. This listener is therefore total and synchronous — it
753
753
  // never throws, never returns a promise — and the chain is deferred off
754
- // the creation transaction entirely (setImmediate, unref'd): the pull /
754
+ // the creation transaction entirely (1.5s unref'd timer): the pull /
755
755
  // replay-distill / consolidation slow work starts only after the serial
756
- // dispatch has moved on. Plugin initialization must never block, delay,
757
- // or abort session startup; a chain failure at most warns.
756
+ // dispatch has moved on and the first frame is up. Plugin initialization
757
+ // must never block, delay, or abort session startup; a chain failure at
758
+ // most warns.
758
759
  const runBootChain = (sessionId) => {
759
760
  // Contained at the top too: a synchronous prologue throw (config read,
760
761
  // sync bookkeeping) must degrade to a warn, not leak toward the host.
@@ -852,11 +853,14 @@ export async function apply(ctx, config = {}) {
852
853
  const sessionId = String(payload?.agent?.id ?? '');
853
854
  if (sessionId === '')
854
855
  return;
855
- // Off the creation transaction: the unref'd immediate fires after the
856
- // current serial dispatch slice, so the chain's synchronous prologue
857
- // (config read, sync state) never delays the remaining listeners nor
858
- // the loop start, and the timer cannot hold a dying process open.
859
- const deferred = setImmediate(() => runBootChain(sessionId));
856
+ // Off the creation transaction AND off the boot window: the unref'd
857
+ // 1.5s timer fires after the serial dispatch has fully moved on and
858
+ // after the host's first frame, so the pull's git/DNS child processes
859
+ // never compete with startup I/O on a cold (possibly network-starved)
860
+ // machine — the 2026-10-19 boot-stall report showed the boot window
861
+ // and the fetch share the same constrained threadpool on a flaky VPN.
862
+ // The timer cannot hold a dying process open.
863
+ const deferred = setTimeout(() => runBootChain(sessionId), 1500);
860
864
  deferred.unref?.();
861
865
  }
862
866
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwayds/dsh-topics-memory",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "description": "dsh-plugin: quality-first topic memory for dsh — a topic keeps the starting question, conclusion, impact and dependencies, not the process; local-first git-traced OKF bundle, budgeted LLM-free injection",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -84,22 +84,22 @@
84
84
  },
85
85
  "devDependencies": {
86
86
  "@deepseek-ai/cordis": "4.0.4",
87
- "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
88
- "@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
89
- "@deepseek-ai/dsh-brand": "0.2.0-rc.2",
90
- "@deepseek-ai/dsh-commands": "0.2.0-rc.2",
87
+ "@deepseek-ai/dsh-agent": "0.2.1-rc.2",
88
+ "@deepseek-ai/dsh-attachment": "0.2.1-rc.2",
89
+ "@deepseek-ai/dsh-brand": "0.2.1-rc.2",
90
+ "@deepseek-ai/dsh-commands": "0.2.1-rc.2",
91
91
  "@deepseek-ai/dsh-invariants": "0.2.0-rc.2",
92
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
93
- "@deepseek-ai/dsh-scope": "0.2.0-rc.2",
94
- "@deepseek-ai/dsh-sandbox": "0.2.0-rc.2",
95
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
96
- "@deepseek-ai/dsh-settings": "0.2.0-rc.2",
97
- "@deepseek-ai/dsh-skill": "0.2.0-rc.2",
98
- "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
99
- "@deepseek-ai/dsh-timeout": "0.2.0-rc.2",
100
- "@deepseek-ai/dsh-tools": "0.2.0-rc.2",
101
- "@deepseek-ai/dsh-user-approval": "0.2.0-rc.2",
102
- "@deepseek-ai/dsh-util-values": "0.2.0-rc.2",
92
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.2",
93
+ "@deepseek-ai/dsh-scope": "0.2.1-rc.2",
94
+ "@deepseek-ai/dsh-sandbox": "0.2.1-rc.2",
95
+ "@deepseek-ai/dsh-session": "0.2.1-rc.2",
96
+ "@deepseek-ai/dsh-settings": "0.2.1-rc.2",
97
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.2",
98
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
99
+ "@deepseek-ai/dsh-timeout": "0.2.1-rc.2",
100
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.2",
101
+ "@deepseek-ai/dsh-user-approval": "0.2.1-rc.2",
102
+ "@deepseek-ai/dsh-util-values": "0.2.1-rc.2",
103
103
  "@deepseek-ai/schemastery": "3.18.4",
104
104
  "@types/node": "^22.19.0",
105
105
  "typescript": "^5.9.2"
package/src/index.ts CHANGED
@@ -891,10 +891,11 @@ export async function apply(ctx: Context, config: TopicsRuntimeConfig = {}): Pro
891
891
  // `agent/created` listener and a throw or rejection ROLLS THE ENTIRE AGENT
892
892
  // CREATION BACK. This listener is therefore total and synchronous — it
893
893
  // never throws, never returns a promise — and the chain is deferred off
894
- // the creation transaction entirely (setImmediate, unref'd): the pull /
894
+ // the creation transaction entirely (1.5s unref'd timer): the pull /
895
895
  // replay-distill / consolidation slow work starts only after the serial
896
- // dispatch has moved on. Plugin initialization must never block, delay,
897
- // or abort session startup; a chain failure at most warns.
896
+ // dispatch has moved on and the first frame is up. Plugin initialization
897
+ // must never block, delay, or abort session startup; a chain failure at
898
+ // most warns.
898
899
  const runBootChain = (sessionId: string) => {
899
900
  // Contained at the top too: a synchronous prologue throw (config read,
900
901
  // sync bookkeeping) must degrade to a warn, not leak toward the host.
@@ -987,11 +988,14 @@ export async function apply(ctx: Context, config: TopicsRuntimeConfig = {}): Pro
987
988
  try {
988
989
  const sessionId = String(payload?.agent?.id ?? '')
989
990
  if (sessionId === '') return
990
- // Off the creation transaction: the unref'd immediate fires after the
991
- // current serial dispatch slice, so the chain's synchronous prologue
992
- // (config read, sync state) never delays the remaining listeners nor
993
- // the loop start, and the timer cannot hold a dying process open.
994
- const deferred = setImmediate(() => runBootChain(sessionId))
991
+ // Off the creation transaction AND off the boot window: the unref'd
992
+ // 1.5s timer fires after the serial dispatch has fully moved on and
993
+ // after the host's first frame, so the pull's git/DNS child processes
994
+ // never compete with startup I/O on a cold (possibly network-starved)
995
+ // machine — the 2026-10-19 boot-stall report showed the boot window
996
+ // and the fetch share the same constrained threadpool on a flaky VPN.
997
+ // The timer cannot hold a dying process open.
998
+ const deferred = setTimeout(() => runBootChain(sessionId), 1500)
995
999
  deferred.unref?.()
996
1000
  } catch (error) {
997
1001
  warn(`dsh-topics-memory boot 链触发失败(不影响会话启动):${error instanceof Error ? error.message : String(error)}`)