Tighten OpenClaw docs with verify/fail-fast section (#1132)#1147
Tighten OpenClaw docs with verify/fail-fast section (#1132)#1147VaibhavUpreti merged 8 commits intoTracer-Cloud:mainfrom
Conversation
Add unit tests for aws_sdk_client(Tracer-Cloud#884)
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Fix module mocking and import isolation for tests
Added a concise "Verify before investigating" section to help contributors quickly validate their OpenClaw setup before debugging. Includes: - verification command - correct bridge command - gateway check for stdio bridge Kept the section under 10 lines and aligned with existing documentation style.
| from __future__ import annotations | ||
|
|
||
| import sys | ||
| from types import ModuleType | ||
| import pytest | ||
| from datetime import datetime | ||
| import botocore.exceptions | ||
|
|
||
|
|
||
| # ---------------------------- | ||
| # Generic dynamic mock (handles ANY attribute) |
There was a problem hiding this comment.
unrelated, please remove this
|
|
||
| import sys | ||
| from types import ModuleType | ||
| import pytest |
Removal of unrelated imports
There was a problem hiding this comment.
Pull request overview
Adds a short fail-fast verification checklist to the OpenClaw documentation, and also introduces a new unit test suite for the generic AWS SDK client.
Changes:
- Add a “Verify before investigating” section to
docs/openclaw.mdxwith key setup validation commands. - Add
tests/services/test_aws_sdk_client.pycovering_is_operation_allowed,_sanitize_response, andexecute_aws_sdk_call.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/openclaw.mdx | Adds a concise pre-debug verification checklist for OpenClaw/OpenSRE setup. |
| tests/services/test_aws_sdk_client.py | Adds unit tests for app.services.aws_sdk_client behavior and error handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR adds a "Verify before investigating" section to
Confidence Score: 4/5Mergeable after the sys.modules teardown issue in the test file is resolved. One P1 finding (session-wide sys.modules pollution in the test file) should be addressed before merge; the remaining issues are P2 style/docs concerns that do not block correctness. tests/services/test_aws_sdk_client.py — sys.modules patching needs a scoped fixture with cleanup. Important Files Changed
|
| MAX_LIST_ITEMS, | ||
| ) | ||
|
|
||
| # ---------------------------- |
There was a problem hiding this comment.
Session-wide
sys.modules pollution
These four mock registrations run at import time and are never cleaned up, so they overwrite the real modules for the entire pytest session. Any other test file that later imports app.services.coralogix, app.services.tracer_client, app.services.datadog, or app.services.elasticsearch will silently receive the mock objects instead, which can mask real failures or cause unrelated tests to break depending on collection order.
Move the registrations into a module-scoped autouse fixture with teardown:
import pytest, sys
@pytest.fixture(autouse=True, scope="module")
def _patch_imports():
mocks = {
"app.services.coralogix": coralogix_mock,
"app.services.tracer_client": tracer_mock,
"app.services.datadog": create_mock_module("app.services.datadog"),
"app.services.elasticsearch": create_mock_module("app.services.elasticsearch"),
}
sys.modules.update(mocks)
yield
for key in mocks:
sys.modules.pop(key, None)| - Run `opensre integrations verify openclaw` | ||
| - Ensure the bridge command is `openclaw mcp serve` | ||
| - Confirm the OpenClaw Gateway is running when using the stdio bridge |
There was a problem hiding this comment.
Stdio-bridge-specific steps presented as universal checks
Bullets 2 and 3 only apply when the optional stdio bridge is in use (OPENCLAW_MCP_MODE=stdio). A reader who only completed the basic four-step setup has no bridge command and no Gateway to check, so these bullets will confuse them. Consider adding a qualifier like "(only if using the stdio bridge)" to those bullets.
VaibhavUpreti
left a comment
There was a problem hiding this comment.
Great @CoderHariswar !! Thanks for fixing this
|
🔥 Another one. @CoderHariswar said "here's a PR" and maintainers said "ship it". That's how it's done. 👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome. |

Fixes #1132
Describe the changes you have made in this PR -
Added a concise "Verify before investigating" section to docs/openclaw.mdx.
This section helps contributors quickly validate their OpenClaw setup before debugging by including:
The section is kept under 10 lines and reuses existing terminology from the documentation.
Demo/Screenshot for feature changes and bug fixes -
Documentation update (no UI changes)
Code Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?
If you used AI assistance:
Explain your implementation approach:
Checklist before requesting a review
Note: Please check Allow edits from maintainers if you would like us to assist in the PR.