Add GPT-5-mini auto-solver for daily LeetCode problems#41
Merged
Conversation
Co-authored-by: jeremymanning <9030494+jeremymanning@users.noreply.github.com>
Co-authored-by: jeremymanning <9030494+jeremymanning@users.noreply.github.com>
Co-authored-by: jeremymanning <9030494+jeremymanning@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add automatic solver for daily problems
Add GPT-5-mini auto-solver for daily LeetCode problems
Nov 5, 2025
Member
|
@copilot Since we can't test the key elements of this implementation here (i.e., fetching the leetcode problem doesn't work because we don't have access to external sites, and we can't access repository secrets to get the openai API key), add a comment ot the pull request with instructions for manually testing the solution before I merge. |
Contributor
Author
Manual Testing InstructionsSince this PR cannot be fully tested in the PR environment, follow these steps to test before merging: Prerequisites
Testing Steps1. Manual Workflow Trigger Test
2. Verify Generated Solution
3. Validate Solution Quality
4. Test Schedule (Optional)
Expected Output StructureTroubleshooting
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements automated solution generation for daily LeetCode problems using OpenAI's GPT-5-mini, running at 00:01 UTC.
Changes
.github/workflows/auto_solver.yml: Daily workflow with explicitcontents: writepermissionsauto_solver.py: Fetches problem via LeetCode GraphQL API, generates solution with GPT-5-mini, saves asproblems/{ID}/gpt5-mini.mdREADME.md: Added auto-solver documentationGenerated Solution Format
Solutions follow existing template structure:
Configuration Required
Set
OPENAI_API_KEYrepository secret before merge. Workflow can also be triggered manually via Actions UI.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
leetcode.comimport requests
import json
Test fetching the daily problem
leetcode_api_url = 'REDACTED'
daily_challenge_query = {
'query': '''query questionOfToday {
activeDailyCodingChallengeQuestion {
date
link
question {
questionFrontendId
title
titleSlug
difficulty
content
}
}
}''',
'operationName': 'questionOfToday'
}
response = requests.post(leetcode_api_url, json=daily_challenge_query)
data = response.json()
if 'data' in data and 'activeDailyCodingChallengeQuestion' in data['data']:
question = data['data']['activeDailyCodingChallengeQuestion']['question']
print(f'✓ Successfully fetched daily problem:')
print(f' Problem ID: {question["questionFrontendId"]}')
print(f' Title: {question["title"]}')
print(f' Difficulty: {question["difficulty"]}')
print(f' Content length: {len(question["content"])} characters')
else:
print('✗ Failed to fetch problem')
print(json.dumps(data, indent=2))` (dns block)
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.