Skip to content

[codex] Rename FlamePy agent API to service session#454

Merged
k82cn merged 2 commits into
xflops:mainfrom
k82cn:codex/flamepy-service-session
May 14, 2026
Merged

[codex] Rename FlamePy agent API to service session#454
k82cn merged 2 commits into
xflops:mainfrom
k82cn:codex/flamepy-service-session

Conversation

@k82cn
Copy link
Copy Markdown
Contributor

@k82cn k82cn commented May 14, 2026

Summary

  • Rename the Python SDK namespace from flamepy.agent to flamepy.service.
  • Rename the service wrapper class from Agent to Session and update docs, examples, and E2E usage.
  • Reorganize Python SDK tests into cache, core, service, and runner modules.

Validation

  • sdk/python/.venv/bin/python -m pytest sdk/python/tests passed: 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.py passed.
  • 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.py passed.
  • git diff --check passed.

Notes

tasks/ contains local trace notes and was intentionally excluded from this PR.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 20 to 25
Session as CoreSession,
)
from flamepy.core.client import (
create_session,
open_session,
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These imports from flamepy.core.client are redundant and can be combined into a single statement for better readability and maintenance.

    Session as CoreSession,
    create_session,
    open_session,
)

Comment thread examples/crawler/crawler.py Outdated

@ins.entrypoint
def crawler_app(wp: WebPage) -> Summary:
text = requests.get(wp.url, headers=headers).text
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
text = requests.get(wp.url, headers=headers).text
response = requests.get(wp.url, headers=headers)
response.raise_for_status()
text = response.text

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@k82cn k82cn merged commit 661773e into xflops:main May 14, 2026
6 of 7 checks passed
@k82cn k82cn deleted the codex/flamepy-service-session branch May 14, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant