[codex] Rename FlamePy agent API to service session#454
Conversation
There was a problem hiding this comment.
Code Review
This pull request renames the "Agent" component to "Service Session" across the documentation, examples, and Python SDK. Key modifications include renaming the flamepy.agent module to flamepy.service, updating the Agent class to Session, and consolidating unit tests. Reviewer feedback highlights opportunities to consolidate redundant imports in the service client and improve error handling in the crawler example by verifying HTTP response statuses.
| Session as CoreSession, | ||
| ) | ||
| from flamepy.core.client import ( | ||
| create_session, | ||
| open_session, | ||
| ) |
|
|
||
| @ins.entrypoint | ||
| def crawler_app(wp: WebPage) -> Summary: | ||
| text = requests.get(wp.url, headers=headers).text |
There was a problem hiding this comment.
It is recommended to check the HTTP response status before accessing the content. Adding response.raise_for_status() will ensure that any request errors (e.g., 404 or 500) are caught early, preventing the crawler from attempting to parse error pages.
| text = requests.get(wp.url, headers=headers).text | |
| response = requests.get(wp.url, headers=headers) | |
| response.raise_for_status() | |
| text = response.text |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
flamepy.agenttoflamepy.service.AgenttoSessionand update docs, examples, and E2E usage.Validation
sdk/python/.venv/bin/python -m pytest sdk/python/testspassed: 208 tests.sdk/python/.venv/bin/ruff check sdk/python/tests/test_cache.py sdk/python/tests/test_core.py sdk/python/tests/test_service.py sdk/python/tests/test_runner.pypassed.sdk/python/.venv/bin/ruff format --check sdk/python/tests/test_cache.py sdk/python/tests/test_core.py sdk/python/tests/test_service.py sdk/python/tests/test_runner.pypassed.git diff --checkpassed.Notes
tasks/contains local trace notes and was intentionally excluded from this PR.