Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Summary

  • What: Fix syntax error in scripts/orchestrate_content.py introduced by botched merge conflict resolution.
  • Why: Script was completely non-functional due to malformed code structure.

Changes

  • Restored proper function hierarchy: main() moved from inside call_ollama() exception handler to module level
  • Recovered missing process_module() and orchestrate() async functions that were lost in merge
  • Preserved HTTP status check from commit cece8cd
  • Retained --dry-run flag support from commit 199617e

Before (broken):

async def call_ollama(...):
    for attempt in range(1, MAX_RETRIES + 1):
        try:
            # ... ollama logic
        except Exception as e:
            if attempt == MAX_RETRIES:
                def main():  # ❌ nested inside exception handler
                    # entire main() function here
        concurrency = 4  # ❌ orphaned statement
    except Exception:  # ❌ unmatched except
        concurrency = 4

After (fixed):

async def call_ollama(...):
    for attempt in range(1, MAX_RETRIES + 1):
        try:
            # ... ollama logic
        except Exception as e:
            if attempt == MAX_RETRIES:
                raise
            await asyncio.sleep(backoff)

async def process_module(...):
    # restored function

async def orchestrate(...):
    # restored function

def main():  # ✅ at module level
    # main logic

Testing

  • All 9 unit tests pass
  • Python syntax validation clean
  • No security vulnerabilities introduced

Checklist

  • Syntax error resolved
  • All functions at correct hierarchy level
  • Tests passing
  • Code review completed

Reviewers


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: 73junito <86015877+73junito@users.noreply.github.com>
Copilot AI changed the title [WIP] Work in progress to address feedback from PR 158 Fix Python 3 syntax error in orchestrate_content.py Jan 16, 2026
Copilot AI requested a review from 73junito January 16, 2026 01:57
Copy link
Owner

@73junito 73junito left a comment

Choose a reason for hiding this comment

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

viewed

@73junito 73junito marked this pull request as ready for review January 16, 2026 09:24
Copilot AI review requested due to automatic review settings January 16, 2026 09:24
@73junito 73junito merged commit 1b7e7cd into merge/pr-158-local Jan 16, 2026
4 of 7 checks passed
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 fixes a critical syntax error in scripts/orchestrate_content.py that resulted from a botched merge conflict resolution, which had nested the entire main() function inside an exception handler.

Changes:

  • Restored proper function hierarchy by moving main() from inside call_ollama() exception handler to module level
  • Recovered missing process_module() and orchestrate() async functions
  • Enhanced call_ollama() with proper timeout configuration and HTTP status code validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants