feat: skip job load in step logging (#3433)

This commit is contained in:
cthomas
2025-07-20 14:41:40 -07:00
committed by GitHub
parent a95ff6f5c5
commit 9392adc8f5
2 changed files with 2 additions and 4 deletions

View File

@@ -158,8 +158,6 @@ class StepManager:
if stop_reason:
step_data["stop_reason"] = stop_reason.stop_reason
async with db_registry.async_session() as session:
if job_id:
await self._verify_job_access_async(session, job_id, actor, access=["write"])
new_step = StepModel(**step_data)
await new_step.create_async(session, no_commit=True, no_refresh=True)
pydantic_step = new_step.to_pydantic()

View File

@@ -46,7 +46,7 @@ from letta.jobs.types import ItemUpdateInfo, RequestStatusUpdateInfo, StepStatus
from letta.orm import Base, Block
from letta.orm.block_history import BlockHistory
from letta.orm.enums import ToolType
from letta.orm.errors import NoResultFound, UniqueConstraintViolationError
from letta.orm.errors import ForeignKeyConstraintViolationError, NoResultFound, UniqueConstraintViolationError
from letta.orm.file import FileContent as FileContentModel
from letta.orm.file import FileMetadata as FileMetadataModel
from letta.schemas.agent import CreateAgent, UpdateAgent
@@ -6565,7 +6565,7 @@ async def test_job_usage_stats_add_nonexistent_job(server: SyncServer, sarah_age
"""Test adding usage statistics for a nonexistent job."""
step_manager = server.step_manager
with pytest.raises(NoResultFound):
with pytest.raises(ForeignKeyConstraintViolationError):
await step_manager.log_step_async(
agent_id=sarah_agent.id,
provider_name="openai",