MCPcopy
hub / github.com/Doorman11991/smallcode / ingestResponseAsync

Method ingestResponseAsync

src/session/plan_tracker.js:173–187  ·  view source on GitHub ↗

* Async version of ingestResponse using MarrowScript Feature #3 (extract_plan). * Tries the compiled LLM extractor first — handles plans embedded in prose. * Falls back to the regex parsePlan() on failure.

(text)

Source from the content-addressed store, hash-verified

171 * Falls back to the regex parsePlan() on failure.
172 */
173 async ingestResponseAsync(text) {
174 if (!this.shouldInject || this.plan) return false;
175 // Try LLM extractor first
176 try {
177 const { extractPlanSteps } = require('../bin/features_adapter');
178 const steps = await extractPlanSteps(text);
179 if (steps && steps.length >= DEFAULT_MIN_STEPS) {
180 this.plan = steps.slice(0, DEFAULT_MAX_STEPS);
181 this.currentStep = 0;
182 return true;
183 }
184 } catch {}
185 // Fallback to regex
186 return this.ingestResponse(text);
187 }
188
189 /** Mark step N (0-indexed) as complete. */
190 completeStep(n) {

Callers 1

runAgentLoopFunction · 0.80

Calls 2

ingestResponseMethod · 0.95
extractPlanStepsFunction · 0.85

Tested by

no test coverage detected