Skip to content

Your lightweight open-source personal agent.

fix: wire toolHintMaxLength through AgentLoop constructors

Tim O'Brien67875d7a15ae
diff --git a/docs/configuration.md b/docs/configuration.md
index d0a7fe940..f5fb32cb7 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -1131,3 +1131,23 @@ Disabled skills are excluded from the main agent's skill summary, from always-on
| Option | Default | Description |
|--------|---------|-------------|
| `agents.defaults.disabledSkills` | `[]` | List of skill directory names to exclude from loading. Applies to both built-in skills and workspace skills. |
+
+## Tool Hint Max Length
+
+Tool hints are the short progress messages shown when the agent calls tools (e.g. `$ cd …/project && npm test`). By default, these are truncated at 40 characters, which can make long commands hard to read.
+
+Set `agents.defaults.toolHintMaxLength` to control the truncation threshold:
+
+```json
+{
+ "agents": {
+ "defaults": {
+ "toolHintMaxLength": 120
+ }
+ }
+}
+```
+
+| Option | Default | Description |
+|--------|---------|-------------|
+| `agents.defaults.toolHintMaxLength` | `40` | Maximum characters for tool hint display. Range: 20–500. Higher values show more of the command or path; lower values keep hints compact. |
diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.py
index 984711975..784c4da13 100644
--- a/nanobot/agent/loop.py
+++ b/nanobot/agent/loop.py
@@ -198,6 +198,7 @@ class AgentLoop:
context_block_limit: int | None = None,
max_tool_result_chars: int | None = None,
provider_retry_mode: str = "standard",
+ tool_hint_max_length: int | None = None,
web_config: WebToolsConfig | None = None,
exec_config: ExecToolConfig | None = None,
cron_service: CronService | None = None,
@@ -242,7 +243,10 @@ class AgentLoop:
else defaults.max_tool_result_chars
)
self.provider_retry_mode = provider_retry_mode
- self.tool_hint_max_length = defaults.tool_hint_max_length
+ self.tool_hint_max_length = (
+ tool_hint_max_length if tool_hint_max_length is not None
+ else defaults.tool_hint_max_length
+ )
self.web_config = web_config or WebToolsConfig()
self.exec_config = exec_config or ExecToolConfig()
self.cron_service = cron_service
diff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.py
index c54a2bc7c..1f0186f1d 100644
--- a/nanobot/cli/commands.py
+++ b/nanobot/cli/commands.py
@@ -557,6 +557,7 @@ def serve(
context_block_limit=runtime_config.agents.defaults.context_block_limit,
max_tool_result_chars=runtime_config.agents.defaults.max_tool_result_chars,
provider_retry_mode=runtime_config.agents.defaults.provider_retry_mode,
+ tool_hint_max_length=runtime_config.agents.defaults.tool_hint_max_length,
web_config=runtime_config.tools.web,
exec_config=runtime_config.tools.exec,
restrict_to_workspace=runtime_config.tools.restrict_to_workspace,
@@ -681,6 +682,7 @@ def _run_gateway(
context_block_limit=config.agents.defaults.context_block_limit,
max_tool_result_chars=config.agents.defaults.max_tool_result_chars,
provider_retry_mode=config.agents.defaults.provider_retry_mode,
+ tool_hint_max_length=config.agents.defaults.tool_hint_max_length,
exec_config=config.tools.exec,
cron_service=cron,
restrict_to_workspace=config.tools.restrict_to_workspace,
@@ -1073,6 +1075,7 @@ def agent(
context_block_limit=config.agents.defaults.context_block_limit,
max_tool_result_chars=config.agents.defaults.max_tool_result_chars,
provider_retry_mode=config.agents.defaults.provider_retry_mode,
+ tool_hint_max_length=config.agents.defaults.tool_hint_max_length,
exec_config=config.tools.exec,
cron_service=cron,
restrict_to_workspace=config.tools.restrict_to_workspace,
diff --git a/nanobot/nanobot.py b/nanobot/nanobot.py
index 5e5857595..60c6dcdcb 100644
--- a/nanobot/nanobot.py
+++ b/nanobot/nanobot.py
@@ -76,6 +76,7 @@ class Nanobot:
context_block_limit=defaults.context_block_limit,
max_tool_result_chars=defaults.max_tool_result_chars,
provider_retry_mode=defaults.provider_retry_mode,
+ tool_hint_max_length=defaults.tool_hint_max_length,
web_config=config.tools.web,
exec_config=config.tools.exec,
restrict_to_workspace=config.tools.restrict_to_workspace,