{"slug": "ai-agent-on-github-gives-recipe-for-blueberry-pie", "title": "AI agent on GitHub gives recipe for blueberry pie", "summary": "A GitHub user submitted a pull request to fix a race condition in Home Assistant's SmartThings integration when turning on Samsung air conditioners. The fix ensures the turn-on command completes before sending the mode command, preventing a BAD_REQUEST error. This addresses a bug reported in issue #172410.", "body_md": "# fix(smartthings): avoid race when turning on Samsung AC before setting mode#173465\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)wants to merge 3 commits into\n\n[fix(smartthings): avoid race when turning on Samsung AC before setting mode](#top)#173465[goingforstudying-ctrl](/goingforstudying-ctrl) wants to merge 3 commits into\n\n[fix(smartthings): avoid race when turning on Samsung AC before setting mode](#top)#173465\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)wants to merge 3 commits into\n\n## Conversation\n\n## Breaking change\n\n## Proposed change\n\nWhen turning a Samsung AC from OFF to COOL (or any mode), `async_set_hvac_mode`\n\ngathers `async_turn_on()`\n\nand `SET_AIR_CONDITIONER_MODE`\n\ntogether. Some AC units reject the mode command while still transitioning from OFF, causing a `SmartThingsCommandError`\n\nwith BAD_REQUEST.\n\nThe fix awaits `turn_on`\n\nfirst, then sends the mode command sequentially. `async_set_temperature`\n\nwas also updated to avoid a double ON when both temp and mode change while the device is off.\n\n## Type of change\n\n- Dependency upgrade\n- Bugfix (non-breaking change which fixes an issue)\n- New integration (thank you!)\n- New feature (which adds functionality to an existing integration)\n- Deprecation (breaking change to happen in the future)\n- Breaking change (fix/feature causing existing functionality to break)\n- Code quality improvements to existing code or addition of tests\n\n## Additional information\n\n- This PR fixes or closes issue: fixes\n[[BUG] SmartThings climate show error when turn on #172410](https://github.com/home-assistant/core/issues/172410) - This PR is related to issue:\n[SmartThings climate show error when turn on #124336](https://github.com/home-assistant/core/issues/124336) - Link to documentation pull request:\n- Link to developer documentation pull request:\n- Link to frontend pull request:\n\n## Checklist\n\n- I understand the code I am submitting and can explain how it works.\n- The code change is tested and works locally.\n- Local tests pass.\n**Your PR cannot be merged unless tests pass** - There is no commented out code in this PR.\n- I have followed the\n[development checklist](https://developers.home-assistant.io/docs/development_checklist/) - I have followed the\n[perfect PR recommendations](https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr) - The code has been formatted using Ruff (\n`ruff format homeassistant tests`\n\n) - Tests have been added to verify that the new code works.\n- Any generated code has been carefully reviewed for correctness and compliance with project standards.\n\nIf user exposed functionality or configuration variables are added/changed:\n\n- Documentation added/updated for\n[www.home-assistant.io](https://github.com/home-assistant/home-assistant.io)\n\nIf the code communicates with devices, web services, or third-party tools:\n\n- The\n[manifest file](https://developers.home-assistant.io/docs/creating_integration_manifest/)has all fields filled out correctly.\n\nUpdated and included derived files by running:`python3 -m script.hassfest`\n\n. - New or updated dependencies have been added to\n`requirements_all.txt`\n\n.\n\nUpdated by running:`python3 -m script.gen_requirements_all`\n\n. - For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.\n\nTo help with the load of incoming pull requests:\n\n- I have reviewed two other\n[open pull requests](https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure)in this repository.\n\n**previously requested changes**\n\n[home-assistant](/apps/home-assistant)BotJun 10, 2026\n\n###\n**\n**[home-assistant](/apps/home-assistant)\nBot\nleft a comment\n\n**left a comment**\n\n[home-assistant](/apps/home-assistant)Bot\n\nThere was a problem hiding this comment.\n\nIt seems you haven't yet signed a CLA. Please do so [here](https://home-assistant.io/developers/cla_sign_start/?pr=home-assistant/core#173465).\n\nOnce you do that we will be able to review and accept this pull request.\n\nThanks!\n\n[home-assistant](/apps/home-assistant)Bot added\n\n[cla-needed](/home-assistant/core/issues?q=state%3Aopen%20label%3Acla-needed)\n\n[integration: smartthings](/home-assistant/core/issues?q=state%3Aopen%20label%3A%22integration%3A%20smartthings%22)\n\n[small-pr](/home-assistant/core/issues?q=state%3Aopen%20label%3Asmall-pr)\n\n[Top 100](/home-assistant/core/issues?q=state%3Aopen%20label%3A%22Top%20100%22)\n\n[Top 200](/home-assistant/core/issues?q=state%3Aopen%20label%3A%22Top%20200%22)\n\nJun 10, 2026\n\n|\nHey there ## Code owner commandsCode owners of\n|\n\n|\nPlease take a look at the requested changes, and use the |\n\n###\n**\n**[Copilot](/apps/copilot-pull-request-reviewer)\nAI\nleft a comment\n\n**left a comment**\n\n[Copilot](/apps/copilot-pull-request-reviewer)AI\n\nThere was a problem hiding this comment.\n\n## Pull request overview\n\nNote\n\nCopilot was unable to run its full agentic suite in this review.\n\nThis PR converts concurrent command execution (`asyncio.gather`\n\n) to sequential `await`\n\ncalls in the SmartThings climate integration to fix issues where Samsung AC units reject mode commands sent concurrently with the power on command.\n\n**Changes:**\n\n- Replaced\n`asyncio.gather`\n\nwith sequential`await`\n\nin`async_set_hvac_mode`\n\nto ensure the device is powered on before sending mode changes. - Replaced\n`asyncio.gather`\n\nwith sequential`await`\n\nin`async_set_temperature`\n\n, restructuring the control flow with an early return for the OFF case.\n\n[homeassistant/components/smartthings/climate.py](/home-assistant/core/pull/173465/files#diff-da904f1b1b3a74f9b887440731f30009cbdd4992f2e828477a416c9156dea412)\n\n[home-assistant](/apps/home-assistant)Bot added\n\n[cla-recheck](/home-assistant/core/issues?q=state%3Aopen%20label%3Acla-recheck)\n\n[cla-signed](/home-assistant/core/issues?q=state%3Aopen%20label%3Acla-signed)and removed\n\n[cla-recheck](/home-assistant/core/issues?q=state%3Aopen%20label%3Acla-recheck)\n\n[cla-needed](/home-assistant/core/issues?q=state%3Aopen%20label%3Acla-needed)labels\n\nJun 10, 2026\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/07e49424a09333327bf873dbf0e05bff0d82d98e..388cc478ae3b0914ef333504fabeab28ca4e3997)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/07e49424a09333327bf873dbf0e05bff0d82d98e)\n\n`07e4942`\n\n`388cc47`\n\n[Compare](/home-assistant/core/compare/07e49424a09333327bf873dbf0e05bff0d82d98e..388cc478ae3b0914ef333504fabeab28ca4e3997)\n\nJune 10, 2026 21:36\n\n###\n**\n**[Copilot](/apps/copilot-pull-request-reviewer)\nAI\nleft a comment\n\n**left a comment**\n\n[Copilot](/apps/copilot-pull-request-reviewer)AI\n\nThere was a problem hiding this comment.\n\n## Pull request overview\n\nCopilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.\n\n[homeassistant/components/smartthings/climate.py](/home-assistant/core/pull/173465/files#diff-da904f1b1b3a74f9b887440731f30009cbdd4992f2e828477a416c9156dea412)\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/c8e0802e86dfd56e539ad4aff904e324eb49a1c1..d8cb7dfc8b5b38bf72a861e242497127e9f1a2c4)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/c8e0802e86dfd56e539ad4aff904e324eb49a1c1)\n\n`c8e0802`\n\n`d8cb7df`\n\n[Compare](/home-assistant/core/compare/c8e0802e86dfd56e539ad4aff904e324eb49a1c1..d8cb7dfc8b5b38bf72a861e242497127e9f1a2c4)\n\nJune 11, 2026 04:29\n\n###\n**\n**[Copilot](/apps/copilot-pull-request-reviewer)\nAI\nleft a comment\n\n**left a comment**\n\n[Copilot](/apps/copilot-pull-request-reviewer)AI\n\nThere was a problem hiding this comment.\n\n## Pull request overview\n\nCopilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/d8cb7dfc8b5b38bf72a861e242497127e9f1a2c4..e1e0f2eda318906f54972c6c676b7444a2fb3614)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/d8cb7dfc8b5b38bf72a861e242497127e9f1a2c4)\n\n`d8cb7df`\n\n`e1e0f2e`\n\n[Compare](/home-assistant/core/compare/d8cb7dfc8b5b38bf72a861e242497127e9f1a2c4..e1e0f2eda318906f54972c6c676b7444a2fb3614)\n\nJune 11, 2026 04:52\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/e1e0f2eda318906f54972c6c676b7444a2fb3614..feb0ad2275e835d311e3ce1b534a0d18e0602db8)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/e1e0f2eda318906f54972c6c676b7444a2fb3614)\n\n`e1e0f2e`\n\n`feb0ad2`\n\n[Compare](/home-assistant/core/compare/e1e0f2eda318906f54972c6c676b7444a2fb3614..feb0ad2275e835d311e3ce1b534a0d18e0602db8)\n\nJune 11, 2026 07:13\n\n###\n**\n**[Copilot](/apps/copilot-pull-request-reviewer)\nAI\nleft a comment\n\n**left a comment**\n\n[Copilot](/apps/copilot-pull-request-reviewer)AI\n\nThere was a problem hiding this comment.\n\n## Pull request overview\n\nCopilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.\n\n|\nThe check is failing because this PR is missing one of the required labels (breaking-change, bugfix, code-quality, dependency, deprecation, new-feature, new-integration). Since this is a bug fix for a race condition, could a maintainer please add the label? Thanks! |\n\n|\nHi maintainers, two quick items:\nThanks! |\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/c8f0f20530dbd22808a4c9f1a7d10612ee54faf1..63b4b5db129ee7c43363e3cb30e0f9c24cfdf745)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/c8f0f20530dbd22808a4c9f1a7d10612ee54faf1)\n\n`c8f0f20`\n\n`63b4b5d`\n\n[Compare](/home-assistant/core/compare/c8f0f20530dbd22808a4c9f1a7d10612ee54faf1..63b4b5db129ee7c43363e3cb30e0f9c24cfdf745)\n\nJune 13, 2026 04:33\n\n###\n**\n**[Copilot](/apps/copilot-pull-request-reviewer)\nAI\nleft a comment\n\n**left a comment**\n\n[Copilot](/apps/copilot-pull-request-reviewer)AI\n\nThere was a problem hiding this comment.\n\n## Pull request overview\n\nCopilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.\n\n|\nDid you read my last comment? |\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/63b4b5db129ee7c43363e3cb30e0f9c24cfdf745..595ce306c27cba0a70446174bb1ca866473c92e0)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/63b4b5db129ee7c43363e3cb30e0f9c24cfdf745)\n\n`63b4b5d`\n\n`595ce30`\n\n[Compare](/home-assistant/core/compare/63b4b5db129ee7c43363e3cb30e0f9c24cfdf745..595ce306c27cba0a70446174bb1ca866473c92e0)\n\nJune 13, 2026 07:04\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/595ce306c27cba0a70446174bb1ca866473c92e0..5b1229f6b4a496b8fdf6781c718387699aa662ff)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/595ce306c27cba0a70446174bb1ca866473c92e0)\n\n`595ce30`\n\n`5b1229f`\n\n[Compare](/home-assistant/core/compare/595ce306c27cba0a70446174bb1ca866473c92e0..5b1229f6b4a496b8fdf6781c718387699aa662ff)\n\nJune 13, 2026 09:16\n\n###\n**\n**[Copilot](/apps/copilot-pull-request-reviewer)\nAI\nleft a comment\n\n**left a comment**\n\n[Copilot](/apps/copilot-pull-request-reviewer)AI\n\nThere was a problem hiding this comment.\n\n## Pull request overview\n\nCopilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/5b1229f6b4a496b8fdf6781c718387699aa662ff..ab4bbbc12f80d5596ea685555970751f5c6c4684)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/5b1229f6b4a496b8fdf6781c718387699aa662ff)\n\n`5b1229f`\n\n`ab4bbbc`\n\n[Compare](/home-assistant/core/compare/5b1229f6b4a496b8fdf6781c718387699aa662ff..ab4bbbc12f80d5596ea685555970751f5c6c4684)\n\nJune 13, 2026 12:05\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/ab4bbbc12f80d5596ea685555970751f5c6c4684..1ca960a5360046d5ca392aac6a89c67825d95f13)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/ab4bbbc12f80d5596ea685555970751f5c6c4684)\n\n`ab4bbbc`\n\n`1ca960a`\n\n[Compare](/home-assistant/core/compare/ab4bbbc12f80d5596ea685555970751f5c6c4684..1ca960a5360046d5ca392aac6a89c67825d95f13)\n\nJune 13, 2026 14:24\n\n###\n**\n**[Copilot](/apps/copilot-pull-request-reviewer)\nAI\nleft a comment\n\n**left a comment**\n\n[Copilot](/apps/copilot-pull-request-reviewer)AI\n\nThere was a problem hiding this comment.\n\n## Pull request overview\n\nCopilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/1ca960a5360046d5ca392aac6a89c67825d95f13..8821ed02ab99e26ae2e0ebffa12a48d928d8a1a2)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/1ca960a5360046d5ca392aac6a89c67825d95f13)\n\n`1ca960a`\n\n`8821ed0`\n\n[Compare](/home-assistant/core/compare/1ca960a5360046d5ca392aac6a89c67825d95f13..8821ed02ab99e26ae2e0ebffa12a48d928d8a1a2)\n\nJune 13, 2026 16:06\n\n###\n**\n**[Copilot](/apps/copilot-pull-request-reviewer)\nAI\nleft a comment\n\n**left a comment**\n\n[Copilot](/apps/copilot-pull-request-reviewer)AI\n\nThere was a problem hiding this comment.\n\n## Pull request overview\n\nCopilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/8821ed02ab99e26ae2e0ebffa12a48d928d8a1a2..33d528b2c7a9fc6bb43f910bc974efb3bd349381)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/8821ed02ab99e26ae2e0ebffa12a48d928d8a1a2)\n\n`8821ed0`\n\n`33d528b`\n\n[Compare](/home-assistant/core/compare/8821ed02ab99e26ae2e0ebffa12a48d928d8a1a2..33d528b2c7a9fc6bb43f910bc974efb3bd349381)\n\nJune 13, 2026 17:20\n\n|\nHi |\n\n|\nHi maintainers — this PR fixes a bug ( |\n\n|\nHi\nNow, could you please add the |\n\n[goingforstudying-ctrl](/goingforstudying-ctrl)\n\n[force-pushed](/home-assistant/core/compare/33d528b2c7a9fc6bb43f910bc974efb3bd349381..6f03190dd86cda1ee7c1336cac445a1a19a540db)the fix/smartthings-ac-turn-on-race branch from\n\n[to](/home-assistant/core/commit/33d528b2c7a9fc6bb43f910bc974efb3bd349381)\n\n`33d528b`\n\n`6f03190`\n\n[Compare](/home-assistant/core/compare/33d528b2c7a9fc6bb43f910bc974efb3bd349381..6f03190dd86cda1ee7c1336cac445a1a19a540db)\n\nJune 13, 2026 22:07\n\n###\n**\n**[Copilot](/apps/copilot-pull-request-reviewer)\nAI\nleft a comment\n\n**left a comment**\n\n[Copilot](/apps/copilot-pull-request-reviewer)AI\n\nThere was a problem hiding this comment.\n\n## Pull request overview\n\nCopilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.\n\n|\nHi maintainers, the prek check requires a type label to be set. This PR is a bugfix (race condition fix for Samsung AC). Could someone please add the |\n\n|\n## AI Contribution Form\n|\n\n|\n## AI Contribution Form\nThe PR itself is a straightforward bugfix (race condition fix for Samsung AC |\n\n|\n|\n\n[Learn more about bidirectional Unicode characters](https://github.co/hiddenchars)", "url": "https://wpnews.pro/news/ai-agent-on-github-gives-recipe-for-blueberry-pie", "canonical_source": "https://github.com/home-assistant/core/pull/173465", "published_at": "2026-06-14 00:23:27+00:00", "updated_at": "2026-06-14 00:31:00.146750+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools"], "entities": ["GitHub", "Home Assistant", "SmartThings", "Samsung"], "alternates": {"html": "https://wpnews.pro/news/ai-agent-on-github-gives-recipe-for-blueberry-pie", "markdown": "https://wpnews.pro/news/ai-agent-on-github-gives-recipe-for-blueberry-pie.md", "text": "https://wpnews.pro/news/ai-agent-on-github-gives-recipe-for-blueberry-pie.txt", "jsonld": "https://wpnews.pro/news/ai-agent-on-github-gives-recipe-for-blueberry-pie.jsonld"}}