Skip to content

Commit 621df54

Browse files
resolved pylint issue
1 parent 75970cc commit 621df54

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/backend/app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ async def lifespan(app: FastAPI):
7171
# Suppress noisy Azure Monitor exporter "Transmission succeeded" logs
7272
logging.getLogger("azure.monitor.opentelemetry.exporter.export._base").setLevel(logging.WARNING)
7373

74-
7574
# Initialize the FastAPI app
7675
app = FastAPI(lifespan=lifespan)
7776

77+
frontend_url = config.FRONTEND_SITE_NAME
7878
# Configure Azure Monitor and instrument FastAPI for OpenTelemetry
7979
# This enables automatic request tracing, dependency tracking, and proper operation_id
8080
if config.APPLICATIONINSIGHTS_CONNECTION_STRING:
@@ -83,7 +83,7 @@ async def lifespan(app: FastAPI):
8383
connection_string=config.APPLICATIONINSIGHTS_CONNECTION_STRING,
8484
enable_live_metrics=True
8585
)
86-
86+
8787
# Instrument FastAPI app — exclude WebSocket URLs to reduce telemetry noise
8888
FastAPIInstrumentor.instrument_app(
8989
app,
@@ -95,6 +95,7 @@ async def lifespan(app: FastAPI):
9595
"No Application Insights connection string found. Telemetry disabled."
9696
)
9797

98+
# Add this near the top of your app.py, after initializing the app
9899
app.add_middleware(
99100
CORSMiddleware,
100101
allow_origins=["*"], # Allow all origins for development; restrict in production

src/backend/v4/api/router.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,12 @@ async def process_request(
311311

312312
if not input_task.session_id:
313313
input_task.session_id = str(uuid.uuid4())
314-
314+
315315
# Attach session_id to current span for Application Insights
316316
span = trace.get_current_span()
317317
if span:
318318
span.set_attribute("session_id", input_task.session_id)
319-
319+
320320
try:
321321
plan_id = str(uuid.uuid4())
322322
# Initialize memory store and service
@@ -452,7 +452,7 @@ async def plan_approval(
452452
raise HTTPException(
453453
status_code=401, detail="Missing or invalid user information"
454454
)
455-
455+
456456
# Attach session_id to span if plan_id is available
457457
if human_feedback.plan_id:
458458
try:
@@ -464,7 +464,7 @@ async def plan_approval(
464464
span.set_attribute("session_id", plan.session_id)
465465
except Exception:
466466
pass # Don't fail request if span attribute fails
467-
467+
468468
# Set the approval in the orchestration config
469469
try:
470470
if user_id and human_feedback.m_plan_id:
@@ -614,7 +614,7 @@ async def user_clarification(
614614
raise HTTPException(
615615
status_code=401, detail="Missing or invalid user information"
616616
)
617-
617+
618618
# Attach session_id to span if plan_id is available
619619
if human_feedback.plan_id:
620620
try:
@@ -626,7 +626,7 @@ async def user_clarification(
626626
span.set_attribute("session_id", plan.session_id)
627627
except Exception:
628628
pass # Don't fail request if span attribute fails
629-
629+
630630
try:
631631
memory_store = await DatabaseFactory.get_database(user_id=user_id)
632632
user_current_team = await memory_store.get_current_team(user_id=user_id)
@@ -769,7 +769,7 @@ async def agent_message_user(
769769
raise HTTPException(
770770
status_code=401, detail="Missing or invalid user information"
771771
)
772-
772+
773773
# Attach session_id to span if plan_id is available
774774
if agent_message.plan_id:
775775
try:
@@ -781,7 +781,7 @@ async def agent_message_user(
781781
span.set_attribute("session_id", plan.session_id)
782782
except Exception:
783783
pass # Don't fail request if span attribute fails
784-
784+
785785
# Set the approval in the orchestration config
786786

787787
try:
@@ -1398,7 +1398,7 @@ async def get_plans(request: Request):
13981398
all_plans = await memory_store.get_all_plans_by_team_id_status(
13991399
user_id=user_id, team_id=current_team.team_id, status=PlanStatus.completed
14001400
)
1401-
1401+
14021402
# Attach session_id to span if plans exist
14031403
if all_plans and len(all_plans) > 0 and hasattr(all_plans[0], 'session_id'):
14041404
span = trace.get_current_span()
@@ -1494,7 +1494,7 @@ async def get_plan_by_id(
14941494
{"status_code": 400, "detail": "Plan not found"},
14951495
)
14961496
raise HTTPException(status_code=404, detail="Plan not found")
1497-
1497+
14981498
# Attach session_id to span
14991499
if plan.session_id:
15001500
span = trace.get_current_span()

src/backend/v4/common/services/plan_service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
AgentType,
1111
PlanStatus,
1212
)
13-
from common.utils.event_utils import track_event_if_configured
1413
from v4.config.settings import orchestration_config
1514

1615
logger = logging.getLogger(__name__)

0 commit comments

Comments
 (0)