Skip to content

Commit 8b1b992

Browse files
committed
fix(agent): avoid header casing conflict and clean warnings
1 parent dec919e commit 8b1b992

10 files changed

Lines changed: 33 additions & 25 deletions

examples/agent_with_cache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <memory>
1717
#include <string_view>
1818

19-
#include <vix/ai/agent/agent.hpp>
19+
#include <vix/ai/agent/AgentRuntime.hpp>
2020
#include <vix/print.hpp>
2121

2222
namespace

examples/agent_with_command_tool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <memory>
1717
#include <string_view>
1818

19-
#include <vix/ai/agent/agent.hpp>
19+
#include <vix/ai/agent/AgentRuntime.hpp>
2020
#include <vix/json/json.hpp>
2121
#include <vix/print.hpp>
2222

examples/basic_agent.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
* Vix.cpp
1414
*
1515
*/
16-
#include <vix/ai/agent/agent.hpp>
16+
17+
#include <vix/ai/agent/AgentRuntime.hpp>
1718
#include <vix/print.hpp>
1819
#include <memory>
1920

examples/custom_provider.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#include <memory>
1717
#include <string_view>
1818

19-
#include <vix/ai/agent/agent.hpp>
19+
#include <vix/ai/agent/AgentRuntime.hpp>
20+
2021
#include <vix/print.hpp>
2122

2223
namespace

examples/ollama_agent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
#include <memory>
1717

18-
#include <vix/ai/agent/agent.hpp>
18+
#include <vix/ai/agent/AgentRuntime.hpp>
1919
#include <vix/print.hpp>
2020

2121
int main()

examples/public_api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Vix.cpp
1414
*
1515
*/
16-
#include <vix/ai/agent/agent.hpp>
16+
#include <vix/ai/agent/AgentRuntime.hpp>
1717
#include <vix/print.hpp>
1818

1919
int main()

examples/scan_project.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Vix.cpp
1414
*
1515
*/
16-
#include <vix/ai/agent/agent.hpp>
16+
#include <vix/ai/agent/AgentRuntime.hpp>
1717
#include <vix/print.hpp>
1818

1919
int main()
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* Vix.cpp
1414
*
1515
*/
16-
#ifndef VIX_AI_AGENT_AGENT_UMBRELLA_HPP
17-
#define VIX_AI_AGENT_AGENT_UMBRELLA_HPP
16+
#ifndef VIX_AI_AGENT_AGENT_RUNTIME_HPP
17+
#define VIX_AI_AGENT_AGENT_RUNTIME_HPP
1818

1919
#include <vix/ai/agent/Agent.hpp>
2020
#include <vix/ai/agent/AgentConfig.hpp>
@@ -48,4 +48,4 @@
4848
#include <vix/ai/agent/AgentRunStore.hpp>
4949
#include <vix/ai/agent/AgentConfigValidator.hpp>
5050

51-
#endif // VIX_AI_AGENT_AGENT_UMBRELLA_HPP
51+
#endif // VIX_AI_AGENT_AGENT_RUNTIME_HPP

tests/AgentConfigTest.cpp

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@
2020
#include <vix/ai/agent/AgentConfig.hpp>
2121
#include <vix/ai/agent/AgentConfigLoader.hpp>
2222
#include <vix/ai/agent/AgentConfigValidator.hpp>
23+
#include <vix/error/Error.hpp>
2324
#include <vix/env/Set.hpp>
2425
#include <vix/env/Unset.hpp>
2526

2627
namespace
2728
{
29+
void assert_no_error(const vix::error::Error &error)
30+
{
31+
assert(!error);
32+
}
33+
2834
void test_default_config()
2935
{
3036
vix::ai::agent::AgentConfig config;
@@ -65,13 +71,13 @@ namespace
6571

6672
void test_environment_loader_overrides()
6773
{
68-
vix::env::set("VIX_AGENT_TEST_PROVIDER", "ollama", true);
69-
vix::env::set("VIX_AGENT_TEST_MODEL", "qwen2.5-coder", true);
70-
vix::env::set("VIX_AGENT_TEST_MODEL_URL", "http://127.0.0.1:11434", true);
71-
vix::env::set("VIX_AGENT_TEST_TIMEOUT_MS", "15000", true);
72-
vix::env::set("VIX_AGENT_TEST_MAX_FILES", "42", true);
73-
vix::env::set("VIX_AGENT_TEST_ALLOW_PROCESS", "true", true);
74-
vix::env::set("VIX_AGENT_TEST_ALLOW_FILE_WRITE", "false", true);
74+
assert_no_error(vix::env::set("VIX_AGENT_TEST_PROVIDER", "ollama", true));
75+
assert_no_error(vix::env::set("VIX_AGENT_TEST_MODEL", "qwen2.5-coder", true));
76+
assert_no_error(vix::env::set("VIX_AGENT_TEST_MODEL_URL", "http://127.0.0.1:11434", true));
77+
assert_no_error(vix::env::set("VIX_AGENT_TEST_TIMEOUT_MS", "15000", true));
78+
assert_no_error(vix::env::set("VIX_AGENT_TEST_MAX_FILES", "42", true));
79+
assert_no_error(vix::env::set("VIX_AGENT_TEST_ALLOW_PROCESS", "true", true));
80+
assert_no_error(vix::env::set("VIX_AGENT_TEST_ALLOW_FILE_WRITE", "false", true));
7581

7682
auto config = vix::ai::agent::AgentConfigLoader::from_environment("VIX_AGENT_TEST_");
7783

@@ -83,13 +89,13 @@ namespace
8389
assert(config.allow_process);
8490
assert(!config.allow_file_write);
8591

86-
vix::env::unset("VIX_AGENT_TEST_PROVIDER");
87-
vix::env::unset("VIX_AGENT_TEST_MODEL");
88-
vix::env::unset("VIX_AGENT_TEST_MODEL_URL");
89-
vix::env::unset("VIX_AGENT_TEST_TIMEOUT_MS");
90-
vix::env::unset("VIX_AGENT_TEST_MAX_FILES");
91-
vix::env::unset("VIX_AGENT_TEST_ALLOW_PROCESS");
92-
vix::env::unset("VIX_AGENT_TEST_ALLOW_FILE_WRITE");
92+
assert_no_error(vix::env::unset("VIX_AGENT_TEST_PROVIDER"));
93+
assert_no_error(vix::env::unset("VIX_AGENT_TEST_MODEL"));
94+
assert_no_error(vix::env::unset("VIX_AGENT_TEST_MODEL_URL"));
95+
assert_no_error(vix::env::unset("VIX_AGENT_TEST_TIMEOUT_MS"));
96+
assert_no_error(vix::env::unset("VIX_AGENT_TEST_MAX_FILES"));
97+
assert_no_error(vix::env::unset("VIX_AGENT_TEST_ALLOW_PROCESS"));
98+
assert_no_error(vix::env::unset("VIX_AGENT_TEST_ALLOW_FILE_WRITE"));
9399
}
94100

95101
void test_config_validator_accepts_default_config()

tests/AgentPublicApiTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <memory>
1818
#include <string_view>
1919

20-
#include <vix/ai/agent/agent.hpp>
20+
#include <vix/ai/agent/AgentRuntime.hpp>
2121

2222
namespace
2323
{

0 commit comments

Comments
 (0)