Skip to content

Fix parse error in agent_registry.py - remove stray text and correct type hints#4

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-parse-error-in-agent-registry
Draft

Fix parse error in agent_registry.py - remove stray text and correct type hints#4
Copilot wants to merge 2 commits intomainfrom
copilot/fix-parse-error-in-agent-registry

Conversation

Copy link

Copilot AI commented Oct 13, 2025

Problem

The file mcp-server/orchestrator/agent_registry.py had a Python syntax error that prevented it from being parsed, compiled, or analyzed. Running python -m py_compile on the file produced:

File "mcp-server/orchestrator/agent_registry.py", line 30
    cursor/prepare-refinery-agent-for-rollout-8ae2
                                              ^
SyntaxError: invalid decimal literal

Root Cause

Line 30 contained a stray text line cursor/prepare-refinery-agent-for-rollout-8ae2 (appears to be a git branch name that was accidentally left in the code) inside the dictionary definition in the get_agent_matrix() function. Additionally, two function signatures used the lowercase any instead of the proper Any type from Python's typing module.

Changes

This PR makes three minimal changes to fix the syntax errors:

  1. Removed the invalid line: Deleted the stray text cursor/prepare-refinery-agent-for-rollout-8ae2 from line 30
  2. Added missing import: Added Any to the imports from the typing module
  3. Fixed type annotations: Corrected two function signatures to use proper Any type:
    • get_agent_stats() return type: Dict[str, Dict[str, any]]Dict[str, Dict[str, Any]]
    • validate_workflow_tasks() parameter type: List[Dict[str, any]]List[Dict[str, Any]]

Verification

  • ✅ File now passes python -m py_compile syntax validation
  • ✅ File parses correctly as valid Python AST
  • ✅ All files in the orchestrator directory pass syntax checks
  • ✅ No functional changes - only syntax corrections

Impact

This fix resolves the blocking issue and allows the file to be:

  • Successfully compiled by Python
  • Analyzed by static analysis and linting tools
  • Imported without syntax errors
  • Type-checked correctly by tools like mypy

The agent registry functionality remains unchanged; these are purely syntax corrections.

Original prompt

rivew this issue and suggest fixes
A parse error occurred while processing /home/runner/work/Sherlock-Multiagent-Data-Scientist/Sherlock-Multiagent-Data-Scientist/mcp-server/orchestrator/agent_registry.py, and as a result this file could not be analyzed. Check the syntax of the file using the python -m py_compile command and correct any invalid syntax.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…e hints

Co-authored-by: DeepExtrema <175066046+DeepExtrema@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix parse error in agent_registry.py Fix parse error in agent_registry.py - remove stray text and correct type hints Oct 13, 2025
Copilot AI requested a review from DeepExtrema October 13, 2025 09:46
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