MCPcopy Create free account
hub / github.com/1jehuang/jcode / _load_task_hint

Function _load_task_hint

scripts/jcode_harbor_agent.py:126–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124
125
126def _load_task_hint() -> str:
127 if not os.environ.get("JCODE_HARBOR_ENABLE_HINTS"):
128 return ""
129 task_name = os.environ.get("JCODE_HARBOR_CURRENT_TASK", "").strip()
130 hints_path = os.environ.get("JCODE_HARBOR_TASK_HINTS_FILE", "").strip()
131 extra = os.environ.get("JCODE_HARBOR_EXTRA_PREAMBLE", "").strip()
132 parts: list[str] = []
133 if extra:
134 parts.append(extra)
135 if task_name and hints_path:
136 path = Path(hints_path).expanduser()
137 try:
138 hints = json.loads(path.read_text())
139 except Exception: # noqa: BLE001
140 hints = {}
141 hint = hints.get(task_name) if isinstance(hints, dict) else None
142 if isinstance(hint, str) and hint.strip():
143 parts.append(hint.strip())
144 if not parts:
145 return ""
146 return "\nAdditional benchmark retry guidance:\n" + "\n\n".join(parts) + "\n\n"
147
148
149def _load_final_payload(output_dir: Path) -> dict[str, Any] | None:

Callers 1

runMethod · 0.85

Calls 2

PathClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected