# Thinking and Tool-Call Procedure

## Goal

Keep model responses visible and tool calls parseable while allowing an agent to
reason enough for the task.

## Default mode

Use direct-answer mode by default for ordinary requests. Long visible reasoning
wrappers can consume output budget and can interfere with tool-call parsing.

Expose explicit controls for:

```text
thinking on
thinking off
thinking status
automatic thinking selection
```

Automatic selection may enable more reasoning for explicit planning,
decomposition, or analysis requests, but should preserve direct mode otherwise.

## Tool-call invariant

When a response is expected to contain tool calls, use the parser-safe mode.
Do not allow a reasoning wrapper to surround or corrupt tool-call JSON.

If a model uses visible thinking in a previous turn, strip that reasoning from
the next model-facing conversation history while preserving a separate display
record for the user if the interface needs it. Prior reasoning blocks are not
durable task evidence and should not bias the model to imitate them.

## Token budget rule

If a deliberate reasoning mode is enabled, allocate enough output budget for it
to complete. A partially emitted reasoning wrapper followed by no answer is
neither a useful answer nor a safe tool action.

## Interpretation rule

Do not infer quality from how much hidden or visible reasoning a model emits.
Judge the work by:

- grounding in current evidence;
- correct tool selection and execution;
- behavioral verification;
- truthful final status.

## Failure handling

| Symptom | Likely response |
| --- | --- |
| Empty visible answer after long reasoning | return to direct/tool-safe mode and increase output budget only when necessary |
| Tool JSON malformed | repair arguments or request a new tool decision; do not run guessed shell substitutes |
| Long explanation without progress | preserve current evidence and ask for/choose a concrete next action |
| Repeated thought/recap text | retire it from model history; keep compact outcome evidence only |
