@adhdev/daemon-core 0.9.82-rc.398 → 0.9.82-rc.399

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.82-rc.398",
3
+ "version": "0.9.82-rc.399",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  "author": "vilmire",
47
47
  "license": "AGPL-3.0-or-later",
48
48
  "dependencies": {
49
- "@adhdev/mesh-shared": "0.9.82-rc.398",
49
+ "@adhdev/mesh-shared": "0.9.82-rc.399",
50
50
  "@adhdev/session-host-core": "*",
51
51
  "@agentclientprotocol/sdk": "^0.16.1",
52
52
  "ajv": "^8.20.0",
@@ -2035,11 +2035,38 @@ export class CliProviderInstance implements ProviderInstance {
2035
2035
  const previousStatus = this.lastStatus;
2036
2036
  if (newStatus !== this.lastStatus) {
2037
2037
  LOG.info('CLI', `[${this.type}] status: ${this.lastStatus} → ${newStatus}`);
2038
- if (this.lastStatus === 'idle' && newStatus === 'generating') {
2038
+ // GENERATING-MISSING (win32 fresh-worktree first-turn): a freshly-launched session
2039
+ // is in 'starting' until its startup-grace settles to idle. When the FIRST inject
2040
+ // lands inside that grace window, the adapter can report status DIRECTLY
2041
+ // starting → generating without an intervening 'idle' frame for
2042
+ // detectStatusTransition() to observe. Previously only the idle→generating arm
2043
+ // armed the bookkeeping, so a starting→generating frame fell straight through to the
2044
+ // bare `this.lastStatus = newStatus` update: generatingStartedAt stayed 0 and no
2045
+ // generating_started was queued. The fast turn's generating→idle completion was then
2046
+ // suppressed by the startup-blip guard below (generatingStartedAt===0 &&
2047
+ // !generatingDebouncePending) — so NO generating_started AND NO generating_completed
2048
+ // ever fired and the mesh coordinator never learned the worker went idle.
2049
+ //
2050
+ // We extend the idle→generating arm to also fire on starting→generating, BUT ONLY
2051
+ // when a real turn is in flight. The adapter script can also report 'generating' from
2052
+ // pure startup PTY noise (no task dispatched) — antigravity/codex/hermes-cli all
2053
+ // exercise that benign starting→generating→idle blip, which must NOT emit a
2054
+ // completion (see "startup-phase spurious completion suppression" tests).
2055
+ // hasAdapterPendingResponse() is the discriminator: a genuine inject sets the
2056
+ // adapter's isWaitingForResponse / currentTurnScope (or leaves a partial response),
2057
+ // whereas startup repaint noise leaves all of them empty. So an armed
2058
+ // starting→generating means "the worker actually started its first turn", and a
2059
+ // bare one stays a suppressed blip via the existing fall-through.
2060
+ const startingToGeneratingWithActiveTurn = this.lastStatus === 'starting'
2061
+ && newStatus === 'generating'
2062
+ && this.hasAdapterPendingResponse();
2063
+ if (((this.lastStatus === 'idle' && newStatus === 'generating') || startingToGeneratingWithActiveTurn)) {
2039
2064
  // If a completion event is already pending and the turn has ended
2040
2065
  // (generatingStartedAt===0), the PTY is painting its prompt area
2041
2066
  // after completing. Ignore this blip — do not cancel the pending
2042
- // completion and do not advance lastStatus to generating.
2067
+ // completion and do not advance lastStatus to generating. (On a true
2068
+ // starting→generating the session is fresh: completedDebouncePending is
2069
+ // null, so this blip guard is a no-op and we arm normally below.)
2043
2070
  if (this.completedDebouncePending && this.generatingStartedAt === 0) {
2044
2071
  LOG.debug('CLI', `[${this.type}] ignoring post-completion PTY generating blip (generatingStartedAt=0)`);
2045
2072
  return;