Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
48736da
feat(harness): accept a runtime parameter (adk default, codex)
yaozheng-fang Jun 11, 2026
e748faa
feat(harness): add deployable harness_app package and `veadk harness`…
yaozheng-fang Jun 11, 2026
6bcedfb
feat(harness): layered harness.yaml config + env_mapping; redesign cr…
yaozheng-fang Jun 11, 2026
98abdb8
feat(harness): full-commented harness.yaml template; deploy prints ap…
yaozheng-fang Jun 11, 2026
30c9935
fix(harness): read deploy runtime apikey/endpoint from deploy_result.…
yaozheng-fang Jun 11, 2026
f336ffc
feat(harness): 'harness add --set KEY=VALUE' writes nested params int…
yaozheng-fang Jun 11, 2026
76d1dbd
feat(harness): explicit per-component connection flags for 'harness add'
yaozheng-fang Jun 11, 2026
40b59cb
feat(harness): unify add/invoke flags, knowledgebase rename, cleaner …
yaozheng-fang Jun 11, 2026
6dbe594
feat(harness): deploy records harness.json; invoke resolves url/key f…
yaozheng-fang Jun 11, 2026
ea854dd
feat(harness): add 'veadk harness show' (configured agent params + ov…
yaozheng-fang Jun 11, 2026
c512d9c
docs(harness): rewrite CLI reference for current create/add/show/depl…
yaozheng-fang Jun 11, 2026
7ee1f8d
test(harness): fix contract tests for redesigned harness_app API
yaozheng-fang Jun 11, 2026
0a8d1bf
refactor(harness): remove dead 'veadk agentkit harness add' command
yaozheng-fang Jun 11, 2026
efaa84b
docs(examples): rewrite #14 harness example for the veadk harness flow
yaozheng-fang Jun 11, 2026
9841eca
feat(harness): add OAuth2/JWT (custom_jwt) deploy option
yaozheng-fang Jun 12, 2026
ae5bdf3
init
songyichun1 Jun 15, 2026
9bbf2d6
Merge branch 'main' of https://github.com/volcengine/veadk-python int…
songyichun1 Jun 18, 2026
adb53f3
fix:分离agentkit保留cli,veadk保留registry-client&tools
songyichun1 Jun 18, 2026
890472b
fix:完善a2a_registry_search_agent_cards工具描述和传入参数
songyichun1 Jun 22, 2026
f40837d
Merge remote-tracking branch 'upstream/main' into feat/harness-a2a-re…
songyichun1 Jun 22, 2026
1f94866
fix:完善工具描述
songyichun1 Jun 22, 2026
dbe49fc
Merge remote-tracking branch 'upstream/main' into feat/harness-a2a-re…
songyichun1 Jun 22, 2026
0ce64f8
Merge remote-tracking branch 'upstream/main' into feat/harness-a2a-re…
songyichun1 Jun 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
411 changes: 411 additions & 0 deletions tests/a2a/test_registry_client.py

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions tests/cli/test_cli_harness_registry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pathlib import Path

import yaml
from click.testing import CliRunner

from veadk.cli.cli_harness import harness


def test_harness_add_no_longer_exposes_registry_flags():
runner = CliRunner()
with runner.isolated_filesystem():
create_result = runner.invoke(harness, ["create", "harness-app"])
assert create_result.exit_code == 0

result = runner.invoke(
harness,
[
"add",
"--path",
"harness-app",
"--registry-space-id",
"space-test",
],
)

assert result.exit_code != 0
assert "No such option" in result.output


def test_harness_show_does_not_list_registry_override_flags():
runner = CliRunner()
with runner.isolated_filesystem():
runner.invoke(harness, ["create", "harness-app"])

result = runner.invoke(harness, ["show", "--path", "harness-app"])

assert result.exit_code == 0, result.output
assert "--registry-space-id" not in result.output
assert "--registry-top-k" not in result.output


def test_harness_add_tool_calling_flags_write_top_level_config():
runner = CliRunner()
with runner.isolated_filesystem():
runner.invoke(harness, ["create", "harness-app"])

result = runner.invoke(
harness,
[
"add",
"--path",
"harness-app",
"--structured-tool-calls",
"--include-tools-every-turn",
],
)

assert result.exit_code == 0, result.output
data = yaml.safe_load((Path("harness-app") / "harness.yaml").read_text())
assert data["structured_tool_calls"] is True
assert data["include_tools_every_turn"] is True


def test_harness_add_removes_old_responses_config_names():
runner = CliRunner()
with runner.isolated_filesystem():
runner.invoke(harness, ["create", "harness-app"])
yaml_path = Path("harness-app") / "harness.yaml"
data = yaml.safe_load(yaml_path.read_text())
data["enable_responses"] = True
data["enable_responses_cache"] = False
yaml_path.write_text(yaml.safe_dump(data, sort_keys=False))

result = runner.invoke(
harness,
[
"add",
"--path",
"harness-app",
"--structured-tool-calls",
],
)

assert result.exit_code == 0, result.output
data = yaml.safe_load(yaml_path.read_text())
assert "enable_responses" not in data
assert "enable_responses_cache" not in data
assert data["structured_tool_calls"] is True
83 changes: 82 additions & 1 deletion tests/cloud/test_harness_app_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@
import time, so it is intentionally left out to keep these tests offline.
"""

from pathlib import Path

from veadk.cloud.harness_app.types import (
HarnessConfig,
HarnessOverrides,
InvokeHarnessRequest,
InvokeHarnessResponse,
RunAgentRequest,
)
from veadk.cloud.harness_app.utils import split_csv
from veadk.cloud.harness_app.env_mapping import to_runtime_env
from veadk.cloud.harness_app.utils import config_from_env, split_csv
from veadk.consts import DEFAULT_MODEL_AGENT_NAME
from veadk.prompts.agent_default_prompt import DEFAULT_INSTRUCTION

Expand All @@ -49,6 +52,10 @@ def test_fields(self):
"skills",
"system_prompt",
"runtime",
"registry_space_id",
"registry_endpoint",
"registry_region",
"registry_top_k",
}

def test_defaults(self):
Expand All @@ -58,6 +65,10 @@ def test_defaults(self):
assert fields["skills"].default == ""
assert fields["system_prompt"].default == "You are a helpful assistant."
assert fields["runtime"].default == "adk"
assert fields["registry_space_id"].default == ""
assert fields["registry_endpoint"].default == ""
assert fields["registry_region"].default == ""
assert fields["registry_top_k"].default == 3

def test_tools_and_skills_are_csv_strings(self):
# The server splits these with split_csv(); they must stay plain strings,
Expand All @@ -84,6 +95,13 @@ def test_adds_creation_time_fields(self):
"longterm_memory_type",
"shortterm_memory_type",
"max_llm_calls",
"structured_tool_calls",
"include_tools_every_turn",
"registry_type",
"registry_version",
"registry_service_name",
"registry_timeout_ms",
"registry_poll_interval_ms",
}

def test_component_defaults(self):
Expand All @@ -92,6 +110,12 @@ def test_component_defaults(self):
assert fields["knowledgebase_type"].default == ""
assert fields["longterm_memory_type"].default == ""
assert fields["shortterm_memory_type"].default == "local"
assert fields["structured_tool_calls"].default is False
assert fields["include_tools_every_turn"].default is True
assert fields["registry_type"].default == ""
assert fields["registry_top_k"].default == 3
assert fields["registry_timeout_ms"].default == 60000
assert fields["registry_poll_interval_ms"].default == 5000

def test_system_prompt_default_is_veadk_instruction(self):
# HarnessConfig overrides the override-layer default with VeADK's own.
Expand All @@ -101,6 +125,63 @@ def test_app_name_populated_via_name_alias(self):
assert HarnessConfig(name="research-agent").app_name == "research-agent"
assert HarnessConfig().app_name == "harness_app"

def test_registry_yaml_maps_to_runtime_env(self):
envs = to_runtime_env(
{
"registry": {
"type": "agentkit_a2a",
"space_id": "space-test",
"top_k": 5,
"region": "cn-beijing",
}
}
)

assert envs["REGISTRY_TYPE"] == "agentkit_a2a"
assert envs["REGISTRY_SPACE_ID"] == "space-test"
assert envs["REGISTRY_TOP_K"] == "5"
assert envs["REGISTRY_REGION"] == "cn-beijing"

def test_tool_calling_yaml_maps_to_runtime_env(self):
envs = to_runtime_env(
{
"structured_tool_calls": True,
"include_tools_every_turn": True,
}
)

assert envs["STRUCTURED_TOOL_CALLS"] == "true"
assert envs["INCLUDE_TOOLS_EVERY_TURN"] == "true"

def test_config_from_env_reads_registry_fields(self, monkeypatch):
monkeypatch.setenv("REGISTRY_TYPE", "agentkit_a2a")
monkeypatch.setenv("REGISTRY_SPACE_ID", "space-test")
monkeypatch.setenv("REGISTRY_TOP_K", "5")
monkeypatch.setenv("REGISTRY_REGION", "cn-beijing")

config = config_from_env()

assert config.registry_type == "agentkit_a2a"
assert config.registry_space_id == "space-test"
assert config.registry_top_k == 5
assert config.registry_region == "cn-beijing"

def test_config_from_env_reads_tool_calling_fields(self, monkeypatch):
monkeypatch.setenv("STRUCTURED_TOOL_CALLS", "true")
monkeypatch.setenv("INCLUDE_TOOLS_EVERY_TURN", "false")

config = config_from_env()

assert config.structured_tool_calls is True
assert config.include_tools_every_turn is False

def test_registry_overrides_remount_registry_tools(self):
source = Path("veadk/cloud/harness_app/utils.py").read_text()

assert "_apply_registry_overrides(" in source
assert "_remove_a2a_registry_tools(" in source
assert "build_a2a_registry_tools(overridden_config)" in source


class TestRequestResponseSchemas:
def test_run_agent_request_fields(self):
Expand Down
Loading
Loading