Skip to content

Conversation

@NirajC-Microsoft
Copy link
Contributor

Purpose

This pull request primarily refactors and cleans up the backend codebase for improved readability and maintainability. The changes focus on formatting, import organization, and code consistency across several modules, without introducing new features or altering existing logic.

Code formatting and consistency improvements:

  • Reformatted multi-line function calls and assignments for better readability, especially in app_config.py and app_kernel.py [1] [2].
  • Updated dictionary and function parameter formatting to use consistent indentation and line breaks in methods such as delete_current_team and delete_plan_by_plan_id in cosmosdb.py [1] [2].

Import cleanup and organization:

  • Removed unused imports and reordered existing ones in app_kernel.py, cosmosdb.py, and database_base.py to follow best practices and reduce clutter [1] [2] [3].

Abstract method definition standardization:

  • Removed unnecessary pass statements from abstract methods in DatabaseBase to streamline interface definitions [1] [2] [3] [4] [5].

Pydantic model formatting:

  • Reformatted Pydantic field definitions for clarity in messages_kernel.py [1] [2].

Minor whitespace and style fixes:

  • Removed extraneous blank lines and adjusted whitespace in several files for consistency [1] [2] [3] [4] [5] [6] [7] [8].

These changes collectively improve the codebase's maintainability and readability, making it easier for future development and onboarding.

  • ...

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses Pylint errors by improving code formatting, organization, and consistency across the backend codebase. The changes focus on refactoring without altering existing functionality.

  • Import cleanup and reorganization to remove unused imports and follow standard conventions
  • Code reformatting for better readability including function parameters, dictionary formatting, and multi-line expressions
  • Removal of unnecessary pass statements from abstract methods

Reviewed Changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/backend/v3/orchestration/orchestration_manager.py Import reorganization, removed unused imports, formatted function parameters and multi-line expressions
src/backend/v3/orchestration/human_approval_manager.py Import cleanup, function parameter formatting, removed unused imports
src/backend/v3/orchestration/helper/plan_to_mplan_converter.py Updated regex pattern quotes for consistency
src/backend/v3/models/orchestration_models.py Import cleanup and reorganization
src/backend/v3/models/models.py Import cleanup, removed unused imports
src/backend/v3/models/messages.py Import reorganization, added spacing between class definitions
src/backend/v3/magentic_agents/reasoning_search.py Import cleanup, function parameter formatting
src/backend/v3/magentic_agents/reasoning_agent.py Removed unused imports
src/backend/v3/magentic_agents/proxy_agent.py Import reorganization, function parameter formatting
src/backend/v3/magentic_agents/models/agent_models.py Import path corrections, function parameter formatting
src/backend/v3/magentic_agents/magentic_agent_factory.py Import cleanup, function parameter formatting, removed empty pass statements
src/backend/v3/magentic_agents/foundry_agent.py Import organization, function parameter formatting
src/backend/v3/magentic_agents/common/lifecycle.py Import cleanup and reorganization
src/backend/v3/config/settings.py Import organization, formatting improvements
src/backend/v3/common/services/team_service.py Import cleanup, function parameter formatting
src/backend/v3/common/services/plan_service.py Import reorganization and cleanup
src/backend/v3/common/services/foundry_service.py Removed extraneous blank lines
src/backend/v3/common/services/base_api_service.py Import cleanup
src/backend/v3/common/services/agents_service.py Import reorganization
src/backend/v3/common/services/init.py Import order correction
src/backend/v3/callbacks/response_handlers.py Import organization, function parameter formatting
src/backend/v3/callbacks/global_debug.py Removed unnecessary blank line
src/backend/v3/api/router.py Import organization, comment formatting fixes, removed duplicate assignment
src/backend/tests/test_team_specific_methods.py Import reorganization
src/backend/tests/test_otlp_tracing.py Import path corrections, import reorganization
src/backend/tests/test_config.py Import path corrections, function formatting
src/backend/common/utils/websocket_streaming.py Import organization, function parameter formatting
src/backend/common/utils/utils_kernel.py Function formatting improvements
src/backend/common/utils/event_utils.py Removed unused import
src/backend/common/utils/check_deployments.py Import reorganization, string quote consistency
src/backend/common/models/messages_kernel.py Field formatting, added missing classes
src/backend/common/database/database_base.py Removed unnecessary pass statements from abstract methods
src/backend/common/database/cosmosdb.py Import reorganization, function parameter formatting
src/backend/common/config/app_config.py Function parameter formatting
src/backend/app_kernel.py Import cleanup, function parameter formatting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 5 to 15
from src.backend.common.utils.otlp_tracing import (
configure_oltp_tracing,
) # Import directly since it's in backend

# Add the backend directory to the Python path
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))


@patch("otlp_tracing.TracerProvider")
@patch("otlp_tracing.OTLPSpanExporter")
@patch("otlp_tracing.Resource")
@patch("src.backend.common.utils.otlp_tracing.TracerProvider")
@patch("src.backend.common.utils.otlp_tracing.OTLPSpanExporter")
@patch("src.backend.common.utils.otlp_tracing.Resource")

This comment was marked as duplicate.

Comment on lines 13 to 15
@patch("src.backend.common.utils.otlp_tracing.TracerProvider")
@patch("src.backend.common.utils.otlp_tracing.OTLPSpanExporter")
@patch("src.backend.common.utils.otlp_tracing.Resource")
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch decorators should use relative module paths. Use 'common.utils.otlp_tracing.TracerProvider' instead of absolute paths starting with 'src.backend'.

Suggested change
@patch("src.backend.common.utils.otlp_tracing.TracerProvider")
@patch("src.backend.common.utils.otlp_tracing.OTLPSpanExporter")
@patch("src.backend.common.utils.otlp_tracing.Resource")
@patch("common.utils.otlp_tracing.TracerProvider")
@patch("common.utils.otlp_tracing.OTLPSpanExporter")
@patch("common.utils.otlp_tracing.Resource")

Copilot uses AI. Check for mistakes.
# New codebase: config lives in app_config/config_kernel
from src.backend.app_config import config as app_config
from src.backend.config_kernel import Config
from src.backend.common.config.app_config import config as app_config
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import path should be relative. Use 'from common.config.app_config import config as app_config' instead of absolute path starting with 'src.backend'.

Suggested change
from src.backend.common.config.app_config import config as app_config
from common.config.app_config import config as app_config

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 35 out of 36 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@microsoft microsoft deleted a comment from Copilot AI Oct 8, 2025
@microsoft microsoft deleted a comment from Copilot AI Oct 8, 2025
@Roopan-Microsoft Roopan-Microsoft merged commit 9cffb0d into microsoft:dev-v3 Oct 8, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants