Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
32933a3
🐛 Fix(evaluation): run trials in runtime service (#3954)
cj2026-bit Sep 20, 2026
4733202
Fix/override delete (#3958)
lijiayang619 Sep 20, 2026
3adf163
cherry-pick: HITL bugfixes from PR #3948 into hotfix/v2.6.1 (#3959)
bernard1234 Sep 20, 2026
5ed736d
🐛 Bugfix: Fixed an issue where the sandbox container user lacked the …
YehongPan Sep 20, 2026
293a422
Fix: dispatch ModelEngine provider listing to the dedicated ModelEngi…
lijiayang619 Sep 20, 2026
4771252
[codex] fix(agent): silently retry transient model errors (#3965)
JasonW404 Sep 20, 2026
a5f7a83
Fix: AIDP knowledge base bug fix (#3967)
gs-aion Sep 20, 2026
0a05772
Fix: editing a ModelEngine model no longer flips ssl_verify to True -…
Sep 20, 2026
3125e4e
refactor: extract MODEL_ENGINE_URL_MARKER constant (SonarCloud S1192)…
Sep 20, 2026
6c35526
Merge pull request #3968 from ModelEngine-Group/fix/modelengine-ssl-v…
lijiayang619 Sep 20, 2026
10b38b9
[fix] enforce explicit CodeAgent termination and silent recovery (#3969)
JasonW404 Sep 20, 2026
407ddac
cherry-pick: HITL reliability fixes from PR #3977 into hotfix/v2.6.1 …
bernard1234 Sep 21, 2026
05e542b
Fix: drop unrelated AIDP interface refactor from the AIDP knowledge b…
gs-aion Sep 21, 2026
28d0ebd
fix(agent): accept reasoning-prefixed code actions (#3990)
JasonW404 Sep 21, 2026
3f467e3
refactor: remove human interaction features and related configuration…
Dallas98 Sep 21, 2026
3587012
merge(main): merge v2.6.1 hotfixes from hotfix/v2.6.1 (round 4)
Zzzxxxxy Sep 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions backend/apps/agent_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
check_skill_conflicts_impl,
)
from services.prompt_service import generate_guardrail_rules_impl
from services.human_interaction.models import InteractionError
from services.knowledge_scope_service import get_agent_knowledge_capabilities
from services.agent_draft_permission_service import AgentDraftEditError
from services.nl2agent_service import Nl2AgentDraftSaveError, create_nl2agent_stream
Expand Down Expand Up @@ -154,8 +153,6 @@
authorization=authorization,
resume=resume,
)
except InteractionError as exc:
raise HTTPException(status_code=exc.status_code, detail=str(exc)) from exc
except ForbiddenError as e:
raise HTTPException(status_code=HTTPStatus.FORBIDDEN, detail=str(e)) from e
except ValidationError as e:
Expand Down Expand Up @@ -193,8 +190,6 @@
tenant_id=tenant_id,
skip_user_save=True,
)
except InteractionError as exc:
raise HTTPException(status_code=exc.status_code, detail=str(exc)) from exc
except UnauthorizedError as exc:
raise HTTPException(
status_code=HTTPStatus.UNAUTHORIZED,
Expand Down Expand Up @@ -279,14 +274,7 @@
"""
Stop an agent run by conversation ID or ephemeral debug run ID.
"""
user_id, tenant_id = get_current_user_id(authorization)

Check warning on line 277 in backend/apps/agent_app.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the unused local variable "tenant_id" with "_".

See more on https://sonarcloud.io/project/issues?id=ModelEngine-Group_nexent&issues=AaDD9RefmY7AJHD3IR7d&open=AaDD9RefmY7AJHD3IR7d&pullRequest=3993
from consts.const import HITL_ENABLED
if HITL_ENABLED:
from services.human_interaction.application import get_service
service = get_service()
durable_id = service.repository.latest(tenant_id, user_id, int(run_id), active_only=True) if run_id.isdigit() else None
if durable_id:
service.control(durable_id, tenant_id, user_id, "terminate")
return stop_agent_tasks(int(run_id) if run_id.isdigit() else run_id, user_id)


Expand All @@ -300,23 +288,8 @@
):
"""Stop a northbound agent run inside the runtime service."""
try:
user_id, tenant_id = verify_internal_runtime_jwt(authorization)

Check warning on line 291 in backend/apps/agent_app.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the unused local variable "tenant_id" with "_".

See more on https://sonarcloud.io/project/issues?id=ModelEngine-Group_nexent&issues=AaDD9RefmY7AJHD3IR7e&open=AaDD9RefmY7AJHD3IR7e&pullRequest=3993
from consts.const import HITL_ENABLED
if HITL_ENABLED:
from services.human_interaction.application import get_service
service = get_service()
durable_id = await run_blocking(
"hitl-service-repository-latest", service.repository.latest, tenant_id, user_id,
conversation_id, active_only=True, lane="control-io", owner=__name__,
)
if durable_id:
await run_blocking(
"hitl-service-control", service.control, durable_id, tenant_id, user_id, "terminate",
lane="control-io", owner=__name__,
)
return stop_agent_tasks(conversation_id, user_id)
except InteractionError as exc:
raise HTTPException(status_code=exc.status_code, detail=str(exc)) from exc
except UnauthorizedError as exc:
raise HTTPException(
status_code=HTTPStatus.UNAUTHORIZED,
Expand Down Expand Up @@ -378,7 +351,7 @@
try:
return await get_creating_sub_agent_info_impl(authorization)
except Exception as e:
logger.error(f"Agent create error: {str(e)}")

Check failure on line 354 in backend/apps/agent_app.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use "logging.exception()" instead.

See more on https://sonarcloud.io/project/issues?id=ModelEngine-Group_nexent&issues=AaDD9RefmY7AJHD3IR7f&open=AaDD9RefmY7AJHD3IR7f&pullRequest=3993
raise HTTPException(
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail="Agent create error.")

Expand Down
91 changes: 0 additions & 91 deletions backend/apps/human_interaction_app.py

This file was deleted.

9 changes: 2 additions & 7 deletions backend/apps/northbound_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from fastapi.responses import JSONResponse, Response, StreamingResponse
from pydantic import ValidationError as PydanticValidationError

from consts.model import reject_legacy_agent_fields
from consts.exceptions import (
ConversationNotFoundError,
ForbiddenError,
Expand Down Expand Up @@ -392,15 +393,10 @@ async def run_chat(
}
}],
),
enable_hitl: bool = Body(
False,
embed=True,
description="Enable human interaction when supported by the runtime. Cards use type=human_interaction; "
"submit answers through /nb/v1/chat/human-interactions/{run_id}/requests/{request_id}/decisions.",
),
idempotency_key: Optional[str] = Header(None, alias="Idempotency-Key"),
):
try:
reject_legacy_agent_fields(await request.json())
ctx: NorthboundContext = await _get_northbound_context(request)
return await start_streaming_chat(
ctx=ctx,
Expand All @@ -413,7 +409,6 @@ async def run_chat(
tool_params=tool_params,
model_id=model_id,
idempotency_key=idempotency_key,
enable_hitl=enable_hitl,
)
except LimitExceededError as e:
logging.error(f"Too Many Requests: rate limit exceeded: {str(e)}", exc_info=e)
Expand Down
2 changes: 0 additions & 2 deletions backend/apps/northbound_base_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from services.runtime_state_service import runtime_state_service
from .northbound_app import router as northbound_router
from .northbound_knowledge_app import router as northbound_knowledge_router
from .northbound_human_interaction_app import router as northbound_human_interaction_router


class A2AServerSettings(BaseModel):
Expand Down Expand Up @@ -111,7 +110,6 @@ async def thread_capacity():

northbound_app.include_router(northbound_router)
northbound_app.include_router(northbound_knowledge_router)
northbound_app.include_router(northbound_human_interaction_router)


# =============================================================================
Expand Down
100 changes: 0 additions & 100 deletions backend/apps/northbound_human_interaction_app.py

This file was deleted.

11 changes: 0 additions & 11 deletions backend/apps/runtime_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
file_management_runtime_router as file_management_router,
)
from apps.skill_app import skill_creator_router
from apps.human_interaction_app import router as human_interaction_router
from apps.human_interaction_app import internal_router as internal_human_interaction_router
from consts.const import RUNTIME_THREAD_SHUTDOWN_GRACE_SECONDS
from middleware.exception_handler import ExceptionHandlerMiddleware
from nexent.core.concurrency import (
Expand All @@ -33,9 +31,7 @@


async def start_agent_automation_scheduler():
from consts.const import HITL_ENABLED
from services.agent_automation.scheduler import agent_automation_scheduler
from services.human_interaction.application import get_service, human_run_scheduler
from services.startup_recovery_service import recover_runtime_tasks
from services.workspace_cleanup_service import cleanup_orphaned_agent_workspaces

Expand All @@ -49,17 +45,12 @@ async def start_agent_automation_scheduler():
)
cleanup_orphaned_agent_workspaces()
await agent_automation_scheduler.start()
if HITL_ENABLED:
get_service()
await human_run_scheduler.start()


async def stop_agent_automation_scheduler():
from services.agent_automation.scheduler import agent_automation_scheduler
from services.human_interaction.application import human_run_scheduler

await agent_automation_scheduler.stop()
await human_run_scheduler.stop()


@asynccontextmanager
Expand Down Expand Up @@ -125,5 +116,3 @@ async def thread_capacity():
app.include_router(file_management_router)
app.include_router(voice_router)
app.include_router(skill_creator_router)
app.include_router(human_interaction_router)
app.include_router(internal_human_interaction_router)
6 changes: 0 additions & 6 deletions backend/consts/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ class VectorDatabaseType(str, Enum):
# Data Processing Service Configuration
DATA_PROCESS_SERVICE = os.getenv("DATA_PROCESS_SERVICE")
RUNTIME_SERVICE_URL = os.getenv("RUNTIME_SERVICE_URL", "http://localhost:5014").rstrip("/")
HITL_ENABLED = os.getenv("HITL_ENABLED", "false").lower() in ("true", "1", "yes")
HITL_ACCEPT_NEW_RUNS = os.getenv("HITL_ACCEPT_NEW_RUNS", "true").lower() in ("true", "1", "yes")
HITL_TOOL_APPROVAL_ENABLED = os.getenv("HITL_TOOL_APPROVAL_ENABLED", "false").lower() in ("true", "1", "yes")
HITL_ENCRYPTION_KEY = os.getenv("HITL_ENCRYPTION_KEY", "")
HITL_WAIT_SECONDS = int(os.getenv("HITL_WAIT_SECONDS", "86400"))
HITL_MAX_CONCURRENCY = int(os.getenv("HITL_MAX_CONCURRENCY", "2"))
CLIP_MODEL_PATH = os.getenv("CLIP_MODEL_PATH")
TABLE_TRANSFORMER_MODEL_PATH = os.getenv("TABLE_TRANSFORMER_MODEL_PATH")
UNSTRUCTURED_DEFAULT_MODEL_INITIALIZE_PARAMS_JSON_PATH = os.getenv(
Expand Down
15 changes: 12 additions & 3 deletions backend/consts/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,11 +825,15 @@ class ConversationKnowledgeScopeUpdateRequest(BaseModel):
scope: Optional[ConversationKnowledgeScopeRequest] = None


def reject_legacy_agent_fields(value):
"""Reject removed execution controls rather than silently starting a new run."""
if isinstance(value, dict) and {"enable_hitl", "hitl_run_id", "hitl_after_event"}.intersection(value):
raise ValueError("Legacy human interaction fields are no longer supported; send a normal query")
return value


class AgentRequest(BaseModel):
query: str
enable_hitl: bool = False
hitl_run_id: Optional[str] = Field(default=None, min_length=36, max_length=36)
hitl_after_event: int = Field(default=0, ge=0)
conversation_id: Optional[int] = None
history: Optional[List[HistoryItem]] = None
# Complete list of attachment information
Expand All @@ -855,6 +859,11 @@ class AgentRequest(BaseModel):
description="Optional optimistic-lock version for runtime metadata updates",
)

@model_validator(mode="before")
@classmethod
def reject_legacy_execution_controls(cls, value):
return reject_legacy_agent_fields(value)

@field_validator("context_policy")
@classmethod
def validate_context_policy(cls, value):
Expand Down
Loading
Loading