mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-10 14:30:45 +08:00
修复综合模式历史会话泄漏内部指令。
将综合模式执行文本与用户落库文本彻底解耦,确保只持久化用户真实输入;同时在消息读取接口增加旧脏数据过滤,并补充回归测试,避免内部派单指令再次作为用户消息展示。 Made-with: Cursor
This commit is contained in:
parent
048e8ec1c1
commit
8b8265eb46
7 changed files with 254 additions and 12 deletions
|
|
@ -65,6 +65,7 @@ class AttemptRunnerInput:
|
|||
wire_policy_role: str | None = None
|
||||
prompt_build_context: dict[str, Any] | None = None
|
||||
turn_uuid: str | None = None
|
||||
persisted_user_text: str | None = None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
|
@ -133,6 +134,7 @@ def run_attempt(*, store: Any, data: AttemptRunnerInput) -> AttemptRunnerOutput:
|
|||
workspace_dir=data.workspace_dir,
|
||||
memory_context=data.memory_context,
|
||||
persist_user_message=bool(data.persist_user_message),
|
||||
persisted_user_text=data.persisted_user_text,
|
||||
skill_binding_role=data.skill_binding_role,
|
||||
wire_policy_role=data.wire_policy_role,
|
||||
prompt_build_context=data.prompt_build_context,
|
||||
|
|
@ -144,7 +146,7 @@ def run_attempt(*, store: Any, data: AttemptRunnerInput) -> AttemptRunnerOutput:
|
|||
session_id=data.msg.session_id,
|
||||
tenant_id=data.msg.tenant_id,
|
||||
user_id=data.msg.user_id,
|
||||
user_text=data.msg.text,
|
||||
user_text=str(data.persisted_user_text if data.persisted_user_text is not None else data.msg.text or ""),
|
||||
assistant_text=outcome.final_text,
|
||||
turn_uuid=outcome.turn_uuid,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue