mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 03:30:48 +08:00
- Add runtime/plan_agent_v2 package and shims; gateway/direct_loop/WS wiring - Admin chat: interaction mode and specialist only in user menu; session API stores memory_mode and execution_mode only - POST /admin/api/chat/user-mode mirrors plan_agent_version to AIA_EXPERT_PLAN_AGENT_V2_ENABLED (v2 to 1, v1 to 0) - Composer cleanup (hidden mode select, no reasoning toggle in meta bar); tests and _local/system.env.example Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
916 B
Python
37 lines
916 B
Python
from __future__ import annotations
|
|
|
|
import time
|
|
from typing import Any
|
|
|
|
|
|
def emit_plan_agent_v2_trace(
|
|
*,
|
|
store: Any,
|
|
session_id: str,
|
|
trace_id: str | None,
|
|
parent_span_id: str | None,
|
|
event_type: str,
|
|
payload: dict[str, Any] | None = None,
|
|
) -> None:
|
|
if not str(trace_id or "").strip():
|
|
return
|
|
merged = dict(payload or {})
|
|
merged.setdefault("pipeline", "plan_agent_v2")
|
|
merged.setdefault("ts_ms", int(time.time() * 1000))
|
|
try:
|
|
from oclaw.runtime.orchestration.trace import new_span_id
|
|
|
|
store.add_trace_event(
|
|
session_id=str(session_id or ""),
|
|
trace_id=str(trace_id),
|
|
span_id=new_span_id(),
|
|
parent_span_id=parent_span_id,
|
|
event_type=str(event_type or "plan_agent_v2"),
|
|
payload=merged,
|
|
)
|
|
except Exception:
|
|
pass
|
|
|
|
|
|
__all__ = ["emit_plan_agent_v2_trace"]
|
|
|