Repository navigation
Codex/fix/workbench device workspaces #1524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
qdaxb
merged 8 commits into
wecode-ai:main
from
FicoHu:codex/fix/workbench-device-workspaces
Jun 23, 2026
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
004a73e
fix(wework): sync device workspace creation state
c2b71be
fix(executor): stream claude runtime task events
db43aa6
fix(backend): normalize legacy remote device type
51535be
Merge branch 'main' into codex/fix/workbench-device-workspaces
FicoHu d935e06
fix(executor): stream claude code tool blocks
5e65e01
fix(executor): persist claude runtime processing blocks
d2eab87
fix(executor): emit claude user tool starts
5a3cf3a
fix(wework): show thinking timeline while awaiting stream
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # SPDX-FileCopyrightText: 2026 Weibo, Inc. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Tests for local device provider response normalization.""" | ||
|
|
||
| import pytest | ||
|
|
||
| from app.models.kind import Kind | ||
| from app.schemas.device import DeviceInfo | ||
| from app.services.device.local_provider import LocalDeviceProvider | ||
|
|
||
|
|
||
| def _local_device(device_id: str, device_type: str) -> Kind: | ||
| return Kind( | ||
| user_id=7, | ||
| kind="Device", | ||
| name=device_id, | ||
| namespace="default", | ||
| is_active=True, | ||
| json={ | ||
| "apiVersion": "agent.wecode.io/v1", | ||
| "kind": "Device", | ||
| "metadata": { | ||
| "name": device_id, | ||
| "namespace": "default", | ||
| }, | ||
| "spec": { | ||
| "deviceId": device_id, | ||
| "deviceType": device_type, | ||
| "connectionMode": "websocket", | ||
| "bindShell": "claudecode", | ||
| "displayName": device_id, | ||
| "isDefault": False, | ||
| }, | ||
| }, | ||
| ) | ||
|
|
||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_list_devices_normalizes_legacy_remote_device_type( | ||
| test_db, | ||
| monkeypatch, | ||
| ): | ||
| """Legacy remote devices are local devices in the current API contract.""" | ||
| test_db.add(_local_device("legacy-remote", "remote")) | ||
| test_db.commit() | ||
|
|
||
| async def fake_mget(keys): | ||
| return {} | ||
|
|
||
| async def fake_latest_version(): | ||
| return "1.0.0" | ||
|
|
||
| monkeypatch.setattr("app.core.cache.cache_manager.mget", fake_mget) | ||
| monkeypatch.setattr( | ||
| "app.services.device.local_provider.executor_version_service.get_latest_version", | ||
| fake_latest_version, | ||
| ) | ||
|
|
||
| devices = await LocalDeviceProvider().list_devices(test_db, user_id=7) | ||
|
|
||
| assert devices[0]["device_type"] == "local" | ||
| DeviceInfo(**devices[0]) | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard against empty results before indexing
devices[0].This test currently fails with
IndexErrorif filtering/regression returns no devices, which hides the actual contract failure. Add an explicit non-empty assertion first.Suggested patch
devices = await LocalDeviceProvider().list_devices(test_db, user_id=7) + assert len(devices) == 1 assert devices[0]["device_type"] == "local" DeviceInfo(**devices[0])🤖 Prompt for AI Agents