MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / looks_like_cold_start_description

Function looks_like_cold_start_description

agents/master-coordinator/main.py:1281–1307  ·  view source on GitHub ↗

Route free-form self-descriptions to cold start only when bootstrap is actually needed.

(text: Any, profile: Optional[Dict[str, Any]] = None)

Source from the content-addressed store, hash-verified

1279
1280
1281def looks_like_cold_start_description(text: Any, profile: Optional[Dict[str, Any]] = None) -> bool:
1282 """Route free-form self-descriptions to cold start only when bootstrap is actually needed."""
1283 cleaned = first_meaningful_line(text)
1284 lowered = cleaned.lower().strip()
1285 if not lowered:
1286 return False
1287
1288 if looks_like_bot_authored_message(cleaned):
1289 return False
1290
1291 if lowered in {"冷启动", "重新冷启动", "cold start", "cold-start"}:
1292 return True
1293
1294 if any(token in lowered for token in ("初始画像", "设置方向")):
1295 return True
1296
1297 if extract_google_scholar_url(cleaned):
1298 return True
1299 if extract_homepage_url(cleaned):
1300 return True
1301
1302 if profile and not profile_needs_bootstrap(profile):
1303 return False
1304
1305 return any(token in cleaned for token in COLD_START_BOOTSTRAP_HINTS) or any(
1306 token in lowered for token in COLD_START_BOOTSTRAP_HINTS
1307 )
1308
1309
1310def should_reset_existing_profile_for_cold_start(text: Any) -> bool:

Callers 2

detect_intentMethod · 0.85

Calls 5

first_meaningful_lineFunction · 0.85
extract_homepage_urlFunction · 0.85
profile_needs_bootstrapFunction · 0.85

Tested by

no test coverage detected