Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

The execute_scheduled_shot() nested async function was being invoked with keyword arguments it doesn't accept, causing all scheduled shot tests to fail with TypeError: got an unexpected keyword argument 'schedule_id'.

Changes

  • coffee-relay/main.py: Removed erroneous parameter passing in asyncio.create_task() call
    • The nested function captures variables from outer scope by design
    • Was incorrectly being invoked with explicit schedule_id, shot_delay, preheat, etc. arguments
    • Changed from create_task(execute_scheduled_shot(schedule_id=..., shot_delay=..., ...)) to create_task(execute_scheduled_shot())

Example

# Before (incorrect - function doesn't accept parameters)
task = asyncio.create_task(
    execute_scheduled_shot(
        schedule_id=schedule_id,
        shot_delay=shot_delay,
        preheat=preheat,
        profile_id=profile_id,
        # ...
    )
)

# After (correct - function uses outer scope variables)
task = asyncio.create_task(execute_scheduled_shot())

This fixes 6 failing test cases in TestRunShotEndpoints and TestScheduledShotsPersistence.


💡 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: hessius <1499030+hessius@users.noreply.github.com>
Copilot AI changed the title [WIP] Add version tracking endpoint and machine control features Fix schedule_shot async task invocation with incorrect parameters Feb 1, 2026
Copilot AI requested a review from hessius February 1, 2026 18:34
@hessius hessius marked this pull request as ready for review February 1, 2026 20:36
@hessius hessius merged commit 6f6798c into version/1.1.0 Feb 1, 2026
@hessius hessius deleted the copilot/sub-pr-117 branch February 1, 2026 20:36
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