oh-langfuse 0.1.77 → 0.1.78
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/codex_langfuse_notify.py +18 -5
- package/langfuse_hook.py +18 -5
- package/package.json +1 -1
- package/scripts/opencode-langfuse-setup.mjs +1671 -1604
package/codex_langfuse_notify.py
CHANGED
|
@@ -238,12 +238,25 @@ def collect_repo_context(cwd: Optional[str], cwd_source: str = "unavailable") ->
|
|
|
238
238
|
return context
|
|
239
239
|
context["git_root"] = root
|
|
240
240
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
remote_context: Dict[str, str] = {}
|
|
242
|
+
remote_error = ""
|
|
243
|
+
for remote_name in ("origin", "gitcode", "upstream"):
|
|
244
|
+
ok_remote, remote, remote_error = run_git_command(cwd_text, ["config", "--get", f"remote.{remote_name}.url"])
|
|
245
|
+
if ok_remote and remote:
|
|
246
|
+
remote_context = sanitize_git_remote(remote)
|
|
247
|
+
if remote_context.get("git_remote"):
|
|
248
|
+
break
|
|
249
|
+
remote_context = {}
|
|
250
|
+
if not remote_context.get("git_remote"):
|
|
251
|
+
ok_list, remotes_raw, list_error = run_git_command(cwd_text, ["remote"])
|
|
252
|
+
if ok_list and remotes_raw:
|
|
253
|
+
first_remote = remotes_raw.splitlines()[0].strip() if remotes_raw.strip() else ""
|
|
254
|
+
if first_remote:
|
|
255
|
+
ok_remote, remote, remote_error = run_git_command(cwd_text, ["config", "--get", f"remote.{first_remote}.url"])
|
|
256
|
+
if ok_remote and remote:
|
|
257
|
+
remote_context = sanitize_git_remote(remote)
|
|
258
|
+
if remote_context.get("git_remote"):
|
|
244
259
|
context.update(remote_context)
|
|
245
|
-
if not remote_context["git_remote"]:
|
|
246
|
-
context["git_context_error"] = "remote_parse_failed"
|
|
247
260
|
elif remote_error in ("timeout", "git_unavailable"):
|
|
248
261
|
context["git_context_available"] = False
|
|
249
262
|
context["git_context_error"] = remote_error
|
package/langfuse_hook.py
CHANGED
|
@@ -228,12 +228,25 @@ def collect_repo_context(cwd: Optional[str], cwd_source: str = "unavailable") ->
|
|
|
228
228
|
return context
|
|
229
229
|
context["git_root"] = root
|
|
230
230
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
remote_context: Dict[str, str] = {}
|
|
232
|
+
remote_error = ""
|
|
233
|
+
for remote_name in ("origin", "gitcode", "upstream"):
|
|
234
|
+
ok_remote, remote, remote_error = run_git_command(cwd_text, ["config", "--get", f"remote.{remote_name}.url"])
|
|
235
|
+
if ok_remote and remote:
|
|
236
|
+
remote_context = sanitize_git_remote(remote)
|
|
237
|
+
if remote_context.get("git_remote"):
|
|
238
|
+
break
|
|
239
|
+
remote_context = {}
|
|
240
|
+
if not remote_context.get("git_remote"):
|
|
241
|
+
ok_list, remotes_raw, list_error = run_git_command(cwd_text, ["remote"])
|
|
242
|
+
if ok_list and remotes_raw:
|
|
243
|
+
first_remote = remotes_raw.splitlines()[0].strip() if remotes_raw.strip() else ""
|
|
244
|
+
if first_remote:
|
|
245
|
+
ok_remote, remote, remote_error = run_git_command(cwd_text, ["config", "--get", f"remote.{first_remote}.url"])
|
|
246
|
+
if ok_remote and remote:
|
|
247
|
+
remote_context = sanitize_git_remote(remote)
|
|
248
|
+
if remote_context.get("git_remote"):
|
|
234
249
|
context.update(remote_context)
|
|
235
|
-
if not remote_context["git_remote"]:
|
|
236
|
-
context["git_context_error"] = "remote_parse_failed"
|
|
237
250
|
elif remote_error in ("timeout", "git_unavailable"):
|
|
238
251
|
context["git_context_available"] = False
|
|
239
252
|
context["git_context_error"] = remote_error
|