更新了langgraph-plan-view,支持windows下使用 langgraph cli;更新了langgraph-vivado-install,要求安装langgraph cli,确定conda环境的名称为langgraph

This commit is contained in:
Myfro9
2026-05-25 13:13:00 +08:00
parent fda6c9a114
commit 48b965ec4e
9 changed files with 980 additions and 145 deletions
+21 -2
View File
@@ -1,15 +1,30 @@
from __future__ import annotations
import sys
from pathlib import Path
import re
from typing import TypedDict
from langchain_core.runnables import RunnableConfig
from langgraph.graph import END, START, StateGraph
from langgraph.types import interrupt
from agents import AgentRunner
def _default_review_cmd() -> list[str]:
"""Return the real review_task.py command using the current interpreter."""
review_py = Path(__file__).parent / "review_task.py"
return [
sys.executable,
str(review_py),
"$task_path",
"$latest_discuss_path",
"$codex_session_id",
"$work_dir",
]
class WorkflowState(TypedDict):
task_id: str
user_prompt: str
@@ -129,7 +144,7 @@ def values_from_state(state: WorkflowState) -> dict[str, str]:
}
def build_workflow(runner: AgentRunner, *, checkpointer=None):
def build_workflow(*, checkpointer=None):
graph = StateGraph(WorkflowState)
def initialize(state: WorkflowState) -> WorkflowState:
@@ -163,7 +178,11 @@ def build_workflow(runner: AgentRunner, *, checkpointer=None):
validate_task_file(state["task_path"])
return state
def review(state: WorkflowState) -> WorkflowState:
def review(state: WorkflowState, config: RunnableConfig) -> WorkflowState:
cfg = config.get("configurable", {})
codex_cmd: list[str] = cfg.get("codex_review_command") or _default_review_cmd()
timeout: int = int(cfg.get("codex_timeout", 600))
runner = AgentRunner(codex_review_command=codex_cmd, timeout=timeout)
result = runner.review(values_from_state(state))
updates = {
**state,