Repository navigation
feat: support CodeX agent #1226
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
Merged
Changes from all commits
Commits
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
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
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
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
84 changes: 84 additions & 0 deletions
84
backend/tests/api/endpoints/test_adapter_teams_defaults.py
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,84 @@ | ||
| # SPDX-FileCopyrightText: 2025 Weibo, Inc. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| from app.api.endpoints.adapter import teams as teams_endpoint | ||
|
|
||
|
|
||
| def test_default_team_config_includes_wework_mode(monkeypatch): | ||
| monkeypatch.setattr( | ||
| teams_endpoint.settings, | ||
| "DEFAULT_TEAM_WEWORK", | ||
| "wegent-wework-hidden#default", | ||
| ) | ||
| monkeypatch.setattr( | ||
| teams_endpoint.settings, | ||
| "DEFAULT_TEAM_CHAT", | ||
| "wegent-chat#default", | ||
| ) | ||
|
|
||
| config = teams_endpoint._get_default_teams_config() | ||
|
|
||
| assert config["wework"] == { | ||
| "name": "wegent-wework-hidden", | ||
| "namespace": "default", | ||
| } | ||
| assert config["chat"] == {"name": "wegent-chat", "namespace": "default"} | ||
|
|
||
|
|
||
| def test_add_default_for_modes_marks_wework_team(): | ||
| items = [ | ||
| {"name": "wegent-wework-hidden", "namespace": "default"}, | ||
| {"name": "wegent-chat", "namespace": "default"}, | ||
| ] | ||
| default_config = { | ||
| "wework": {"name": "wegent-wework-hidden", "namespace": "default"}, | ||
| "chat": {"name": "wegent-chat", "namespace": "default"}, | ||
| } | ||
|
|
||
| result = teams_endpoint._add_default_for_modes(items, default_config) | ||
|
|
||
| assert result[0]["default_for_modes"] == ["wework"] | ||
| assert result[1]["default_for_modes"] == ["chat"] | ||
|
|
||
|
|
||
| def test_list_teams_api_marks_wework_default(monkeypatch): | ||
| from types import SimpleNamespace | ||
|
|
||
| from fastapi import FastAPI | ||
| from fastapi.testclient import TestClient | ||
|
|
||
| from app.api.dependencies import get_db | ||
| from app.core import security | ||
|
|
||
| monkeypatch.setattr( | ||
| teams_endpoint.settings, | ||
| "DEFAULT_TEAM_WEWORK", | ||
| "wegent-wework-hidden#default", | ||
| ) | ||
| monkeypatch.setattr(teams_endpoint.settings, "DEFAULT_TEAM_CHAT", "") | ||
| monkeypatch.setattr(teams_endpoint.settings, "DEFAULT_TEAM_CODE", "") | ||
| monkeypatch.setattr(teams_endpoint.settings, "DEFAULT_TEAM_KNOWLEDGE", "") | ||
| monkeypatch.setattr(teams_endpoint.settings, "DEFAULT_TEAM_TASK", "") | ||
| monkeypatch.setattr( | ||
| teams_endpoint.team_kinds_service, | ||
| "get_user_teams", | ||
| lambda **_: [ | ||
| { | ||
| "id": 1, | ||
| "name": "wegent-wework-hidden", | ||
| "namespace": "default", | ||
| "is_active": True, | ||
| } | ||
| ], | ||
| ) | ||
|
|
||
| app = FastAPI() | ||
| app.include_router(teams_endpoint.router, prefix="/teams") | ||
| app.dependency_overrides[get_db] = lambda: None | ||
| app.dependency_overrides[security.get_current_user] = lambda: SimpleNamespace(id=1) | ||
|
|
||
| response = TestClient(app).get("/teams?page=1&limit=100") | ||
|
|
||
| assert response.status_code == 200 | ||
| assert response.json()["items"][0]["default_for_modes"] == ["wework"] |
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
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.
Fix priority logic to respect explicit empty reasoning_config.
The current code uses
or, which treats an empty dict{}as falsy:If the API caller explicitly passes
reasoning_config={}to indicate "no reasoning," the code incorrectly falls back to extracting reasoning frommodel_options, violating the documented priority ("explicit API reasoning_config > UI model_options").🛠️ Proposed fix to honor explicit empty dict
🤖 Prompt for AI Agents