pi-gemini-app 0.1.12 → 0.1.13

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": "pi-gemini-app",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "In-process Google Gemini App provider extension for Pi (direct native HTTP/2, /login gemini-app, /gemini-quota, zero runtime dependencies).",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -63,7 +63,7 @@ export function selectIdleDeadline(facts, now = Date.now()) {
63
63
  }
64
64
  return { kind: null, ms: null };
65
65
  }
66
- if (facts.modelComplete) {
66
+ if (facts.modelComplete && facts.hasText) {
67
67
  return { kind: 'post_complete', ms: completeRemaining };
68
68
  }
69
69
  if (facts.hasLiveCalls && !facts.streamingTool) {
@@ -586,21 +586,13 @@ export class NativeDirectProvider {
586
586
  const item = await nextEventWithIdle();
587
587
  if (item && item[IDLE_TIMEOUT_SENTINEL]) {
588
588
  const idleKind = item[IDLE_TIMEOUT_SENTINEL];
589
- if (idleKind === 'post_complete' && item.verified) {
590
- if (rawText.trim().length > 0) {
591
- note('post_complete_idle_finish', { bytes: Buffer.byteLength(rawText) });
592
- try { turn?.cancel(); } catch {}
593
- readExit = 'complete_grace';
594
- ended = true;
595
- httpStatus = httpStatus ?? 200;
596
- grpc = grpc ?? 0;
597
- break;
598
- }
599
- // Upstream marked modelComplete=true with empty/thoughts-only text and never closed the stream:
600
- // break promptly without forging wireEnded=true so validate rejects as INCOMPLETE_NATIVE_RESPONSE.
601
- note('post_complete_empty_idle_timeout', { frames, thoughtBytes: outputShape.nativeThoughtBytes });
589
+ if (idleKind === 'post_complete' && item.verified && rawText.trim().length > 0) {
590
+ note('post_complete_idle_finish', { bytes: Buffer.byteLength(rawText) });
602
591
  try { turn?.cancel(); } catch {}
603
- readExit = 'complete_empty_grace';
592
+ readExit = 'complete_grace';
593
+ ended = true;
594
+ httpStatus = httpStatus ?? 200;
595
+ grpc = grpc ?? 0;
604
596
  break;
605
597
  }
606
598
  if (idleKind === 'post_tool_error' && item.verified && (liveToolError || item.probeError)) {