From a4a83b1699267e9dbd0e90dec4f3dc7f372814b4 Mon Sep 17 00:00:00 2001 From: jaberjaber23 Date: Tue, 3 Mar 2026 16:54:30 +0300 Subject: [PATCH] bugfixes batch --- Cargo.lock | 28 ++-- Cargo.toml | 2 +- agents/analyst/agent.toml | 8 +- agents/architect/agent.toml | 8 +- agents/assistant/agent.toml | 6 +- agents/code-reviewer/agent.toml | 8 +- agents/coder/agent.toml | 8 +- agents/customer-support/agent.toml | 6 +- agents/data-scientist/agent.toml | 8 +- agents/debugger/agent.toml | 8 +- agents/devops-lead/agent.toml | 6 +- agents/doc-writer/agent.toml | 6 +- agents/email-assistant/agent.toml | 6 +- agents/health-tracker/agent.toml | 4 +- agents/hello-world/agent.toml | 4 +- agents/home-automation/agent.toml | 4 +- agents/legal-assistant/agent.toml | 8 +- agents/meeting-assistant/agent.toml | 6 +- agents/ops/agent.toml | 4 +- agents/orchestrator/agent.toml | 8 +- agents/personal-finance/agent.toml | 4 +- agents/planner/agent.toml | 6 +- agents/recruiter/agent.toml | 6 +- agents/researcher/agent.toml | 8 +- agents/sales-assistant/agent.toml | 6 +- agents/security-auditor/agent.toml | 8 +- agents/social-media/agent.toml | 6 +- agents/test-engineer/agent.toml | 8 +- agents/translator/agent.toml | 4 +- agents/travel-planner/agent.toml | 4 +- agents/tutor/agent.toml | 4 +- agents/writer/agent.toml | 6 +- crates/openfang-api/src/routes.rs | 45 +++++-- crates/openfang-channels/src/formatter.rs | 7 +- crates/openfang-cli/src/main.rs | 18 ++- crates/openfang-kernel/src/kernel.rs | 145 ++++++++++++++------- crates/openfang-types/src/model_catalog.rs | 2 +- 37 files changed, 258 insertions(+), 175 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9ba5e5dc..76611e82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3866,7 +3866,7 @@ dependencies = [ [[package]] name = "openfang-api" -version = "0.3.3" +version = "0.3.4" dependencies = [ "async-trait", "axum", @@ -3902,7 +3902,7 @@ dependencies = [ [[package]] name = "openfang-channels" -version = "0.3.3" +version = "0.3.4" dependencies = [ "async-trait", "axum", @@ -3933,7 +3933,7 @@ dependencies = [ [[package]] name = "openfang-cli" -version = "0.3.3" +version = "0.3.4" dependencies = [ "clap", "clap_complete", @@ -3960,7 +3960,7 @@ dependencies = [ [[package]] name = "openfang-desktop" -version = "0.3.3" +version = "0.3.4" dependencies = [ "axum", "open", @@ -3986,7 +3986,7 @@ dependencies = [ [[package]] name = "openfang-extensions" -version = "0.3.3" +version = "0.3.4" dependencies = [ "aes-gcm", "argon2", @@ -4014,7 +4014,7 @@ dependencies = [ [[package]] name = "openfang-hands" -version = "0.3.3" +version = "0.3.4" dependencies = [ "chrono", "dashmap", @@ -4031,7 +4031,7 @@ dependencies = [ [[package]] name = "openfang-kernel" -version = "0.3.3" +version = "0.3.4" dependencies = [ "async-trait", "chrono", @@ -4067,7 +4067,7 @@ dependencies = [ [[package]] name = "openfang-memory" -version = "0.3.3" +version = "0.3.4" dependencies = [ "async-trait", "chrono", @@ -4086,7 +4086,7 @@ dependencies = [ [[package]] name = "openfang-migrate" -version = "0.3.3" +version = "0.3.4" dependencies = [ "chrono", "dirs 6.0.0", @@ -4105,7 +4105,7 @@ dependencies = [ [[package]] name = "openfang-runtime" -version = "0.3.3" +version = "0.3.4" dependencies = [ "anyhow", "async-trait", @@ -4137,7 +4137,7 @@ dependencies = [ [[package]] name = "openfang-skills" -version = "0.3.3" +version = "0.3.4" dependencies = [ "chrono", "hex", @@ -4160,7 +4160,7 @@ dependencies = [ [[package]] name = "openfang-types" -version = "0.3.3" +version = "0.3.4" dependencies = [ "async-trait", "chrono", @@ -4179,7 +4179,7 @@ dependencies = [ [[package]] name = "openfang-wire" -version = "0.3.3" +version = "0.3.4" dependencies = [ "async-trait", "chrono", @@ -8791,7 +8791,7 @@ checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "xtask" -version = "0.3.3" +version = "0.3.4" [[package]] name = "yoke" diff --git a/Cargo.toml b/Cargo.toml index 0fa20a1e..bfc25855 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ members = [ ] [workspace.package] -version = "0.3.4" +version = "0.3.5" edition = "2021" license = "Apache-2.0 OR MIT" repository = "https://github.com/RightNow-AI/openfang" diff --git a/agents/analyst/agent.toml b/agents/analyst/agent.toml index 100fd2ea..7d3766fd 100644 --- a/agents/analyst/agent.toml +++ b/agents/analyst/agent.toml @@ -5,8 +5,8 @@ author = "openfang" module = "builtin:chat" [model] -provider = "gemini" -model = "gemini-2.5-flash" +provider = "default" +model = "default" api_key_env = "GEMINI_API_KEY" max_tokens = 4096 temperature = 0.4 @@ -34,8 +34,8 @@ OUTPUT FORMAT: - Caveats and limitations""" [[fallback_models]] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" api_key_env = "GROQ_API_KEY" [resources] diff --git a/agents/architect/agent.toml b/agents/architect/agent.toml index c3f9b807..3ed37c91 100644 --- a/agents/architect/agent.toml +++ b/agents/architect/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["architecture", "design", "planning"] [model] -provider = "deepseek" -model = "deepseek-chat" +provider = "default" +model = "default" api_key_env = "DEEPSEEK_API_KEY" max_tokens = 8192 temperature = 0.3 @@ -31,8 +31,8 @@ Output format: Use clear headings, diagrams (ASCII), and structured reasoning. When asked to review, be honest about weaknesses.""" [[fallback_models]] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" api_key_env = "GROQ_API_KEY" [resources] diff --git a/agents/assistant/agent.toml b/agents/assistant/agent.toml index 2e7ff767..b439e8c3 100644 --- a/agents/assistant/agent.toml +++ b/agents/assistant/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["general", "assistant", "default", "multipurpose", "conversation", "productivity"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 8192 temperature = 0.5 system_prompt = """You are Assistant, a specialist agent in the OpenFang Agent OS. You are the default general-purpose agent — a versatile, knowledgeable, and helpful companion designed to handle a wide range of everyday tasks, answer questions, and assist with productivity workflows. @@ -61,7 +61,7 @@ TOOLS AVAILABLE: You are reliable, adaptable, and genuinely helpful. You are the user's trusted first point of contact in the OpenFang Agent OS — capable of handling most tasks directly and smart enough to delegate when a specialist would do it better.""" [[fallback_models]] -provider = "gemini" +provider = "default" model = "gemini-2.0-flash" api_key_env = "GEMINI_API_KEY" diff --git a/agents/code-reviewer/agent.toml b/agents/code-reviewer/agent.toml index 6a7dd08f..24bbee3e 100644 --- a/agents/code-reviewer/agent.toml +++ b/agents/code-reviewer/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["review", "code-quality", "best-practices"] [model] -provider = "gemini" -model = "gemini-2.5-flash" +provider = "default" +model = "default" api_key_env = "GEMINI_API_KEY" max_tokens = 4096 temperature = 0.3 @@ -34,8 +34,8 @@ Rules: - Focus on things that matter for production""" [[fallback_models]] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" api_key_env = "GROQ_API_KEY" [resources] diff --git a/agents/coder/agent.toml b/agents/coder/agent.toml index d691745e..0974a7b9 100644 --- a/agents/coder/agent.toml +++ b/agents/coder/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["coding", "implementation", "rust", "python"] [model] -provider = "gemini" -model = "gemini-2.5-flash" +provider = "default" +model = "default" api_key_env = "GEMINI_API_KEY" max_tokens = 8192 temperature = 0.3 @@ -31,8 +31,8 @@ RESEARCH: - Check official documentation before guessing at API usage.""" [[fallback_models]] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" api_key_env = "GROQ_API_KEY" [resources] diff --git a/agents/customer-support/agent.toml b/agents/customer-support/agent.toml index f88c8a98..b7d0ac2e 100644 --- a/agents/customer-support/agent.toml +++ b/agents/customer-support/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["support", "customer-service", "tickets", "helpdesk", "communication", "resolution"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 4096 temperature = 0.3 system_prompt = """You are Customer Support, a specialist agent in the OpenFang Agent OS. You are an expert customer service representative who handles support tickets, resolves issues, and communicates with customers professionally and empathetically. @@ -55,7 +55,7 @@ TOOLS AVAILABLE: You are patient, empathetic, and solutions-focused. You turn frustrated customers into satisfied advocates.""" [[fallback_models]] -provider = "gemini" +provider = "default" model = "gemini-2.0-flash" api_key_env = "GEMINI_API_KEY" diff --git a/agents/data-scientist/agent.toml b/agents/data-scientist/agent.toml index 569fe071..cb69103c 100644 --- a/agents/data-scientist/agent.toml +++ b/agents/data-scientist/agent.toml @@ -5,8 +5,8 @@ author = "openfang" module = "builtin:chat" [model] -provider = "gemini" -model = "gemini-2.5-flash" +provider = "default" +model = "default" api_key_env = "GEMINI_API_KEY" max_tokens = 4096 temperature = 0.3 @@ -36,8 +36,8 @@ Output format: - Caveats and limitations""" [[fallback_models]] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" api_key_env = "GROQ_API_KEY" [resources] diff --git a/agents/debugger/agent.toml b/agents/debugger/agent.toml index c65f4ff8..41887d23 100644 --- a/agents/debugger/agent.toml +++ b/agents/debugger/agent.toml @@ -5,8 +5,8 @@ author = "openfang" module = "builtin:chat" [model] -provider = "gemini" -model = "gemini-2.5-flash" +provider = "default" +model = "default" api_key_env = "GEMINI_API_KEY" max_tokens = 4096 temperature = 0.2 @@ -37,8 +37,8 @@ OUTPUT FORMAT: - Prevention: Test or pattern to prevent recurrence""" [[fallback_models]] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" api_key_env = "GROQ_API_KEY" [resources] diff --git a/agents/devops-lead/agent.toml b/agents/devops-lead/agent.toml index 0829a95d..46e8c550 100644 --- a/agents/devops-lead/agent.toml +++ b/agents/devops-lead/agent.toml @@ -5,8 +5,8 @@ author = "openfang" module = "builtin:chat" [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 4096 temperature = 0.2 system_prompt = """You are DevOps Lead, a platform engineering expert running inside the OpenFang Agent OS. @@ -35,7 +35,7 @@ When designing pipelines: 5. Automated rollback on failure""" [[fallback_models]] -provider = "gemini" +provider = "default" model = "gemini-2.0-flash" api_key_env = "GEMINI_API_KEY" diff --git a/agents/doc-writer/agent.toml b/agents/doc-writer/agent.toml index 4d9b5f48..0a8a1c11 100644 --- a/agents/doc-writer/agent.toml +++ b/agents/doc-writer/agent.toml @@ -5,8 +5,8 @@ author = "openfang" module = "builtin:chat" [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 8192 temperature = 0.4 system_prompt = """You are Doc Writer, a technical documentation specialist running inside the OpenFang Agent OS. @@ -33,7 +33,7 @@ Style guide: - Consistent formatting and structure""" [[fallback_models]] -provider = "gemini" +provider = "default" model = "gemini-2.0-flash" api_key_env = "GEMINI_API_KEY" diff --git a/agents/email-assistant/agent.toml b/agents/email-assistant/agent.toml index e3c8fa5e..4fe7915d 100644 --- a/agents/email-assistant/agent.toml +++ b/agents/email-assistant/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["email", "communication", "triage", "drafting", "scheduling", "productivity"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 8192 temperature = 0.4 system_prompt = """You are Email Assistant, a specialist agent in the OpenFang Agent OS. Your purpose is to manage, triage, draft, and schedule emails with expert precision and professionalism. @@ -47,7 +47,7 @@ TOOLS AVAILABLE: You are thorough, discreet, and efficient. You treat every email as an opportunity to communicate clearly and build professional relationships.""" [[fallback_models]] -provider = "gemini" +provider = "default" model = "gemini-2.0-flash" api_key_env = "GEMINI_API_KEY" diff --git a/agents/health-tracker/agent.toml b/agents/health-tracker/agent.toml index 001e92dc..6efa73a8 100644 --- a/agents/health-tracker/agent.toml +++ b/agents/health-tracker/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["health", "wellness", "fitness", "medication", "habits", "tracking"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 4096 temperature = 0.3 system_prompt = """You are Health Tracker, a specialist agent in the OpenFang Agent OS. You are an expert wellness assistant who helps users track health metrics, manage medication schedules, set fitness goals, and build healthy habits. You are NOT a medical professional and you always make this clear. diff --git a/agents/hello-world/agent.toml b/agents/hello-world/agent.toml index 9b4fe762..c6b007f2 100644 --- a/agents/hello-world/agent.toml +++ b/agents/hello-world/agent.toml @@ -5,8 +5,8 @@ author = "openfang" module = "builtin:chat" [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 4096 temperature = 0.6 system_prompt = """You are Hello World, a friendly and approachable agent in the OpenFang Agent OS. diff --git a/agents/home-automation/agent.toml b/agents/home-automation/agent.toml index 7dae094c..25b61213 100644 --- a/agents/home-automation/agent.toml +++ b/agents/home-automation/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["smart-home", "iot", "automation", "devices", "monitoring", "home"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 4096 temperature = 0.2 system_prompt = """You are Home Automation, a specialist agent in the OpenFang Agent OS. You are an expert smart home engineer and IoT integration specialist who helps users manage connected devices, create automation rules, monitor home systems, and optimize their smart home setup. diff --git a/agents/legal-assistant/agent.toml b/agents/legal-assistant/agent.toml index 302e5df9..ef6552f4 100644 --- a/agents/legal-assistant/agent.toml +++ b/agents/legal-assistant/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["legal", "contracts", "compliance", "research", "review", "documents"] [model] -provider = "gemini" -model = "gemini-2.5-flash" +provider = "default" +model = "default" api_key_env = "GEMINI_API_KEY" max_tokens = 8192 temperature = 0.2 @@ -58,8 +58,8 @@ DISCLAIMER: You are an AI assistant providing legal information for educational You are meticulous, cautious, and precise. You help organizations understand and manage their legal landscape responsibly.""" [[fallback_models]] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" api_key_env = "GROQ_API_KEY" [resources] diff --git a/agents/meeting-assistant/agent.toml b/agents/meeting-assistant/agent.toml index 4ae6b3ff..297dbeb9 100644 --- a/agents/meeting-assistant/agent.toml +++ b/agents/meeting-assistant/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["meetings", "notes", "action-items", "agenda", "follow-up", "productivity"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 8192 temperature = 0.3 system_prompt = """You are Meeting Assistant, a specialist agent in the OpenFang Agent OS. You are an expert at preparing agendas, capturing meeting notes, extracting action items, and managing follow-up workflows to ensure nothing falls through the cracks. @@ -50,7 +50,7 @@ TOOLS AVAILABLE: You are organized, detail-oriented, and relentlessly focused on accountability. You turn chaotic meetings into clear outcomes.""" [[fallback_models]] -provider = "gemini" +provider = "default" model = "gemini-2.0-flash" api_key_env = "GEMINI_API_KEY" diff --git a/agents/ops/agent.toml b/agents/ops/agent.toml index dffe136a..1a61b61f 100644 --- a/agents/ops/agent.toml +++ b/agents/ops/agent.toml @@ -5,8 +5,8 @@ author = "openfang" module = "builtin:chat" [model] -provider = "groq" -model = "llama-3.1-8b-instant" +provider = "default" +model = "default" max_tokens = 2048 temperature = 0.2 system_prompt = """You are Ops, a DevOps and systems operations agent running inside the OpenFang Agent OS. diff --git a/agents/orchestrator/agent.toml b/agents/orchestrator/agent.toml index 9be2cf58..b4c0c54d 100644 --- a/agents/orchestrator/agent.toml +++ b/agents/orchestrator/agent.toml @@ -5,8 +5,8 @@ author = "openfang" module = "builtin:chat" [model] -provider = "deepseek" -model = "deepseek-chat" +provider = "default" +model = "default" api_key_env = "DEEPSEEK_API_KEY" max_tokens = 8192 temperature = 0.3 @@ -45,8 +45,8 @@ Always explain your delegation strategy before executing it. Be thorough but efficient — don't delegate trivially simple tasks.""" [[fallback_models]] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" api_key_env = "GROQ_API_KEY" [schedule] diff --git a/agents/personal-finance/agent.toml b/agents/personal-finance/agent.toml index 51abe17d..ebebdd10 100644 --- a/agents/personal-finance/agent.toml +++ b/agents/personal-finance/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["finance", "budget", "expenses", "savings", "planning", "money"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 8192 temperature = 0.2 system_prompt = """You are Personal Finance, a specialist agent in the OpenFang Agent OS. You are an expert personal financial analyst and advisor who helps users track spending, manage budgets, set savings goals, and make informed financial decisions. diff --git a/agents/planner/agent.toml b/agents/planner/agent.toml index 3b95c858..a28fadf7 100644 --- a/agents/planner/agent.toml +++ b/agents/planner/agent.toml @@ -5,8 +5,8 @@ author = "openfang" module = "builtin:chat" [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 8192 temperature = 0.3 system_prompt = """You are Planner, a project planning specialist running inside the OpenFang Agent OS. @@ -37,7 +37,7 @@ Output format: ### Open Questions""" [[fallback_models]] -provider = "gemini" +provider = "default" model = "gemini-2.0-flash" api_key_env = "GEMINI_API_KEY" diff --git a/agents/recruiter/agent.toml b/agents/recruiter/agent.toml index 1ac2bf04..3c13d5f1 100644 --- a/agents/recruiter/agent.toml +++ b/agents/recruiter/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["recruiting", "hiring", "resume", "outreach", "talent", "hr"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 4096 temperature = 0.4 system_prompt = """You are Recruiter, a specialist agent in the OpenFang Agent OS. You are an expert talent acquisition specialist who helps with resume screening, candidate outreach, job description optimization, interview preparation, and hiring pipeline management. @@ -55,7 +55,7 @@ TOOLS AVAILABLE: You are thorough, fair, and people-oriented. You help organizations find the right talent through ethical, efficient, and human-centered recruiting practices.""" [[fallback_models]] -provider = "gemini" +provider = "default" model = "gemini-2.0-flash" api_key_env = "GEMINI_API_KEY" diff --git a/agents/researcher/agent.toml b/agents/researcher/agent.toml index 05de4c43..d53afa0e 100644 --- a/agents/researcher/agent.toml +++ b/agents/researcher/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["research", "analysis", "web"] [model] -provider = "gemini" -model = "gemini-2.5-flash" +provider = "default" +model = "default" api_key_env = "GEMINI_API_KEY" max_tokens = 4096 temperature = 0.5 @@ -36,8 +36,8 @@ OUTPUT: Always cite your sources. Never present uncertain information as fact.""" [[fallback_models]] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" api_key_env = "GROQ_API_KEY" [resources] diff --git a/agents/sales-assistant/agent.toml b/agents/sales-assistant/agent.toml index 6533fee2..cbbb625e 100644 --- a/agents/sales-assistant/agent.toml +++ b/agents/sales-assistant/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["sales", "crm", "outreach", "pipeline", "prospecting", "deals"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 4096 temperature = 0.5 system_prompt = """You are Sales Assistant, a specialist agent in the OpenFang Agent OS. You are an expert sales operations advisor who helps with CRM management, outreach drafting, pipeline tracking, and deal strategy. @@ -54,7 +54,7 @@ TOOLS AVAILABLE: You are strategic, persuasive, and detail-oriented. You help sales teams work smarter and close more deals.""" [[fallback_models]] -provider = "gemini" +provider = "default" model = "gemini-2.0-flash" api_key_env = "GEMINI_API_KEY" diff --git a/agents/security-auditor/agent.toml b/agents/security-auditor/agent.toml index 308b3621..1aab5bc0 100644 --- a/agents/security-auditor/agent.toml +++ b/agents/security-auditor/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["security", "audit", "vulnerability"] [model] -provider = "deepseek" -model = "deepseek-chat" +provider = "default" +model = "default" api_key_env = "DEEPSEEK_API_KEY" max_tokens = 4096 temperature = 0.2 @@ -37,8 +37,8 @@ Severity levels: CRITICAL / HIGH / MEDIUM / LOW / INFO Report format: Finding → Impact → Evidence → Remediation""" [[fallback_models]] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" api_key_env = "GROQ_API_KEY" [schedule] diff --git a/agents/social-media/agent.toml b/agents/social-media/agent.toml index 74f9860a..ca3c1fc8 100644 --- a/agents/social-media/agent.toml +++ b/agents/social-media/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["social-media", "content", "marketing", "engagement", "scheduling", "analytics"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 4096 temperature = 0.7 system_prompt = """You are Social Media, a specialist agent in the OpenFang Agent OS. You are an expert social media strategist, content creator, and community engagement advisor. @@ -50,7 +50,7 @@ TOOLS AVAILABLE: You are creative, culturally aware, and strategically minded. You balance creativity with data-driven decision-making.""" [[fallback_models]] -provider = "gemini" +provider = "default" model = "gemini-2.0-flash" api_key_env = "GEMINI_API_KEY" diff --git a/agents/test-engineer/agent.toml b/agents/test-engineer/agent.toml index 2a7356fc..eca2e025 100644 --- a/agents/test-engineer/agent.toml +++ b/agents/test-engineer/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["testing", "qa", "validation"] [model] -provider = "gemini" -model = "gemini-2.5-flash" +provider = "default" +model = "default" api_key_env = "GEMINI_API_KEY" max_tokens = 4096 temperature = 0.3 @@ -39,8 +39,8 @@ When reviewing test coverage: - Suggest mutation testing targets""" [[fallback_models]] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" api_key_env = "GROQ_API_KEY" [resources] diff --git a/agents/translator/agent.toml b/agents/translator/agent.toml index d828ddf2..a87b24b2 100644 --- a/agents/translator/agent.toml +++ b/agents/translator/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["translation", "languages", "localization", "multilingual", "communication", "i18n"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 8192 temperature = 0.3 system_prompt = """You are Translator, a specialist agent in the OpenFang Agent OS. You are an expert linguist and translator who provides accurate, culturally aware translations across multiple languages and handles localization tasks with professional precision. diff --git a/agents/travel-planner/agent.toml b/agents/travel-planner/agent.toml index f3a0fd31..189ed8b9 100644 --- a/agents/travel-planner/agent.toml +++ b/agents/travel-planner/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["travel", "planning", "itinerary", "booking", "logistics", "vacation"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 8192 temperature = 0.5 system_prompt = """You are Travel Planner, a specialist agent in the OpenFang Agent OS. You are an expert travel advisor who helps plan trips, create detailed itineraries, research destinations, estimate budgets, and manage travel logistics. diff --git a/agents/tutor/agent.toml b/agents/tutor/agent.toml index 6f76c414..195be81c 100644 --- a/agents/tutor/agent.toml +++ b/agents/tutor/agent.toml @@ -6,8 +6,8 @@ module = "builtin:chat" tags = ["education", "teaching", "tutoring", "learning", "explanation", "knowledge"] [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 8192 temperature = 0.5 system_prompt = """You are Tutor, a specialist agent in the OpenFang Agent OS. You are an expert educator and tutor who explains complex concepts clearly, adapts to different learning styles, and guides students through progressive understanding. diff --git a/agents/writer/agent.toml b/agents/writer/agent.toml index c9b241d8..5c5ada56 100644 --- a/agents/writer/agent.toml +++ b/agents/writer/agent.toml @@ -5,8 +5,8 @@ author = "openfang" module = "builtin:chat" [model] -provider = "groq" -model = "llama-3.3-70b-versatile" +provider = "default" +model = "default" max_tokens = 4096 temperature = 0.7 system_prompt = """You are Writer, a professional content creation agent running inside the OpenFang Agent OS. @@ -30,7 +30,7 @@ OUTPUT: - Adapt formatting to the target platform when specified.""" [[fallback_models]] -provider = "gemini" +provider = "default" model = "gemini-2.0-flash" api_key_env = "GEMINI_API_KEY" diff --git a/crates/openfang-api/src/routes.rs b/crates/openfang-api/src/routes.rs index 4f7baf6d..70387bfc 100644 --- a/crates/openfang-api/src/routes.rs +++ b/crates/openfang-api/src/routes.rs @@ -3623,17 +3623,36 @@ pub async fn activate_hand( let config = body.map(|b| b.0.config).unwrap_or_default(); match state.kernel.activate_hand(&hand_id, config) { - Ok(instance) => ( - StatusCode::OK, - Json(serde_json::json!({ - "instance_id": instance.instance_id, - "hand_id": instance.hand_id, - "status": format!("{}", instance.status), - "agent_id": instance.agent_id.map(|a| a.to_string()), - "agent_name": instance.agent_name, - "activated_at": instance.activated_at.to_rfc3339(), - })), - ), + Ok(instance) => { + // If the hand agent has a non-reactive schedule (autonomous hands), + // start its background loop so it begins running immediately. + if let Some(agent_id) = instance.agent_id { + let entry = state.kernel.registry.list().into_iter().find(|e| e.id == agent_id); + if let Some(entry) = entry { + if !matches!( + entry.manifest.schedule, + openfang_types::agent::ScheduleMode::Reactive + ) { + state.kernel.start_background_for_agent( + agent_id, + &entry.name, + &entry.manifest.schedule, + ); + } + } + } + ( + StatusCode::OK, + Json(serde_json::json!({ + "instance_id": instance.instance_id, + "hand_id": instance.hand_id, + "status": format!("{}", instance.status), + "agent_id": instance.agent_id.map(|a| a.to_string()), + "agent_name": instance.agent_name, + "activated_at": instance.activated_at.to_rfc3339(), + })), + ) + } Err(e) => ( StatusCode::BAD_REQUEST, Json(serde_json::json!({"error": format!("{e}")})), @@ -8759,7 +8778,9 @@ fn json_to_toml_value(value: &serde_json::Value) -> toml::Value { match value { serde_json::Value::String(s) => toml::Value::String(s.clone()), serde_json::Value::Number(n) => { - if let Some(i) = n.as_i64() { + if let Some(i) = n.as_u64() { + toml::Value::Integer(i as i64) + } else if let Some(i) = n.as_i64() { toml::Value::Integer(i) } else if let Some(f) = n.as_f64() { toml::Value::Float(f) diff --git a/crates/openfang-channels/src/formatter.rs b/crates/openfang-channels/src/formatter.rs index 40f093b9..0ffface7 100644 --- a/crates/openfang-channels/src/formatter.rs +++ b/crates/openfang-channels/src/formatter.rs @@ -21,7 +21,12 @@ pub fn format_for_channel(text: &str, format: OutputFormat) -> String { /// /// Supported tags: ``, ``, ``, `
`, ``.
 fn markdown_to_telegram_html(text: &str) -> String {
-    let mut result = text.to_string();
+    // Escape HTML special characters first so agent names and other text
+    // don't get interpreted as HTML tags by Telegram's parser.
+    let mut result = text
+        .replace('&', "&")
+        .replace('<', "<")
+        .replace('>', ">");
 
     // Bold: **text** → text
     while let Some(start) = result.find("**") {
diff --git a/crates/openfang-cli/src/main.rs b/crates/openfang-cli/src/main.rs
index 4df1a1c8..1218a53f 100644
--- a/crates/openfang-cli/src/main.rs
+++ b/crates/openfang-cli/src/main.rs
@@ -4380,8 +4380,9 @@ fn cmd_config_set(key: &str, value: &str) {
     let new_value = if let Some(existing) = tbl.get(last_key) {
         match existing {
             toml::Value::Integer(_) => value
-                .parse::()
-                .map(toml::Value::Integer)
+                .parse::()
+                .map(|v| toml::Value::Integer(v as i64))
+                .or_else(|_| value.parse::().map(toml::Value::Integer))
                 .unwrap_or_else(|_| toml::Value::String(value.to_string())),
             toml::Value::Float(_) => value
                 .parse::()
@@ -4394,7 +4395,18 @@ fn cmd_config_set(key: &str, value: &str) {
             _ => toml::Value::String(value.to_string()),
         }
     } else {
-        toml::Value::String(value.to_string())
+        // No existing value — infer type from the string content
+        if let Ok(b) = value.parse::() {
+            toml::Value::Boolean(b)
+        } else if let Ok(i) = value.parse::() {
+            toml::Value::Integer(i as i64)
+        } else if let Ok(i) = value.parse::() {
+            toml::Value::Integer(i)
+        } else if let Ok(f) = value.parse::() {
+            toml::Value::Float(f)
+        } else {
+            toml::Value::String(value.to_string())
+        }
     };
 
     tbl.insert(last_key.to_string(), new_value);
diff --git a/crates/openfang-kernel/src/kernel.rs b/crates/openfang-kernel/src/kernel.rs
index fdc765cb..2166fab9 100644
--- a/crates/openfang-kernel/src/kernel.rs
+++ b/crates/openfang-kernel/src/kernel.rs
@@ -20,7 +20,9 @@ use openfang_runtime::agent_loop::{
 use openfang_runtime::audit::AuditLog;
 use openfang_runtime::drivers;
 use openfang_runtime::kernel_handle::{self, KernelHandle};
-use openfang_runtime::llm_driver::{CompletionRequest, DriverConfig, LlmDriver, StreamEvent};
+use openfang_runtime::llm_driver::{
+    CompletionRequest, CompletionResponse, DriverConfig, LlmDriver, LlmError, StreamEvent,
+};
 use openfang_runtime::python_runtime::{self, PythonConfig};
 use openfang_runtime::routing::ModelRouter;
 use openfang_runtime::sandbox::{SandboxConfig, WasmSandbox};
@@ -39,6 +41,21 @@ use std::sync::{Arc, OnceLock, Weak};
 use tracing::{debug, info, warn};
 
 /// The main OpenFang kernel — coordinates all subsystems.
+/// Stub LLM driver used when no providers are configured.
+/// Returns a helpful error so the dashboard still boots and users can configure providers.
+struct StubDriver;
+
+#[async_trait]
+impl LlmDriver for StubDriver {
+    async fn complete(&self, _request: CompletionRequest) -> Result {
+        Err(LlmError::MissingApiKey(
+            "No LLM provider configured. Set an API key (e.g. GROQ_API_KEY) and restart, \
+             or configure a provider via the dashboard."
+                .to_string(),
+        ))
+    }
+}
+
 pub struct OpenFangKernel {
     /// Kernel configuration.
     pub config: KernelConfig,
@@ -538,52 +555,67 @@ impl OpenFangKernel {
                 .clone()
                 .or_else(|| config.provider_urls.get(&config.default_model.provider).cloned()),
         };
-        let primary_driver = drivers::create_driver(&driver_config)
-            .map_err(|e| KernelError::BootFailed(format!("LLM driver init failed: {e}")))?;
+        // Primary driver failure is non-fatal: the dashboard should remain accessible
+        // even if the LLM provider is misconfigured. Users can fix config via dashboard.
+        let primary_result = drivers::create_driver(&driver_config);
+        let mut driver_chain: Vec> = Vec::new();
 
-        // If fallback providers are configured, wrap the primary driver in a FallbackDriver
-        let driver: Arc = if !config.fallback_providers.is_empty() {
-            let mut chain: Vec> = vec![primary_driver.clone()];
-            for fb in &config.fallback_providers {
-                let fb_config = DriverConfig {
-                    provider: fb.provider.clone(),
-                    api_key: if fb.api_key_env.is_empty() {
-                        None
-                    } else {
-                        std::env::var(&fb.api_key_env).ok()
-                    },
-                    base_url: fb
-                        .base_url
-                        .clone()
-                        .or_else(|| config.provider_urls.get(&fb.provider).cloned()),
-                };
-                match drivers::create_driver(&fb_config) {
-                    Ok(d) => {
-                        info!(
-                            provider = %fb.provider,
-                            model = %fb.model,
-                            "Fallback provider configured"
-                        );
-                        chain.push(d);
-                    }
-                    Err(e) => {
-                        warn!(
-                            provider = %fb.provider,
-                            error = %e,
-                            "Fallback provider init failed — skipped"
-                        );
-                    }
+        match &primary_result {
+            Ok(d) => driver_chain.push(d.clone()),
+            Err(e) => {
+                warn!(
+                    provider = %config.default_model.provider,
+                    error = %e,
+                    "Primary LLM driver init failed — dashboard will still be accessible"
+                );
+            }
+        }
+
+        // Add fallback providers to the chain
+        for fb in &config.fallback_providers {
+            let fb_config = DriverConfig {
+                provider: fb.provider.clone(),
+                api_key: if fb.api_key_env.is_empty() {
+                    None
+                } else {
+                    std::env::var(&fb.api_key_env).ok()
+                },
+                base_url: fb
+                    .base_url
+                    .clone()
+                    .or_else(|| config.provider_urls.get(&fb.provider).cloned()),
+            };
+            match drivers::create_driver(&fb_config) {
+                Ok(d) => {
+                    info!(
+                        provider = %fb.provider,
+                        model = %fb.model,
+                        "Fallback provider configured"
+                    );
+                    driver_chain.push(d);
+                }
+                Err(e) => {
+                    warn!(
+                        provider = %fb.provider,
+                        error = %e,
+                        "Fallback provider init failed — skipped"
+                    );
                 }
             }
-            if chain.len() > 1 {
-                Arc::new(openfang_runtime::drivers::fallback::FallbackDriver::new(
-                    chain,
-                ))
-            } else {
-                primary_driver
-            }
+        }
+
+        // Use the chain, or create a stub driver if everything failed
+        let driver: Arc = if driver_chain.len() > 1 {
+            Arc::new(openfang_runtime::drivers::fallback::FallbackDriver::new(
+                driver_chain,
+            ))
+        } else if let Some(single) = driver_chain.into_iter().next() {
+            single
         } else {
-            primary_driver
+            // All drivers failed — use a stub that returns a helpful error.
+            // The kernel boots, dashboard is accessible, users can fix their config.
+            warn!("No LLM drivers available — agents will return errors until a provider is configured");
+            Arc::new(StubDriver) as Arc
         };
 
         // Initialize metering engine (shares the same SQLite connection as the memory substrate)
@@ -989,8 +1021,10 @@ impl OpenFangKernel {
                         && restored_entry.manifest.model.base_url.is_none()
                     {
                         let dm = &kernel.config.default_model;
-                        let is_default_provider = restored_entry.manifest.model.provider.is_empty();
-                        let is_default_model = restored_entry.manifest.model.model.is_empty();
+                        let is_default_provider = restored_entry.manifest.model.provider.is_empty()
+                            || restored_entry.manifest.model.provider == "default";
+                        let is_default_model = restored_entry.manifest.model.model.is_empty()
+                            || restored_entry.manifest.model.model == "default";
                         if is_default_provider && is_default_model {
                             if !dm.provider.is_empty() {
                                 restored_entry.manifest.model.provider = dm.provider.clone();
@@ -1068,8 +1102,8 @@ impl OpenFangKernel {
         info!(agent = %name, id = %agent_id, exec_mode = ?manifest.exec_policy.as_ref().map(|p| &p.mode), "Agent exec_policy resolved");
 
         // Overlay kernel default_model onto agent if agent didn't explicitly choose.
-        // Only override when the agent has empty (unset) provider/model fields.
-        // This preserves explicit model choices like provider="groq", model="llama-3.3-70b".
+        // Treat empty or "default" as "use the kernel's configured default_model".
+        // This allows bundled agents to defer to the user's configured provider/model.
         if manifest.model.api_key_env.is_none() && manifest.model.base_url.is_none() {
             // Check hot-reloaded override first, fall back to boot-time config
             let override_guard = self
@@ -1079,8 +1113,10 @@ impl OpenFangKernel {
             let dm = override_guard
                 .as_ref()
                 .unwrap_or(&self.config.default_model);
-            let is_default_provider = manifest.model.provider.is_empty();
-            let is_default_model = manifest.model.model.is_empty();
+            let is_default_provider =
+                manifest.model.provider.is_empty() || manifest.model.provider == "default";
+            let is_default_model =
+                manifest.model.model.is_empty() || manifest.model.model == "default";
             if is_default_provider && is_default_model {
                 if !dm.provider.is_empty() {
                     manifest.model.provider = dm.provider.clone();
@@ -2820,6 +2856,15 @@ impl OpenFangKernel {
                 max_iterations: max_iter,
                 ..Default::default()
             }),
+            // Autonomous hands must run in Continuous mode so the background loop picks them up.
+            // Reactive (default) only fires on incoming messages, so autonomous hands would be inert.
+            schedule: if def.agent.max_iterations.is_some() {
+                ScheduleMode::Continuous {
+                    check_interval_secs: 60,
+                }
+            } else {
+                ScheduleMode::default()
+            },
             skills: def.skills.clone(),
             mcp_servers: def.mcp_servers.clone(),
             // Hands are curated packages — if they declare shell_exec, grant full exec access
@@ -3636,7 +3681,7 @@ impl OpenFangKernel {
     }
 
     /// Start the background loop / register triggers for a single agent.
-    fn start_background_for_agent(
+    pub fn start_background_for_agent(
         self: &Arc,
         agent_id: AgentId,
         name: &str,
diff --git a/crates/openfang-types/src/model_catalog.rs b/crates/openfang-types/src/model_catalog.rs
index e477b366..375a5d5c 100644
--- a/crates/openfang-types/src/model_catalog.rs
+++ b/crates/openfang-types/src/model_catalog.rs
@@ -36,7 +36,7 @@ pub const GITHUB_COPILOT_BASE_URL: &str = "https://api.githubcopilot.com";
 pub const QWEN_BASE_URL: &str = "https://dashscope.aliyuncs.com/compatible-mode/v1";
 pub const MINIMAX_BASE_URL: &str = "https://api.minimax.io/v1";
 pub const ZHIPU_BASE_URL: &str = "https://open.bigmodel.cn/api/paas/v4";
-pub const ZHIPU_CODING_BASE_URL: &str = "https://open.bigmodel.cn/api/paas/v4";
+pub const ZHIPU_CODING_BASE_URL: &str = "https://open.bigmodel.cn/api/coding/paas/v4";
 pub const MOONSHOT_BASE_URL: &str = "https://api.moonshot.cn/v1";
 pub const QIANFAN_BASE_URL: &str = "https://qianfan.baidubce.com/v2";