docs(examples): align Ask Oracle conventions - #4655
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
Python API breakage checks — ✅ PASSEDResult: ✅ PASSED |
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
|
✅ Review complete. This review was performed through OpenHands Cloud Automation. You can log in and view the conversation here. |
all-hands-bot
left a comment
There was a problem hiding this comment.
Both changes here align the Ask Oracle example with the conventions already used everywhere else in examples/01_standalone_sdk/:
Tool(name=AskOracleTool.name)is what the docs, theask_oracletest suite, and every other example that wires a built-in tool use, instead of a duplicated string literal.conversation.conversation_statsis the public accessor used in every SDK example that prints metrics (see27_observability_laminar.py,13_get_llm_metrics.py,36_event_json_to_openai_messages.py, etc.);conversation.state.statsworks but bypasses the supported API. Renamingcombinedtocostis a small but nice readability win — the name now matches what the value actually holds.- Dropping the redundant inline comment over
ORACLE_PROFILE_NAMEis also correct — the constant name and the module docstring already explain it.
No behavior change, no API surface change, no dependency change. Tests live in tests/tools/ask_oracle/ and exercise the tool itself, not this example script — so there is no test gap to address from a doc-only edit like this.
✅ Approving.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
Single-file doc-only change to an example script; semantics are unchanged becauseAskOracleTool.nameresolves to the same string"ask_oracle"andconversation.conversation_statsis the supported accessor forself._state.stats.
VERDICT:
✅ Worth merging: Conventions are now consistent with the rest of examples/01_standalone_sdk/.
KEY INSIGHT:
Using class-level .name constants for tool registration and conversation.conversation_stats for metrics is the convention across this repo — once you spot it, every example that drifts from it becomes visible.
This review was generated by an AI agent (OpenHands) on behalf of the user through OpenHands Automation. View conversation
HUMAN:
This PR tweaks a bit the Ask Oracle tool example, to be consistent with the patterns in other examples in the codebase.
AGENT:
Why
Keep the checked-in Ask Oracle example aligned with established SDK usage patterns and the synchronized documentation.
Summary
AskOracleTool.name.conversation_statsmetrics accessor.Issue Number
Follow-up to SDK PR #3673. Documentation: OpenHands/docs PR #566.
How to Test
Result:
1 passed, 69 deselected.Also ran:
uv run pre-commit run --files examples/01_standalone_sdk/58_ask_oracle_tool/main.pyAll hooks passed.
Video/Screenshots
Not applicable; this is a small example-code consistency change.
Design Doc
Not applicable.
Type
Notes
This PR was created by an AI agent (OpenAI Codex) on behalf of the user.
🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.13-nodejs22-slimgolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:41bb901-pythonRun
All tags pushed for this build
About Multi-Architecture Support
41bb901-python) is a multi-arch manifest supporting both amd64 and arm6441bb901-python-amd64) are also available if needed