Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

docs(agent): document ask_timeout_secs and agent questions

thinhlpg0485e718f0de
diff --git a/docs/src/pages/docs/agent/console.mdx b/docs/src/pages/docs/agent/console.mdx
index a8febcae6..25666544f 100644
--- a/docs/src/pages/docs/agent/console.mdx
+++ b/docs/src/pages/docs/agent/console.mdx
@@ -105,6 +105,30 @@ Two knobs in `agent.toml` and two in `~/.jan/config.toml` tune this:
See [Project config](/docs/agent/project-config) for the `agent.toml` keys.
+## Questions
+
+The agent can use the `ask` tool when it needs your choice before it keeps working. The console
+stops the run and shows a question with options; one option may be marked as recommended.
+
+By default a question waits forever for your answer. To keep unattended or long-running runs from
+stalling when nobody is at the terminal, set `ask_timeout_secs` in `~/.jan/config.toml`, or edit
+the same row in `/settings`:
+
+```toml
+ask_timeout_secs = 60
+```
+
+When the value is `N`, an unanswered question auto-resolves after `N` seconds. Jan chooses the
+recommended option when the question has one, otherwise the first option. The auto choice is always
+one of the listed options, not the UI-only custom answer. `0` or an unset key means wait forever,
+which is the default.
+
+Timed-out answers are marked in the tool result with `NOTE [ask_timeout]`, so the agent can tell
+they were auto-selected instead of typed by you.
+
+This does not apply to the tool-permission prompts from `jan --safe`; those never auto-approve. See
+[Approving work](#approving-work) and [Tool permissions](/docs/agent/permissions).
+
## Approving work
Writes and shell commands are auto-approved. Start the console with `jan --safe` and they stop to
diff --git a/docs/src/pages/docs/agent/slash-commands.mdx b/docs/src/pages/docs/agent/slash-commands.mdx
index d8f3f9e35..6666595d2 100644
--- a/docs/src/pages/docs/agent/slash-commands.mdx
+++ b/docs/src/pages/docs/agent/slash-commands.mdx
@@ -62,7 +62,7 @@ See [Run modes](/docs/agent/run-modes), [Goals and todos](/docs/agent/goals-and-
| `/login` | Sign in to Tokamak and save the API key |
| `/config` | View provider config (`~/.jan/config.toml`) |
| `/terminal-setup` | Configure this terminal so <kbd>Shift</kbd>+<kbd>Enter</kbd> inserts a newline and, on macOS, <kbd>Option</kbd>+<kbd>Delete</kbd> deletes a word. Writes the terminal's own config where it can (VS Code, kitty, Ghostty, tmux) and prints the manual step where it cannot. Idempotent |
-| `/settings [max_parallel_subagents N]` | Edit settings in an interactive menu - the project's `agent.toml` (`[agent]` knobs `context_window`, `compaction_reserve_tokens`, `max_tokens`, `max_parallel_subagents`, `instructions_file`, `[budget]` limits, the `[tools]` / `[skills]` toggles) and user-wide `~/.jan/config.toml` keys such as `wave` in the one list (Enter edits a row, `x` resets to default, Esc cancels, clearing the field unsets - except `wave`, where an empty field is the "no sweep" value and `x` restores the default πŸ‘‹). The leading `providers` row opens a manager for OpenAI-compatible providers in `~/.jan/config.toml`: `a` adds, Enter edits, `d` twice deletes. `max_parallel_subagents N` works as a one-shot shortcut. Writes apply on the next run, except cosmetic ones like `wave` that apply immediately |
+| `/settings [max_parallel_subagents N]` | Edit settings in an interactive menu - the project's `agent.toml` (`[agent]` knobs `context_window`, `compaction_reserve_tokens`, `max_tokens`, `max_parallel_subagents`, `instructions_file`, `[budget]` limits, the `[tools]` / `[skills]` toggles) and user-wide `~/.jan/config.toml` keys such as `wave` and `ask_timeout_secs` in the one list (Enter edits a row, `x` resets to default, Esc cancels, clearing the field unsets - except `wave`, where an empty field is the "no sweep" value and `x` restores the default πŸ‘‹). The leading `providers` row opens a manager for OpenAI-compatible providers in `~/.jan/config.toml`: `a` adds, Enter edits, `d` twice deletes. `max_parallel_subagents N` works as a one-shot shortcut. Writes apply on the next run, except cosmetic ones like `wave` that apply immediately |
See [Providers](/docs/agent/providers), [MCP](/docs/agent/mcp), [Plugins](/docs/agent/plugins), and
[Keybindings](/docs/agent/keybindings#shiftenter-and-the-option-key).