Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions python/packages/core/agent_framework/_harness/_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,17 @@

logger = logging.getLogger(__name__)

DEFAULT_HARNESS_INSTRUCTIONS = """\

Check warning on line 55 in python/packages/core/agent_framework/_harness/_agent.py

View workflow job for this annotation

GitHub Actions / Public API Compatibility

DEFAULT_HARNESS_INSTRUCTIONS

Attribute value was changed: `'You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain your reasoning and thought process as you work through tasks.\n- Explain what you learned and what you are going to do next between tool calls, so the user can follow along with your thought process.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found.\n'` -> `'You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain decisions, actions, results, and important trade-offs at a high level. Do not expose private chain-of-thought or hidden reasoning.\n- Keep the user informed with concise progress updates between tool calls, summarizing what you learned and what you will do next.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found.\n'`
You are a helpful AI assistant that uses tools to complete tasks.

## General guidelines

- Think through the task before acting. Break complex work into clear steps.
- Use the tools available to you to gather information, perform actions, and verify results.
- Explain your reasoning and thought process as you work through tasks.
- Explain what you learned and what you are going to do next between tool calls, \
so the user can follow along with your thought process.
- Explain decisions, actions, results, and important trade-offs at a high level. \
Do not expose private chain-of-thought or hidden reasoning.
- Keep the user informed with concise progress updates between tool calls, \
summarizing what you learned and what you will do next.
Comment thread
1aifanatic marked this conversation as resolved.
- Avoid making more than 4 tool calls in a row without explaining what you are doing.
- If a tool call fails or returns unexpected results, adapt your approach rather than \
repeating the same call.
Expand Down
10 changes: 10 additions & 0 deletions python/packages/core/tests/core/test_harness_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ def test_create_harness_agent_with_defaults() -> None:
assert agent.id is not None


def test_default_harness_instructions_keep_reasoning_private() -> None:
"""Default guidance should request useful progress without private reasoning."""
instructions = _assemble_instructions(None, None)
assert instructions is not None
assert "Explain decisions, actions, results, and important trade-offs at a high level." in instructions
assert "Do not expose private chain-of-thought or hidden reasoning." in instructions
assert "concise progress updates between tool calls" in instructions
assert "thought process" not in instructions


def test_create_harness_agent_includes_all_default_providers(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
"""Default assembly should include history, compaction, todo, mode, and file memory."""
monkeypatch.chdir(tmp_path)
Expand Down
9 changes: 5 additions & 4 deletions python/samples/02-agents/harness/harness_data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
## Working with data
- When asked to analyze data, read the relevant files first, then perform the analysis.
- Show your analysis clearly with tables, summaries, and key insights.
- When calculations are needed, work through them step by step and show your reasoning.
- When calculations are needed, show the formulas, inputs, and results so the user can verify them.

## Writing output
- When asked to produce output files (e.g., reports, summaries, filtered data), use file_access_write to write them.
Expand All @@ -84,9 +84,10 @@
## Important
- Never modify or delete the original input data files unless explicitly asked to do so.
- If asked about data you haven't read yet, read it first before answering.
- Always explain your reasoning and thought process as you work through tasks.
- Always explain what you learned and what you are going to do next between tool calls, so the user can
follow along with your thought process.
- Explain decisions, actions, results, and important trade-offs at a high level. \
Do not expose private chain-of-thought or hidden reasoning.
- Keep the user informed with concise progress updates between tool calls, \
summarizing what you learned and what you will do next.
"""

MAX_CONTEXT_WINDOW_TOKENS = 1_050_000
Expand Down
Loading