@adhdev/daemon-core 0.9.38 → 0.9.39

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/session-host-core",
3
- "version": "0.9.38",
3
+ "version": "0.9.39",
4
4
  "description": "ADHDev local session host core \u2014 session registry, protocol, buffers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.38",
3
+ "version": "0.9.39",
4
4
  "description": "ADHDev daemon core \u2014 CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1053,6 +1053,17 @@ export class ProviderCliAdapter implements CliAdapter {
1053
1053
  this.resolveStartupState('settled');
1054
1054
  if (this.startupParseGate) return;
1055
1055
 
1056
+ if (!this.isWaitingForResponse && !this.currentTurnScope && !this.activeModal && !this.parseErrorMessage) {
1057
+ const tail = this.settledBuffer || this.recentOutputBuffer;
1058
+ const modal = this.runParseApproval(tail);
1059
+ const lightweightStatus = this.cliScripts?.detectStatus
1060
+ ? this.runDetectStatus(tail)
1061
+ : null;
1062
+ if (!modal && lightweightStatus === 'idle' && this.currentStatus === 'idle') {
1063
+ return;
1064
+ }
1065
+ }
1066
+
1056
1067
  const session = this.runParseSession();
1057
1068
  if (!session) return;
1058
1069
 
@@ -599,8 +599,11 @@ export class CliProviderInstance implements ProviderInstance {
599
599
 
600
600
  private detectStatusTransition(): void {
601
601
  const now = Date.now();
602
- const adapterStatus = this.adapter.getStatus();
603
- const parsedStatus = this.adapter.getScriptParsedStatus?.() || null;
602
+ // Status-change handling is a hot path: PTY output can fire it many times
603
+ // during long-running CLI sessions. Keep this path on adapter-owned light
604
+ // state only; rich provider parsing is reserved for getState/read_chat.
605
+ const adapterStatus = this.adapter.getStatus({ allowParse: false });
606
+ const parsedStatus = null;
604
607
  const rawStatus = adapterStatus.status;
605
608
  const autoApproveActive = rawStatus === 'waiting_approval' && this.shouldAutoApprove();
606
609
  // Guard re-entry: onStatusChange can fire multiple times while the modal
@@ -696,7 +699,7 @@ export class CliProviderInstance implements ProviderInstance {
696
699
  this.completedDebouncePending = { chatTitle, duration, timestamp: now };
697
700
  this.completedDebounceTimer = setTimeout(() => {
698
701
  if (this.completedDebouncePending) {
699
- const latestStatus = this.adapter.getStatus();
702
+ const latestStatus = this.adapter.getStatus({ allowParse: false });
700
703
  const latestAutoApproveActive = latestStatus.status === 'waiting_approval' && this.shouldAutoApprove();
701
704
  const latestVisibleStatus = latestAutoApproveActive ? 'generating' : latestStatus.status;
702
705
  if (latestVisibleStatus !== 'idle') {