Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

Merge upstream/main into json-tool-calls-default

Steven Enamakelc14591602eff
diff --cc app/src/lib/i18n/en.ts
index d38c6c45df,d9004207e2..f41083bf54
--- a/app/src/lib/i18n/en.ts
+++ b/app/src/lib/i18n/en.ts
@@@ -6264,18 -4684,16 +4684,27 @@@ const en: TranslationMap =
'settings.agentAccess.group.approvals': 'Approvals',
'settings.agentAccess.group.fileSystem': 'File system',
'settings.agentAccess.group.limits': 'Limits',
+ 'settings.agentAccess.toolFormat.label': 'Tool call format',
+ 'settings.agentAccess.toolFormat.desc':
+ 'How the agent writes tool calls to the model. JSON is the most reliable across models; code-style formats are experimental and can be misread by some models. Applies to new conversations.',
+ 'settings.agentAccess.toolFormat.option.auto': 'JSON (recommended)',
+ 'settings.agentAccess.toolFormat.option.native': 'Native JSON (provider structured calls)',
+ 'settings.agentAccess.toolFormat.option.xml': 'JSON in tags',
+ 'settings.agentAccess.toolFormat.option.pformat': 'P-Format (experimental)',
+ 'settings.agentAccess.toolFormat.option.python': 'Python (experimental)',
+ 'settings.agentAccess.toolFormat.option.typescript': 'TypeScript (experimental)',
+ 'settings.agentAccess.toolFormat.envOverride':
+ 'The OPENHUMAN_TOOL_DISPATCHER environment variable is overriding this setting, so changes here have no effect until it is unset.',
'settings.agentAccess.grantedFolders': 'Granted folders',
+ 'settings.agentAccess.filesFolder.label': 'Files folder',
+ 'settings.agentAccess.filesFolder.desc':
+ 'Where the files the agent makes, like decks, documents, images and videos, are saved. A change applies to new files; existing files stay where they are.',
+ 'settings.agentAccess.filesFolder.save': 'Save',
+ 'settings.agentAccess.filesFolder.reset': 'Use default',
+ 'settings.agentAccess.filesFolder.saved': 'Files folder updated',
+ 'settings.agentAccess.filesFolder.loadError': 'Could not load the files folder.',
+ 'settings.agentAccess.filesFolder.open': 'Show in folder',
+ 'settings.agentAccess.filesFolder.openError': 'Couldn’t open the files folder.',
'settings.agentAccess.alwaysAllow': 'Always-allowed tools',
'settings.agentAccess.alwaysAllowDesc':
'Tools you marked "Always allow" in chat run without asking. Remove one to be prompted again.',
diff --cc crates/openhuman-core/src/config/ops/agent.rs
index a51fc09a62,89e994664f..7b5f581817
--- a/crates/openhuman-core/src/config/ops/agent.rs
+++ b/crates/openhuman-core/src/config/ops/agent.rs
@@@ -56,22 -55,12 +55,22 @@@ pub struct AgentSettingsPatch
/// root (or to a guessed user dir) is silently ignored. Going through the
/// running core writes wherever `Config::save` actually points.
pub chat_agent_id: Option<String>,
+ /// How tool calls are spoken to the model (`[agent] tool_dispatcher`):
+ /// one of [`TOOL_DISPATCHER_CHOICES`] (case-insensitive). `None` leaves it
+ /// unchanged. Takes effect for new sessions; a resumed thread keeps the
+ /// dialect its prompt was frozen with.
+ pub tool_dispatcher: Option<String>,
}
+/// Accepted spellings of `[agent] tool_dispatcher`. `auto` is the default:
+/// native structured calls when the provider supports them, else JSON-in-tag.
+pub const TOOL_DISPATCHER_CHOICES: [&str; 6] =
+ ["auto", "native", "xml", "pformat", "python", "typescript"];
+
/// Partial update for the agent's editable filesystem roots.
///
- /// Only `action_dir` is editable today (issue #3240). `workspace_dir` and
- /// `projects_dir` are intentionally read-only and not part of this patch.
+ /// `action_dir` (issue #3240) and the files folder (#5505) are editable.
+ /// `workspace_dir` and `projects_dir` are intentionally read-only.
#[derive(Debug, Clone, Default)]
pub struct AgentPathsPatch {
/// New action sandbox root. `Some("")`/whitespace clears the override and
@@@ -315,12 -287,8 +317,12 @@@ pub async fn get_agent_settings() -> Re
"env_override": crate::tools::timeout::env_override_active(),
"min_timeout_secs": crate::tools::timeout::MIN_TIMEOUT_SECS,
"max_timeout_secs": crate::tools::timeout::MAX_TIMEOUT_SECS,
+ "tool_dispatcher": config.agent.tool_dispatcher,
+ "tool_dispatcher_env_override": std::env::var("OPENHUMAN_TOOL_DISPATCHER")
+ .map(|v| !v.trim().is_empty())
+ .unwrap_or(false),
});
- Ok(RpcOutcome::single_log(value, "agent settings read"))
+ Ok(Outcome::single_log(value, "agent settings read"))
}
/// Expand a leading `~/` to the user's home directory, building the path