@probelabs/probe 0.6.0-rc250 → 0.6.0-rc251

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.
@@ -4383,7 +4383,8 @@ Convert your previous response content into actual JSON data that follows this s
4383
4383
  // Call answer recursively with _schemaFormatted flag to prevent infinite loop
4384
4384
  finalResult = await this.answer(schemaPrompt, [], {
4385
4385
  ...options,
4386
- _schemaFormatted: true
4386
+ _schemaFormatted: true,
4387
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4387
4388
  });
4388
4389
 
4389
4390
  // Step 2: Validate and fix Mermaid diagrams if present (BEFORE cleaning schema)
@@ -4642,7 +4643,8 @@ Convert your previous response content into actual JSON data that follows this s
4642
4643
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
4643
4644
  ...options,
4644
4645
  _schemaFormatted: true,
4645
- _skipValidation: true // Skip validation in recursive correction calls to prevent loops
4646
+ _skipValidation: true, // Skip validation in recursive correction calls to prevent loops
4647
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4646
4648
  });
4647
4649
  finalResult = cleanSchemaResponse(finalResult);
4648
4650
  validation = validateJsonResponse(finalResult);
@@ -4702,7 +4704,8 @@ Convert your previous response content into actual JSON data that follows this s
4702
4704
  ...options,
4703
4705
  _schemaFormatted: true,
4704
4706
  _skipValidation: true, // Skip validation in recursive correction calls to prevent loops
4705
- _disableTools: true // Only allow attempt_completion - prevent AI from using search/query tools
4707
+ _disableTools: true, // Only allow attempt_completion - prevent AI from using search/query tools
4708
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4706
4709
  });
4707
4710
  finalResult = cleanSchemaResponse(finalResult);
4708
4711
 
@@ -4787,7 +4790,8 @@ Convert your previous response content into actual JSON data that follows this s
4787
4790
  }
4788
4791
 
4789
4792
  // Append DSL output buffer directly to response (bypasses LLM rewriting)
4790
- if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted) {
4793
+ // Skip during _completionPromptProcessed only the parent answer() should append the buffer.
4794
+ if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted && !options._completionPromptProcessed) {
4791
4795
  const outputContent = this._outputBuffer.items.join('\n\n');
4792
4796
  if (options.schema) {
4793
4797
  // Schema response — the finalResult is JSON. Wrap output in RAW_OUTPUT
@@ -84647,7 +84647,9 @@ NOT: {"type": "object", "properties": {"name": {"type": "string"}}}
84647
84647
  Convert your previous response content into actual JSON data that follows this schema structure.`;
84648
84648
  finalResult = await this.answer(schemaPrompt, [], {
84649
84649
  ...options,
84650
- _schemaFormatted: true
84650
+ _schemaFormatted: true,
84651
+ _completionPromptProcessed: true
84652
+ // Prevent cascading completion prompts in retry calls
84651
84653
  });
84652
84654
  if (!this.disableMermaidValidation) {
84653
84655
  try {
@@ -84851,8 +84853,10 @@ Convert your previous response content into actual JSON data that follows this s
84851
84853
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
84852
84854
  ...options,
84853
84855
  _schemaFormatted: true,
84854
- _skipValidation: true
84856
+ _skipValidation: true,
84855
84857
  // Skip validation in recursive correction calls to prevent loops
84858
+ _completionPromptProcessed: true
84859
+ // Prevent cascading completion prompts in retry calls
84856
84860
  });
84857
84861
  finalResult = cleanSchemaResponse(finalResult);
84858
84862
  validation = validateJsonResponse(finalResult);
@@ -84905,8 +84909,10 @@ Convert your previous response content into actual JSON data that follows this s
84905
84909
  _schemaFormatted: true,
84906
84910
  _skipValidation: true,
84907
84911
  // Skip validation in recursive correction calls to prevent loops
84908
- _disableTools: true
84912
+ _disableTools: true,
84909
84913
  // Only allow attempt_completion - prevent AI from using search/query tools
84914
+ _completionPromptProcessed: true
84915
+ // Prevent cascading completion prompts in retry calls
84910
84916
  });
84911
84917
  finalResult = cleanSchemaResponse(finalResult);
84912
84918
  validation = validateJsonResponse(finalResult, { debug: this.debug });
@@ -84976,7 +84982,7 @@ Convert your previous response content into actual JSON data that follows this s
84976
84982
  console.log(`[DEBUG] Removed thinking tags from final result`);
84977
84983
  }
84978
84984
  }
84979
- if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted) {
84985
+ if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted && !options._completionPromptProcessed) {
84980
84986
  const outputContent = this._outputBuffer.items.join("\n\n");
84981
84987
  if (options.schema) {
84982
84988
  finalResult = (finalResult || "") + "\n<<<RAW_OUTPUT>>>\n" + outputContent + "\n<<<END_RAW_OUTPUT>>>";
@@ -111346,7 +111346,9 @@ NOT: {"type": "object", "properties": {"name": {"type": "string"}}}
111346
111346
  Convert your previous response content into actual JSON data that follows this schema structure.`;
111347
111347
  finalResult = await this.answer(schemaPrompt, [], {
111348
111348
  ...options,
111349
- _schemaFormatted: true
111349
+ _schemaFormatted: true,
111350
+ _completionPromptProcessed: true
111351
+ // Prevent cascading completion prompts in retry calls
111350
111352
  });
111351
111353
  if (!this.disableMermaidValidation) {
111352
111354
  try {
@@ -111550,8 +111552,10 @@ Convert your previous response content into actual JSON data that follows this s
111550
111552
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
111551
111553
  ...options,
111552
111554
  _schemaFormatted: true,
111553
- _skipValidation: true
111555
+ _skipValidation: true,
111554
111556
  // Skip validation in recursive correction calls to prevent loops
111557
+ _completionPromptProcessed: true
111558
+ // Prevent cascading completion prompts in retry calls
111555
111559
  });
111556
111560
  finalResult = cleanSchemaResponse(finalResult);
111557
111561
  validation = validateJsonResponse(finalResult);
@@ -111604,8 +111608,10 @@ Convert your previous response content into actual JSON data that follows this s
111604
111608
  _schemaFormatted: true,
111605
111609
  _skipValidation: true,
111606
111610
  // Skip validation in recursive correction calls to prevent loops
111607
- _disableTools: true
111611
+ _disableTools: true,
111608
111612
  // Only allow attempt_completion - prevent AI from using search/query tools
111613
+ _completionPromptProcessed: true
111614
+ // Prevent cascading completion prompts in retry calls
111609
111615
  });
111610
111616
  finalResult = cleanSchemaResponse(finalResult);
111611
111617
  validation = validateJsonResponse(finalResult, { debug: this.debug });
@@ -111675,7 +111681,7 @@ Convert your previous response content into actual JSON data that follows this s
111675
111681
  console.log(`[DEBUG] Removed thinking tags from final result`);
111676
111682
  }
111677
111683
  }
111678
- if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted) {
111684
+ if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted && !options._completionPromptProcessed) {
111679
111685
  const outputContent = this._outputBuffer.items.join("\n\n");
111680
111686
  if (options.schema) {
111681
111687
  finalResult = (finalResult || "") + "\n<<<RAW_OUTPUT>>>\n" + outputContent + "\n<<<END_RAW_OUTPUT>>>";
package/cjs/index.cjs CHANGED
@@ -109699,7 +109699,9 @@ NOT: {"type": "object", "properties": {"name": {"type": "string"}}}
109699
109699
  Convert your previous response content into actual JSON data that follows this schema structure.`;
109700
109700
  finalResult = await this.answer(schemaPrompt, [], {
109701
109701
  ...options,
109702
- _schemaFormatted: true
109702
+ _schemaFormatted: true,
109703
+ _completionPromptProcessed: true
109704
+ // Prevent cascading completion prompts in retry calls
109703
109705
  });
109704
109706
  if (!this.disableMermaidValidation) {
109705
109707
  try {
@@ -109903,8 +109905,10 @@ Convert your previous response content into actual JSON data that follows this s
109903
109905
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
109904
109906
  ...options,
109905
109907
  _schemaFormatted: true,
109906
- _skipValidation: true
109908
+ _skipValidation: true,
109907
109909
  // Skip validation in recursive correction calls to prevent loops
109910
+ _completionPromptProcessed: true
109911
+ // Prevent cascading completion prompts in retry calls
109908
109912
  });
109909
109913
  finalResult = cleanSchemaResponse(finalResult);
109910
109914
  validation = validateJsonResponse(finalResult);
@@ -109957,8 +109961,10 @@ Convert your previous response content into actual JSON data that follows this s
109957
109961
  _schemaFormatted: true,
109958
109962
  _skipValidation: true,
109959
109963
  // Skip validation in recursive correction calls to prevent loops
109960
- _disableTools: true
109964
+ _disableTools: true,
109961
109965
  // Only allow attempt_completion - prevent AI from using search/query tools
109966
+ _completionPromptProcessed: true
109967
+ // Prevent cascading completion prompts in retry calls
109962
109968
  });
109963
109969
  finalResult = cleanSchemaResponse(finalResult);
109964
109970
  validation = validateJsonResponse(finalResult, { debug: this.debug });
@@ -110028,7 +110034,7 @@ Convert your previous response content into actual JSON data that follows this s
110028
110034
  console.log(`[DEBUG] Removed thinking tags from final result`);
110029
110035
  }
110030
110036
  }
110031
- if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted) {
110037
+ if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted && !options._completionPromptProcessed) {
110032
110038
  const outputContent = this._outputBuffer.items.join("\n\n");
110033
110039
  if (options.schema) {
110034
110040
  finalResult = (finalResult || "") + "\n<<<RAW_OUTPUT>>>\n" + outputContent + "\n<<<END_RAW_OUTPUT>>>";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe",
3
- "version": "0.6.0-rc250",
3
+ "version": "0.6.0-rc251",
4
4
  "description": "Node.js wrapper for the probe code search tool",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -4383,7 +4383,8 @@ Convert your previous response content into actual JSON data that follows this s
4383
4383
  // Call answer recursively with _schemaFormatted flag to prevent infinite loop
4384
4384
  finalResult = await this.answer(schemaPrompt, [], {
4385
4385
  ...options,
4386
- _schemaFormatted: true
4386
+ _schemaFormatted: true,
4387
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4387
4388
  });
4388
4389
 
4389
4390
  // Step 2: Validate and fix Mermaid diagrams if present (BEFORE cleaning schema)
@@ -4642,7 +4643,8 @@ Convert your previous response content into actual JSON data that follows this s
4642
4643
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
4643
4644
  ...options,
4644
4645
  _schemaFormatted: true,
4645
- _skipValidation: true // Skip validation in recursive correction calls to prevent loops
4646
+ _skipValidation: true, // Skip validation in recursive correction calls to prevent loops
4647
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4646
4648
  });
4647
4649
  finalResult = cleanSchemaResponse(finalResult);
4648
4650
  validation = validateJsonResponse(finalResult);
@@ -4702,7 +4704,8 @@ Convert your previous response content into actual JSON data that follows this s
4702
4704
  ...options,
4703
4705
  _schemaFormatted: true,
4704
4706
  _skipValidation: true, // Skip validation in recursive correction calls to prevent loops
4705
- _disableTools: true // Only allow attempt_completion - prevent AI from using search/query tools
4707
+ _disableTools: true, // Only allow attempt_completion - prevent AI from using search/query tools
4708
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4706
4709
  });
4707
4710
  finalResult = cleanSchemaResponse(finalResult);
4708
4711
 
@@ -4787,7 +4790,8 @@ Convert your previous response content into actual JSON data that follows this s
4787
4790
  }
4788
4791
 
4789
4792
  // Append DSL output buffer directly to response (bypasses LLM rewriting)
4790
- if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted) {
4793
+ // Skip during _completionPromptProcessed only the parent answer() should append the buffer.
4794
+ if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted && !options._completionPromptProcessed) {
4791
4795
  const outputContent = this._outputBuffer.items.join('\n\n');
4792
4796
  if (options.schema) {
4793
4797
  // Schema response — the finalResult is JSON. Wrap output in RAW_OUTPUT