[None][feat] Import agent-flow and modeling bringup agent into TensorRT-LLM#16543
[None][feat] Import agent-flow and modeling bringup agent into TensorRT-LLM#16543WeiHaocheng wants to merge 3 commits into
Conversation
Signed-off-by: Fred Wei <20514172+WeiHaocheng@users.noreply.github.com>
Signed-off-by: Fred Wei <20514172+WeiHaocheng@users.noreply.github.com>
📝 WalkthroughWalkthroughChangesAgent Flow foundation
Estimated code review effort: 5 (Critical) | ~120 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Note
Due to the large number of review comments, Critical severity comments were prioritized as inline comments.
🟠 Major comments (31)
agent-flow/agent_flow/console.py-104-106 (1)
104-106: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winRemove the process-global stream mutation at import time.
_console_writealready recovers afterBlockingIOError; eagerly forcing stdout and stderr into blocking mode merely by importing this library can break asynchronous embedding applications.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/console.py` around lines 104 - 106, Remove the import-time invocation of _ensure_blocking_streams() so importing the library does not mutate process-global stdout or stderr state. Keep _console_write’s existing BlockingIOError recovery behavior unchanged.agent-flow/agent_flow/config.py-14-38 (1)
14-38: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftUse
StrictBaseModelfor the exported configuration classes.
BackendConfig,SessionConfig, andAgentLayerConfigare public user inputs, but dataclasses provide no runtime validation for literals or nested fields. Convert them to strict Pydantic models with field descriptions and constrained types.As per coding guidelines, “User-facing configuration classes must inherit from
StrictBaseModeland use Pydantic validation, typed fields, andFielddescriptions.”Also applies to: 62-73
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/config.py` around lines 14 - 38, Convert the public configuration classes BackendConfig, SessionConfig, and AgentLayerConfig from dataclasses to StrictBaseModel subclasses. Replace dataclass fields with Pydantic-typed fields using constrained types where appropriate and Field descriptions, while preserving existing defaults and configuration behavior; ensure nested configuration values and literal fields are validated at runtime.Source: Coding guidelines
agent-flow/agent_flow/backends/claude_code.py-385-400 (1)
385-400: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy liftDo not make unrestricted host execution the default.
Both backends disable sandboxing and approvals; Codex also accepts every current or future approval method. Model-controlled repository or PR content can therefore trigger shell and file operations with developer or CI privileges.
agent-flow/agent_flow/backends/claude_code.py#L385-L400: default to sandboxing and explicit approval; gate bypass mode behind an unsafe opt-in.agent-flow/agent_flow/backends/codex.py#L846-L866: do not blanket-accept every*/requestApproval.agent-flow/agent_flow/backends/codex.py#L895-L905: replacedanger_full_accessandneverapproval defaults with restricted settings.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/backends/claude_code.py` around lines 385 - 400, Restrict unrestricted host execution by default: in agent-flow/agent_flow/backends/claude_code.py lines 385-400, update ClaudeAgentOptions to enable sandboxing and require explicit tool approval, allowing bypass mode only through an explicit unsafe opt-in; in agent-flow/agent_flow/backends/codex.py lines 846-866, replace blanket handling of every */requestApproval with an explicit allowlist of supported approval methods; in agent-flow/agent_flow/backends/codex.py lines 895-905, replace danger_full_access and never defaults with restricted sandbox and approval settings.agent-flow/agent_flow/backends/base.py-20-26 (1)
20-26: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPropagate backend failure results instead of reporting completion.
Both backends populate
is_error,errors, and permission denials, butAgentLayer._executeonly consumestextandusage, then reports success.
agent-flow/agent_flow/backends/base.py#L20-L26: define how failed results must be surfaced.agent-flow/agent_flow/backends/claude_code.py#L245-L262: raise or return a failure the layer consumes whenis_erroris true.agent-flow/agent_flow/backends/codex.py#L511-L517: ensure collected errors and denials cannot be silently treated as completion.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/backends/base.py` around lines 20 - 26, Ensure backend failures propagate through the execution layer instead of being reported as successful completion: in agent-flow/agent_flow/backends/base.py lines 20-26, define the ResultEvent failure contract using is_error, errors, and permission_denials; in agent-flow/agent_flow/backends/claude_code.py lines 245-262, make the backend raise or return a failure that AgentLayer._execute consumes when is_error is true; and in agent-flow/agent_flow/backends/codex.py lines 511-517, propagate collected errors and permission denials so they cannot be treated as completion.agent-flow/agent_flow/console.py-113-119 (1)
113-119: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winEscape dynamic values before composing Rich markup.
Model and SDK strings containing brackets can alter rendered output or raise markup errors.
agent-flow/agent_flow/console.py#L113-L119: escape the raw layer name and suffix components.agent-flow/agent_flow/console.py#L130-L136: escape the agent label before applying badge markup.agent-flow/agent_flow/console.py#L320-L329: render exception text as escaped text.agent-flow/agent_flow/console.py#L345-L351: useTextor escape thinking content before wrapping it in a style.agent-flow/agent_flow/console.py#L401-L416: escape skill, plugin, and agent names.agent-flow/agent_flow/console.py#L548-L568: escape tool descriptions and auxiliary values.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/console.py` around lines 113 - 119, Escape all dynamic values before composing Rich markup. In agent-flow/agent_flow/console.py lines 113-119, update _layer_title to escape the raw layer name and suffix; lines 130-136, escape the agent label before badge markup; lines 320-329, render exception text as escaped text; lines 345-351, use Text or escape thinking content before styling; lines 401-416, escape skill, plugin, and agent names; and lines 548-568, escape tool descriptions and auxiliary values.agent-flow/agent_flow/backends/codex.py-783-809 (1)
783-809: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winDon’t mark the SDK patch complete if a rebuild fails
agent-flow/agent_flow/backends/codex.py:783-809
_SDK_PATCHEDis set even whencls.model_rebuild(force=True)fails, so a partial patch can be treated as complete and never retried. Let the rebuild error surface, or track per-model success before setting the flag.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/backends/codex.py` around lines 783 - 809, The SDK patch must not be marked complete when any model rebuild fails. Update the rebuild logic used by _relax_service_tier_on_module so failures propagate or are recorded, and only set _SDK_PATCHED in _patch_codex_sdk_service_tier after every affected model rebuild succeeds, allowing later calls to retry an incomplete patch.agent-flow/CLAUDE.md-1-1 (1)
1-1: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winAdd the required NVIDIA copyright header to every new file.
agent-flow/CLAUDE.md#L1-L1: prepend the repository-standard Markdown header.agent-flow/agent_flow/hooks.py#L1-L1: prepend the Python header.agent-flow/agent_flow/layers.py#L1-L1: prepend the Python header.agent-flow/agent_flow/logger.py#L1-L1: prepend the Python header.agent-flow/agent_flow/module.py#L1-L1: prepend the Python header.agent-flow/agent_flow/runtime.py#L1-L1: prepend the Python header.agent-flow/agent_flow/types.py#L1-L1: prepend the Python header.agent-flow/agent_flow/utils.py#L1-L1: prepend the Python header.agent-flow/agent_flow/workflows/__init__.py#L1-L1: prepend the Python header.agent-flow/tests/workflows/agent_team/__init__.py#L1-L1: prepend the Python header.agent-flow/tests/workflows/agent_team/test_status.py#L1-L1: prepend the Python header.As per coding guidelines, “Add the NVIDIA copyright header to all new files.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/CLAUDE.md` at line 1, All listed new files are missing the required NVIDIA copyright header. Prepend the repository-standard Markdown header to agent-flow/CLAUDE.md and the standard Python header to agent-flow/agent_flow/hooks.py, layers.py, logger.py, module.py, runtime.py, types.py, utils.py, agent-flow/agent_flow/workflows/__init__.py, agent-flow/tests/workflows/agent_team/__init__.py, and test_status.py; no other changes are required.Source: Coding guidelines
agent-flow/agent_flow/hooks.py-164-179 (1)
164-179: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy liftComplete the required function annotations.
agent-flow/agent_flow/hooks.py#L164-L179: annotate the hook arguments and async return value.agent-flow/agent_flow/layers.py#L164-L268: annotate_build_ask_human_tooland the nestedask_humanhandler.agent-flow/agent_flow/module.py#L10-L83: type_run_async, lifecycle methods, attribute values, andmodules().agent-flow/agent_flow/runtime.py#L60-L79: type the callable, arguments, and generic return values for_invoke,call, andacall.agent-flow/agent_flow/utils.py#L30-L36: replace baredictwith a precise mapping type.agent-flow/tests/workflows/agent_team/test_status.py#L11-L157: annotate helpers, fixtures, callbacks, and test returns.As per coding guidelines, “Annotate every function” and use precise types rather than unnecessary
Any.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/hooks.py` around lines 164 - 179, Complete function and value annotations across agent-flow/agent_flow/hooks.py:164-179, agent-flow/agent_flow/layers.py:164-268, agent-flow/agent_flow/module.py:10-83, agent-flow/agent_flow/runtime.py:60-79, agent-flow/agent_flow/utils.py:30-36, and agent-flow/tests/workflows/agent_team/test_status.py:11-157. Annotate _stop_hook, _build_ask_human_tool, ask_human, _run_async, lifecycle methods, module attributes, modules(), _invoke, call, acall, test helpers, fixtures, callbacks, and test returns with precise non-Any types; replace the bare dict annotation in utils.py with an explicit mapping type while preserving existing behavior.Source: Coding guidelines
agent-flow/agent_flow/module.py-85-92 (1)
85-92: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winMake resource teardown exception-safe.
A single close failure currently prevents subsequent resources from being released and leaves stale lifecycle state.
agent-flow/agent_flow/module.py#L85-L92: continue closing remaining children and the parent, preserve the first failure, and set_closedinfinally.agent-flow/agent_flow/layers.py#L320-L325: clear persistent-client references even whenAsyncExitStack.aclose()raises.agent-flow/agent_flow/layers.py#L461-L465: ensure backend__aexit__runs even when persistent-client cleanup fails.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/module.py` around lines 85 - 92, Make resource teardown exception-safe across agent-flow/agent_flow/module.py:85-92, agent-flow/agent_flow/layers.py:320-325, and agent-flow/agent_flow/layers.py:461-465. In _aclose_tree, continue closing all children and the parent after failures, preserve and re-raise the first failure, and set _closed in a finally block. In the persistent-client cleanup at layers.py:320-325, clear client references in finally even if AsyncExitStack.aclose() fails. In the backend teardown at layers.py:461-465, ensure __aexit__ runs even when persistent-client cleanup raises.agent-flow/agent_flow/layers.py-129-133 (1)
129-133: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winAssign the backend only after
__aenter__succeeds.Line 131 preserves a partially initialized backend when entry raises. The next persistent invocation then skips
__aenter__and reuses that invalid instance.Proposed fix
async def _ensure_backend(self) -> Backend: - if self._backend is None: - self._backend = create_backend(self.config.backend) - await self._backend.__aenter__() - return self._backend + if self._backend is not None: + return self._backend + + backend = create_backend(self.config.backend) + await backend.__aenter__() + self._backend = backend + return backend🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/layers.py` around lines 129 - 133, Update _ensure_backend so the newly created backend is entered before assigning it to self._backend; only persist the instance after __aenter__ succeeds, while preserving reuse of an already initialized backend.agent-flow/agent_flow/logger.py-35-40 (1)
35-40: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winMake session-log creation collision-safe.
Lines 37-39 can race during first use, while separate processes started in the same second select the same truncating path. This can split or overwrite session logs. Protect singleton creation with a lock and include a PID/UUID or microseconds in the filename.
Proposed fix
+from os import getpid +from threading import Lock + +_LOGGER_LOCK = Lock() + def get_logger() -> Logger: global _logger - if _logger is None: - timestamp = datetime.now().strftime("%Y%m%d-%H%M%S") - _logger = Logger(_LOG_DIR / f"session-{timestamp}.log") - atexit.register(_logger.close) + with _LOGGER_LOCK: + if _logger is None: + timestamp = datetime.now().strftime("%Y%m%d-%H%M%S-%f") + _logger = Logger(_LOG_DIR / f"session-{timestamp}-{getpid()}.log") + atexit.register(_logger.close) return _logger🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/logger.py` around lines 35 - 40, Update get_logger to make first-use singleton initialization thread-safe by guarding the _logger None check and creation with a lock, while preserving a single shared logger and atexit cleanup. Make the session filename unique across concurrent processes by adding the process ID, UUID, or microsecond-resolution component to the existing timestamp-based name.agent-flow/agent_flow/runtime.py-31-40 (1)
31-40: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winAlways signal the waiting caller if the worker exits on
BaseException.
runner.run()can raiseasyncio.CancelledErrorand otherBaseExceptionsubclasses, which skips theresult_queuewrite and leavescall()blocked onresult_queue.get().Proposed fix
- except Exception as exc: + except BaseException as exc: result_queue.put((False, exc))🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/runtime.py` around lines 31 - 40, Update the worker loop around runner.run() in the visible queue-processing method to catch BaseException, not only Exception, and always enqueue a failure result containing the raised exception before the worker exits or continues. Preserve the existing success signaling and sentinel handling while ensuring call() is never left waiting when runner.run() raises asyncio.CancelledError or another BaseException.agent-flow/tests/workflows/pr_review/test_discussion.py-8-16 (1)
8-16: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winAdd annotations to every helper and test function.
Annotate helper parameters/returns and add
-> Noneto each test. As per coding guidelines, “Annotate every function.” <coding_guidelines>Also applies to: 19-24, 27-39, 42-46, 49-55
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/tests/workflows/pr_review/test_discussion.py` around lines 8 - 16, Annotate every helper and test function in test_discussion.py, including _call and _tool and the functions in the referenced ranges. Add explicit parameter types and return types to helpers, and add -> None to each test function, using appropriate existing types without changing behavior.Source: Coding guidelines
agent-flow/agent_flow/workflows/agent_team/prompts/qa.py-1-32 (1)
1-32: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winExclude task-irrelevant dimensions from the weighted score.
Every task is scored on performance and systems-programming sophistication, even when
task.yamldoes not require either. With the default 8.0 floor, a correct documentation, configuration, or simple scripting task can loop indefinitely. AllowN/Adimensions and remove their weights from the denominator, or derive scoring dimensions from the task.Also applies to: 151-168
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/agent_team/prompts/qa.py` around lines 1 - 32, Update EVALUATION_CRITERIA and the QA scoring logic to support task-specific dimensions: mark criteria such as Performance and Technical Sophistication as N/A when task.yaml does not require them, exclude their weights from the weighted-score denominator, and apply the same behavior to the additional scoring path noted in the comment. Preserve scoring for applicable dimensions so simple documentation, configuration, and scripting tasks can reach the required threshold.agent-flow/agent_flow/workflows/agent_team/cli.py-15-24 (1)
15-24: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftAllow checkpoint resumes without
--task.The documented resume command supplies only
--workspace, butrequired=Truemakes argparse reject it before checkpoint detection. Make--taskoptional when resuming and require it only for a fresh run, with corresponding workflow validation/tests.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/agent_team/cli.py` around lines 15 - 24, Update the CLI argument handling in the agent_team workflow so --task is not argparse-required, allowing resume commands that provide only --workspace. During workflow validation, require --task for fresh runs but permit its absence when a checkpoint is detected; preserve task-file handling for fresh runs and add or update tests covering both paths.agent-flow/agent_flow/workflows/agent_team/README.md-1-1 (1)
1-1: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winAdd the NVIDIA copyright header to every new file.
agent-flow/agent_flow/workflows/agent_team/README.md#L1-L1: prepend the canonical Markdown header.agent-flow/agent_flow/workflows/agent_team/__init__.py#L1-L1: prepend the canonical Python header.agent-flow/agent_flow/workflows/agent_team/cli.py#L1-L1: prepend the canonical Python header.agent-flow/agent_flow/workflows/agent_team/progress.py#L1-L1: prepend the canonical Python header.agent-flow/agent_flow/workflows/agent_team/prompts/__init__.py#L1-L1: prepend the canonical Python header.agent-flow/agent_flow/workflows/agent_team/prompts/coder.py#L1-L1: prepend the canonical Python header.agent-flow/agent_flow/workflows/agent_team/prompts/plan_drafter.py#L1-L1: prepend the canonical Python header.agent-flow/agent_flow/workflows/agent_team/prompts/plan_reviewer.py#L1-L1: prepend the canonical Python header.agent-flow/agent_flow/workflows/agent_team/prompts/qa.py#L1-L1: prepend the canonical Python header.agent-flow/tests/workflows/modeling_bringup/__init__.py#L1-L1: prepend the canonical Python header.agent-flow/tests/workflows/pr_review/test_discussion.py#L1-L1: prepend the canonical Python header.As per coding guidelines, “Add the NVIDIA copyright header to all new files.” <coding_guidelines>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/agent_team/README.md` at line 1, The listed new files are missing the NVIDIA copyright header. Prepend the canonical Markdown header to agent-flow/agent_flow/workflows/agent_team/README.md (lines 1-1), and prepend the canonical Python header to agent-flow/agent_flow/workflows/agent_team/__init__.py (lines 1-1), cli.py (lines 1-1), progress.py (lines 1-1), prompts/__init__.py (lines 1-1), prompts/coder.py (lines 1-1), prompts/plan_drafter.py (lines 1-1), prompts/plan_reviewer.py (lines 1-1), prompts/qa.py (lines 1-1), agent-flow/tests/workflows/modeling_bringup/__init__.py (lines 1-1), and agent-flow/tests/workflows/pr_review/test_discussion.py (lines 1-1), preserving each file’s existing content after the header.Source: Coding guidelines
agent-flow/agent_flow/workflows/agent_team/progress.py-748-751 (1)
748-751: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winGive PlanReviewer build-progress access during replan review.
The PlanReviewer prompt requires detecting criteria softened after a QA failure, but this bundle exposes only
plan_stage. Inplan_drafter_replan_on_qamode, also provideread_latest_build_progress; otherwise the reviewer must trust the drafter’s summary and cannot enforce the gate independently.Proposed fix
+ plan_reviewer_tools = [ + append_plan_reviewer_progress, + _make_read_tool("plan_reviewer"), + ] + if plan_drafter_replan_on_qa: + plan_reviewer_tools.append(_make_build_read_tool("plan_reviewer")) + return { "plan_drafter": plan_drafter_tools, - "plan_reviewer": [ - append_plan_reviewer_progress, - _make_read_tool("plan_reviewer"), - ], + "plan_reviewer": plan_reviewer_tools,🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/agent_team/progress.py` around lines 748 - 751, Update the plan_reviewer tool bundle to include read_latest_build_progress when the workflow is in plan_drafter_replan_on_qa mode, while preserving the existing append_plan_reviewer_progress and plan_reviewer read-tool entries. Ensure the PlanReviewer can independently inspect the latest build progress during replan review.agent-flow/agent_flow/workflows/agent_team/workflow.py-1296-1305 (1)
1296-1305: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winDo not reject documented, criteria-compliant plan deviations.
The reviewer system contract explicitly permits documented deviations when
task.yamland all acceptance criteria still hold, but this invocation says to reject runtime behavior that contradicts the plan. That conflict can cause unnecessary rejection loops. Gate ontask.yamland acceptance criteria instead.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/agent_team/workflow.py` around lines 1296 - 1305, Update the reviewer instructions in the agent-team workflow prompt to evaluate implementation results against task.yaml and all acceptance criteria, rather than rejecting every documented deviation from the plan. Preserve rejection for failed builds/tests, contradictory runtime behavior, or unmet criteria, while allowing documented deviations that remain criteria-compliant.agent-flow/agent_flow/workflows/agent_team/workflow.py-686-724 (1)
686-724: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRestore the checkpointed iteration budget on resume.
load_state()returns the savednum_iterations, but execution continues using the constructor value. For example, resuming iteration 150 of a 200-iteration checkpoint with the default 100 produces an empty loop and lines 420-424 silently mark the unfinished workflow done. Restore or explicitly reconcile the saved budget before entering the loop.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/agent_team/workflow.py` around lines 686 - 724, Restore the checkpointed iteration budget immediately after load_state(self.state_path) in the resume flow, assigning the saved state.num_iterations to self.num_iterations before any completion or build-loop decisions. Ensure the existing feedback-extension logic in the resume branch still extends that restored budget when needed, so unfinished workflows continue from state.next_iteration_index instead of being marked complete by an empty loop.agent-flow/agent_flow/workflows/modeling_bringup/prompts/qa_extra.py-128-138 (1)
128-138: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winReserve
Status: ACCEPTfor terminal workflow acceptance.In replan mode, QA can APPROVE an intermediate Stage, so this rule writes a terminal-looking ACCEPT report while later Stages remain pending. Use an in-progress status for intermediate approvals and emit ACCEPT only after the final Stage passes.
Also applies to: 268-269
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/modeling_bringup/prompts/qa_extra.py` around lines 128 - 138, Update the final-report status logic in the QA prompt around the final-report contract so intermediate Stage approvals during replan mode use an in-progress status rather than ACCEPT. Emit Status: ACCEPT only when the final Stage has passed and the workflow is terminal, while preserving INCOMPLETE for budget exhaustion and writing the report before append_qa_progress on every turn.agent-flow/agent_flow/workflows/modeling_bringup/prompts/_common.py-90-94 (1)
90-94: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winDo not convert every probe failure into “skill unavailable.”
Catching
Exceptionalso suppresses programming errors incheck_skill_via_agent_layeror probe result handling, silently removing the only sanctioned test runner from all prompts. Catch the documented backend/session failures specifically and let unexpected defects surface.As per coding guidelines, “Catch the narrowest possible exceptions.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/modeling_bringup/prompts/_common.py` around lines 90 - 94, Update the exception handling around check_skill_via_agent_layer in the skill-detection flow to catch only the documented backend or session failure exceptions. Continue returning an empty string for those expected failures, but let programming errors from probing or probe result handling propagate instead of treating the skill as unavailable.Source: Coding guidelines
agent-flow/agent_flow/workflows/modeling_bringup/prompts/_common.py-332-340 (1)
332-340: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winAlign architecture-conflict guidance with the QA-driven replan path.
The shared root cause is unconditional text claiming that no programmatic replan exists, even though
--replan-on-qaintroduces one.
agent-flow/agent_flow/workflows/modeling_bringup/prompts/_common.py#L332-L340: distinguish ordinary mode from Stage/Goal replan mode.agent-flow/agent_flow/workflows/modeling_bringup/prompts/_common.py#L407-L416: route unresolved hard-path conflicts through Failed Goal and QA rejection when replan is enabled.agent-flow/agent_flow/workflows/modeling_bringup/prompts/reviewer_extra.py#L52-L59: avoid instructing the Reviewer to wait exclusively for out-of-band human action in replan mode.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/modeling_bringup/prompts/_common.py` around lines 332 - 340, Update the architecture-conflict guidance in _common.py at lines 332-340 to distinguish ordinary mode from --replan-on-qa Stage/Goal replan mode, preserving the hard-blocker guidance only when no programmatic replan exists. In _common.py lines 407-416, route unresolved hard-path conflicts through Failed Goal and QA rejection when replan is enabled. In reviewer_extra.py lines 52-59, revise Reviewer guidance so replan mode does not require waiting exclusively for out-of-band human action.agent-flow/agent_flow/workflows/modeling_bringup/prompts/plan_drafter_extra.py-299-311 (1)
299-311: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftDo not replace an unmet user criterion with a weaker success criterion.
The gap-fix flow may lower a task-defined threshold to an empirically achievable value, then treats approval of that replacement as resolving the original QA rejection. This can return
DONEeven thoughtask.yaml’s completion criterion never passed. Keep the original gate authoritative; an unattainable gate should end as incomplete or require explicit human amendment of the task specification.Also applies to: 355-363
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/modeling_bringup/prompts/plan_drafter_extra.py` around lines 299 - 311, The gap-fix planning flow must keep the original task.yaml completion criterion authoritative rather than replacing it with an empirically achievable weaker threshold. Update the Goal and Stage acceptance handling in the prompt definitions around the gap-fix instructions so approval of a replacement criterion cannot produce DONE unless the original gate passes or receives explicit human amendment; otherwise conclude as incomplete.agent-flow/agent_flow/workflows/modeling_bringup/prompts/_common.py-97-97 (1)
97-97: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftKeep the backend probe out of module import.
This assignment immediately invokes the cached getter, contradicting Lines 23-25 and potentially starting Claude/Codex sessions whenever any prompt module is imported. Resolve the invocation inside
build_modeling_bringup_promptsinstead.Proposed direction
-TRTLLM_TEST_SPECIALIST_INVOCATION = get_trtllm_test_specialist_invocation()Then call
get_trtllm_test_specialist_invocation()when constructing the prompt bundle.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/modeling_bringup/prompts/_common.py` at line 97, Remove the module-level invocation assigned to TRTLLM_TEST_SPECIALIST_INVOCATION, and call get_trtllm_test_specialist_invocation() inside build_modeling_bringup_prompts while constructing the prompt bundle. Preserve the existing prompt content and ensure the backend probe occurs only when that builder function runs, not during module import.agent-flow/agent_flow/workflows/modeling_bringup/prompts/reviewer_extra.py-161-162 (1)
161-162: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRemove the reopened-Goal reset instruction.
Later rules explicitly make QA-rejected CLOSED Stages and their Goals immutable and require a new gap-fix Stage. Telling the Reviewer to reset “reopened Goal(s)” introduces an incompatible state transition.
Proposed fix
-- On QA REJECT (replan mode) or a Stage roll-back, reset the - reopened Goal(s) to `(iterations=0)`.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/modeling_bringup/prompts/reviewer_extra.py` around lines 161 - 162, Remove the instruction requiring reopened Goals to be reset to iterations=0 during QA REJECT replan mode or Stage rollback in the reviewer prompt. Preserve the later rules that keep QA-rejected CLOSED Stages and their Goals immutable and require a new gap-fix Stage.agent-flow/agent_flow/workflows/pr_review/progress.py-101-107 (1)
101-107: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winValidate each persisted progress entry before returning it.
A YAML stage such as
stage1: [broken]passes this validation, then crashes infind_entriesate.get(...)ore["round"]. Validate that every item is a mapping with a valid agent, integer round, and decision so corrupted workspaces fail with a clearValueError.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/pr_review/progress.py` around lines 101 - 107, Extend the progress-entry validation in the loop processing _STAGES before assigning result[key]. For every item, require a mapping containing a valid agent, an integer round, and a decision; raise a clear ValueError including the path, stage key, and invalid entry details when any check fails, while preserving valid entries unchanged.agent-flow/agent_flow/workflows/pr_review/prompts/coder.py-26-26 (1)
26-26: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winUse one consistent final-tool ordering.
Both agents are told to call
append_*_progressand thenupdate_discussion, while also being told thatappend_*_progressmust be their last action. Update the discussion first and append progress last.
agent-flow/agent_flow/workflows/pr_review/prompts/coder.py#L26-L26: reverse the two tool calls.agent-flow/agent_flow/workflows/pr_review/prompts/coder.py#L75-L79: explicitly requireupdate_discussionbefore the final progress call.agent-flow/agent_flow/workflows/pr_review/prompts/reviewer.py#L24-L26: reverse the two tool calls.agent-flow/agent_flow/workflows/pr_review/prompts/reviewer.py#L67-L70: explicitly requireupdate_discussionbefore the final progress call.agent-flow/tests/workflows/pr_review/test_prompts.py#L112-L147: assert this ordering in both generated prompts.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/pr_review/prompts/coder.py` at line 26, Make the final-tool ordering consistent: in agent-flow/agent_flow/workflows/pr_review/prompts/coder.py lines 26 and agent-flow/agent_flow/workflows/pr_review/prompts/reviewer.py lines 24-26, instruct agents to call update_discussion before append_*_progress; in coder.py lines 75-79 and reviewer.py lines 67-70, explicitly state that the progress call is the final action. Update agent-flow/tests/workflows/pr_review/test_prompts.py lines 112-147 to assert this ordering in both generated prompts.agent-flow/agent_flow/workflows/pr_review/README.md-1-1 (1)
1-1: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winAdd the required NVIDIA copyright header to every new file.
agent-flow/agent_flow/workflows/pr_review/README.md#L1-L1: prepend the documentation-file header.agent-flow/agent_flow/workflows/pr_review/__init__.py#L1-L1: prepend the Python header.agent-flow/agent_flow/workflows/pr_review/cli.py#L1-L1: prepend the Python header.agent-flow/agent_flow/workflows/pr_review/discussion.py#L1-L1: prepend the Python header.agent-flow/agent_flow/workflows/pr_review/progress.py#L1-L1: prepend the Python header.agent-flow/agent_flow/workflows/pr_review/prompts/__init__.py#L1-L1: prepend the Python header.agent-flow/agent_flow/workflows/pr_review/prompts/_common.py#L1-L1: prepend the Python header.agent-flow/agent_flow/workflows/pr_review/prompts/coder.py#L1-L1: prepend the Python header.agent-flow/agent_flow/workflows/pr_review/prompts/reviewer.py#L1-L1: prepend the Python header.agent-flow/tests/workflows/pr_review/test_progress.py#L1-L1: prepend the Python header.agent-flow/tests/workflows/pr_review/test_prompts.py#L1-L1: prepend the Python header.As per coding guidelines, “Add the NVIDIA copyright header to all new files.” <coding_guidelines>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/pr_review/README.md` at line 1, Add the standard NVIDIA copyright header at the beginning of every listed new file: agent-flow/agent_flow/workflows/pr_review/README.md (1-1), agent-flow/agent_flow/workflows/pr_review/__init__.py (1-1), cli.py (1-1), discussion.py (1-1), progress.py (1-1), prompts/__init__.py (1-1), prompts/_common.py (1-1), prompts/coder.py (1-1), prompts/reviewer.py (1-1), agent-flow/tests/workflows/pr_review/test_progress.py (1-1), and agent-flow/tests/workflows/pr_review/test_prompts.py (1-1). Use the documentation header for README.md and the Python header for each .py file, preserving all existing content after the header.Source: Coding guidelines
agent-flow/agent_flow/workflows/pr_review/cli.py-20-26 (1)
20-26: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winMake
targetthe required positional argument documented by the CLI.The README invokes
pr-review 1234, but this parser only accepts--target 1234. It also delays the missing-target error until workflow construction.Proposed fix
parser.add_argument( - "--target", + "target", help="The GitHub PR or GitLab MR to review — a number or URL. The "🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/pr_review/cli.py` around lines 20 - 26, Update the CLI parser’s target argument in the argument-parser setup to be a required positional argument named target, replacing the optional --target flag. Preserve the existing help text and ensure downstream workflow construction continues reading the parsed target value directly.agent-flow/agent_flow/workflows/pr_review/workflow.py-159-162 (1)
159-162: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftBind checkpoints to the requested repository and PR/MR.
An explicit workspace containing an old checkpoint is resumed regardless of the current
repoandtarget. Reusing it for another review silently loads stalepr_context.mdand can review the wrong branch or repository.Persist the resolved repository and identifier in
WorkflowState, then reject mismatches on resume with guidance to use--clean.Also applies to: 373-382
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/pr_review/workflow.py` around lines 159 - 162, Bind checkpoint state to the requested repository and target by persisting the resolved repo and PR/MR identifier in WorkflowState when creating or saving checkpoints. In the resume logic around self.resume and the workflow state loading path, compare those stored values with the current repo and target; reject mismatches with a clear message directing the user to use --clean, while preserving resume behavior for matching checkpoints.agent-flow/agent_flow/workflows/pr_review/vcs.py-128-136 (1)
128-136: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winShell-quote the repository path and base ref.
This command is executed by agents through a shell, but
diff_base_refis unquoted and double quotes do not neutralize$(), backticks, or embedded quotes inrepo. Valid local paths/ref names can therefore break or inject into the command.Proposed fix
import os +import shlex import shutil- repo_q = repo - return f'git -C "{repo_q}" diff "$(git -C "{repo_q}" merge-base {diff_base_ref} HEAD)"' + repo_q = shlex.quote(str(repo)) + ref_q = shlex.quote(diff_base_ref) + return f'git -C {repo_q} diff "$(git -C {repo_q} merge-base {ref_q} HEAD)"'🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/pr_review/vcs.py` around lines 128 - 136, Update diff_command to shell-quote both repo and diff_base_ref safely for every git invocation, including the nested merge-base command; use a standard argument-quoting mechanism rather than manual interpolation, while preserving the existing merge-base diff behavior and support for paths containing spaces or shell metacharacters.
🧹 Nitpick comments (3)
agent-flow/agent_flow/backends/base.py (1)
84-94: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftDefine precise shared types for the backend client contract.
Raw
list,dict, andAnyprevent validation of tools, hooks, and MCP server configurations across implementations. Introduce shared aliases or protocols and reuse them in each backend.As per coding guidelines, “Annotate every function, avoid
Any, and prefer precise built-in generic types.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/backends/base.py` around lines 84 - 94, Update the abstract BackendBase.create_client contract to replace raw list, dict, and Any annotations with shared precise aliases or protocols for tools, hooks, and extra MCP server configurations. Define or reuse those shared types consistently across backend implementations, while preserving the existing optional parameters and AsyncIterator[BackendClient] return contract.Source: Coding guidelines
agent-flow/agent_flow/workflows/agent_team/state.py (1)
133-144: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the broad
Exceptionhandler.Use
finallyfor unconditional temporary-file cleanup so unexpected exceptions still propagate without broad interception. As per coding guidelines, catch the narrowest possible exceptions instead of broadExceptionhandlers.Proposed refactor
+from contextlib import suppress + try: with os.fdopen(fd, "w", encoding="utf-8") as fh: json.dump(payload, fh, indent=2) fh.flush() os.fsync(fh.fileno()) os.replace(tmp_path, path) - except Exception: - try: + finally: + with suppress(FileNotFoundError): os.unlink(tmp_path) - except FileNotFoundError: - pass - raise🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/agent_flow/workflows/agent_team/state.py` around lines 133 - 144, Update the temporary-file handling around the atomic write flow to remove the broad Exception handler and move cleanup of tmp_path into a finally block. Keep os.replace after the successful write, ensure cleanup is attempted unconditionally while tolerating FileNotFoundError, and allow all other exceptions to propagate naturally.Source: Coding guidelines
agent-flow/tests/helpers.py (1)
26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftComplete function annotations across the new test suite.
agent-flow/tests/helpers.py#L26-L26: annotate async generators and context-manager methods.agent-flow/tests/test_agent_layer.py#L38-L38: add-> Noneto tests and type local callbacks.agent-flow/tests/test_backends.py#L45-L46: annotate fake SDK methods, helpers, and tests.agent-flow/tests/test_console.py#L19-L19: type fixture parameters and add test return types.agent-flow/tests/test_examples.py#L10-L10: type the module loader and tests.agent-flow/tests/test_hooks.py#L69-L69: add test return types and precise mapping types.agent-flow/tests/workflows/agent_team/test_progress.py#L17-L18: type loaders, stubs, and callbacks.agent-flow/tests/workflows/agent_team/test_workflow.py#L14-L15: type workflow helpers and tests.agent-flow/tests/workflows/modeling_bringup/test_workflow.py#L16-L17: type loaders, fixtures, and callbacks.agent-flow/tests/workflows/pr_review/test_workflow.py#L18-L26: type seeded fixtures and nested agent callbacks.As per coding guidelines, “Annotate every function; use
Nonefor non-returning functions.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agent-flow/tests/helpers.py` at line 26, Complete annotations across all affected test helpers and tests: in agent-flow/tests/helpers.py lines 26-26, annotate send_message and its async-generator/context-manager methods; in agent-flow/tests/test_agent_layer.py lines 38-38, add test return annotations and type local callbacks; in agent-flow/tests/test_backends.py lines 45-46, annotate fake SDK methods, helpers, and tests; in agent-flow/tests/test_console.py lines 19-19, type fixture parameters and test returns; in agent-flow/tests/test_examples.py lines 10-10, type the module loader and tests; in agent-flow/tests/test_hooks.py lines 69-69, add test return annotations and precise mapping types; in agent-flow/tests/workflows/agent_team/test_progress.py lines 17-18, type loaders, stubs, and callbacks; in agent-flow/tests/workflows/agent_team/test_workflow.py lines 14-15, type workflow helpers and tests; in agent-flow/tests/workflows/modeling_bringup/test_workflow.py lines 16-17, type loaders, fixtures, and callbacks; and in agent-flow/tests/workflows/pr_review/test_workflow.py lines 18-26, type seeded fixtures and nested agent callbacks. Annotate every function, using None for non-returning functions.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2aae166e-84bb-4cfb-9131-89136471b61a
⛔ Files ignored due to path filters (6)
agent-flow/agent_flow/workflows/agent_team/docs/agent-team-workflow.svgis excluded by!**/*.svgagent-flow/agent_flow/workflows/agent_team/docs/agent-team.svgis excluded by!**/*.svgagent-flow/agent_flow/workflows/modeling_bringup/docs/modeling-agent-workflow.svgis excluded by!**/*.svgagent-flow/agent_flow/workflows/modeling_bringup/docs/workflow-container.svgis excluded by!**/*.svgagent-flow/agent_flow/workflows/modeling_bringup/docs/workflow-slurm-mode.svgis excluded by!**/*.svgagent-flow/agent_flow/workflows/modeling_bringup/docs/workflow.svgis excluded by!**/*.svg
📒 Files selected for processing (90)
agent-flow/.gitignoreagent-flow/.pre-commit-config.yamlagent-flow/AGENTS.mdagent-flow/CLAUDE.mdagent-flow/README.mdagent-flow/agent_flow/__init__.pyagent-flow/agent_flow/backends/__init__.pyagent-flow/agent_flow/backends/base.pyagent-flow/agent_flow/backends/claude_code.pyagent-flow/agent_flow/backends/codex.pyagent-flow/agent_flow/config.pyagent-flow/agent_flow/console.pyagent-flow/agent_flow/hooks.pyagent-flow/agent_flow/layers.pyagent-flow/agent_flow/logger.pyagent-flow/agent_flow/module.pyagent-flow/agent_flow/runtime.pyagent-flow/agent_flow/types.pyagent-flow/agent_flow/utils.pyagent-flow/agent_flow/workflows/__init__.pyagent-flow/agent_flow/workflows/agent_team/README.mdagent-flow/agent_flow/workflows/agent_team/__init__.pyagent-flow/agent_flow/workflows/agent_team/cli.pyagent-flow/agent_flow/workflows/agent_team/progress.pyagent-flow/agent_flow/workflows/agent_team/prompts/__init__.pyagent-flow/agent_flow/workflows/agent_team/prompts/coder.pyagent-flow/agent_flow/workflows/agent_team/prompts/plan_drafter.pyagent-flow/agent_flow/workflows/agent_team/prompts/plan_reviewer.pyagent-flow/agent_flow/workflows/agent_team/prompts/qa.pyagent-flow/agent_flow/workflows/agent_team/prompts/reviewer.pyagent-flow/agent_flow/workflows/agent_team/state.pyagent-flow/agent_flow/workflows/agent_team/status.pyagent-flow/agent_flow/workflows/agent_team/workflow.pyagent-flow/agent_flow/workflows/modeling_bringup/README.mdagent-flow/agent_flow/workflows/modeling_bringup/__init__.pyagent-flow/agent_flow/workflows/modeling_bringup/cli.pyagent-flow/agent_flow/workflows/modeling_bringup/prompts/__init__.pyagent-flow/agent_flow/workflows/modeling_bringup/prompts/_common.pyagent-flow/agent_flow/workflows/modeling_bringup/prompts/coder_extra.pyagent-flow/agent_flow/workflows/modeling_bringup/prompts/plan_drafter_extra.pyagent-flow/agent_flow/workflows/modeling_bringup/prompts/plan_reviewer_extra.pyagent-flow/agent_flow/workflows/modeling_bringup/prompts/qa_extra.pyagent-flow/agent_flow/workflows/modeling_bringup/prompts/reviewer_extra.pyagent-flow/agent_flow/workflows/modeling_bringup/quick_start.mdagent-flow/agent_flow/workflows/modeling_bringup/task.example.yamlagent-flow/agent_flow/workflows/modeling_bringup/task.slurm.example.yamlagent-flow/agent_flow/workflows/modeling_bringup/task_schema.pyagent-flow/agent_flow/workflows/pr_review/README.mdagent-flow/agent_flow/workflows/pr_review/__init__.pyagent-flow/agent_flow/workflows/pr_review/cli.pyagent-flow/agent_flow/workflows/pr_review/discussion.pyagent-flow/agent_flow/workflows/pr_review/progress.pyagent-flow/agent_flow/workflows/pr_review/prompts/__init__.pyagent-flow/agent_flow/workflows/pr_review/prompts/_common.pyagent-flow/agent_flow/workflows/pr_review/prompts/coder.pyagent-flow/agent_flow/workflows/pr_review/prompts/reviewer.pyagent-flow/agent_flow/workflows/pr_review/prompts/sourcing.pyagent-flow/agent_flow/workflows/pr_review/sourcing.pyagent-flow/agent_flow/workflows/pr_review/state.pyagent-flow/agent_flow/workflows/pr_review/vcs.pyagent-flow/agent_flow/workflows/pr_review/workflow.pyagent-flow/examples/human_in_the_loop.pyagent-flow/examples/planner_generator_evaluator_workflow.pyagent-flow/examples/quick_start.pyagent-flow/pyproject.tomlagent-flow/tests/__init__.pyagent-flow/tests/conftest.pyagent-flow/tests/helpers.pyagent-flow/tests/test_agent_layer.pyagent-flow/tests/test_backends.pyagent-flow/tests/test_console.pyagent-flow/tests/test_examples.pyagent-flow/tests/test_hooks.pyagent-flow/tests/test_module_composition.pyagent-flow/tests/test_sessions.pyagent-flow/tests/workflows/__init__.pyagent-flow/tests/workflows/agent_team/__init__.pyagent-flow/tests/workflows/agent_team/test_progress.pyagent-flow/tests/workflows/agent_team/test_status.pyagent-flow/tests/workflows/agent_team/test_workflow.pyagent-flow/tests/workflows/modeling_bringup/__init__.pyagent-flow/tests/workflows/modeling_bringup/test_workflow.pyagent-flow/tests/workflows/pr_review/__init__.pyagent-flow/tests/workflows/pr_review/test_discussion.pyagent-flow/tests/workflows/pr_review/test_progress.pyagent-flow/tests/workflows/pr_review/test_prompts.pyagent-flow/tests/workflows/pr_review/test_sourcing.pyagent-flow/tests/workflows/pr_review/test_state.pyagent-flow/tests/workflows/pr_review/test_vcs.pyagent-flow/tests/workflows/pr_review/test_workflow.py
| f"Read `{self.pr_context_path}` for the PR/MR under review and the " | ||
| f"exact diff command. Run that command — and read the changed " | ||
| f"files and build/run/test as needed — to judge the **current** " | ||
| f"change (it includes the coder's uncommitted edits from earlier " | ||
| f"rounds).\n\n" |
There was a problem hiding this comment.
🔒 Security & Privacy | 🔴 Critical | 🏗️ Heavy lift
Sandbox execution of code from the PR/MR branch.
These prompts direct agents to build, run, and test attacker-controlled PR code in the operator environment. A malicious test, build script, package hook, or executable can therefore achieve code execution with the workflow user's credentials.
Run these actions in an isolated disposable environment with restricted credentials/network/filesystem access, or require explicit confirmation before executing repository code.
Also applies to: 527-535
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@agent-flow/agent_flow/workflows/pr_review/workflow.py` around lines 500 -
504, Update the workflow prompts around the PR/MR inspection instructions and
the corresponding section at lines 527-535 to prohibit unsandboxed execution of
repository-controlled code. Require agents to use an isolated disposable
environment with restricted credentials, network, and filesystem access, or
obtain explicit user confirmation before running build, test, or other
executable commands.
[None][feat] Import agent-flow and modeling bringup agent into TensorRT-LLM
PR description:
Description
This PR vendors agent-flow — a lightweight, torch-like framework for composing agent-backed
"layers" — into the repository under a new top-level
agent-flow/directory, together withready-to-run multi-agent workflows aimed at automating TensorRT-LLM development, most notably a
modeling bring-up agent for onboarding new models.
Summary by CodeRabbit
New Features
Documentation