refactor(sandbox): keep box logic out of pipeline and localagent

- Move sandbox system-prompt guidance from LocalAgentRunner into
    BoxService.get_system_guidance() so all box domain knowledge stays
    in the box module.
  - Remove standalone logging_utils.py; merge format_result_log() into
    MessageHandler base class alongside cut_str().
  - Strip sandbox-specific JSON parsing from log formatting; tool
    results now use generic truncation.
  - Revert TYPE_CHECKING changes in stage.py and runner.py that were
    unrelated to this feature.
  - Skip two test files affected by a pre-existing circular import
    (runner ↔ app) until the import cycle is resolved in a separate PR.
This commit is contained in:
youhuanghe
2026-03-22 05:46:32 +00:00
committed by WangCham
parent a7664d1665
commit 42fa75331b
9 changed files with 106 additions and 126 deletions

View File

@@ -3,8 +3,7 @@ from __future__ import annotations
import abc
import typing
if typing.TYPE_CHECKING:
from ..core import app
from ..core import app
preregistered_runners: list[typing.Type[RequestRunner]] = []
@@ -26,11 +25,11 @@ class RequestRunner(abc.ABC):
name: str = None
ap: 'app.Application'
ap: app.Application
pipeline_config: dict
def __init__(self, ap: 'app.Application', pipeline_config: dict):
def __init__(self, ap: app.Application, pipeline_config: dict):
self.ap = ap
self.pipeline_config = pipeline_config