Skip to content

Remove dead and duplicated private code - #93

Open
jadenfix wants to merge 5 commits into
roe-ai:mainfrom
jadenfix:cleanup/dead-code
Open

jadenfix wants to merge 5 commits into
roe-ai:mainfrom
jadenfix:cleanup/dead-code

Conversation

@jadenfix

@jadenfix jadenfix commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

No public API or behaviour changes:

  • Remove the root main.py "Hello from roe-python!" placeholder (not part of the package).
  • Drop an empty if TYPE_CHECKING: pass block in api/policies.py.
  • Drop three if not chunk: continue guards in api/agents.py that can't fire (_iter_chunks never yields an empty slice).
  • Share one private _iter_chunks / _MAX_BATCH_SIZE in api/agents.py instead of identical copies in AgentJobsAPI and AgentsAPI.
  • Use UNSET directly in models/job.py instead of the private _UNSET_SENTINEL() wrapper.

Testing

uv run pytest, ruff check, ruff format --check. Merges cleanly with #89 and #90.

Note: a Roe API key is required to test these changes end to end; the unit tests here run without one.

main.py at the repo root is the "Hello from roe-python!" placeholder
left by project init. It is not part of the package (the build ships
src/roe only), and nothing imports or runs it.

Tested: uv run pytest, ruff check, ruff format --check pass.
`if TYPE_CHECKING: pass` guards nothing. Remove it and the now unused
TYPE_CHECKING import.

Tested: uv run pytest, ruff check, ruff format --check pass.
_iter_chunks slices items[i:i + chunk_size] only for i < len(items),
so every chunk it yields is non-empty and the three
`if not chunk: continue` guards can never fire.

Tested: uv run pytest, ruff check, ruff format --check pass.
AgentJobsAPI and AgentsAPI each defined an identical _iter_chunks
static method and _MAX_BATCH_SIZE = 1000 class attribute. Keep a single
private module-level copy of each and call it from both classes.

Tested: uv run pytest, ruff check, ruff format --check pass.
_UNSET_SENTINEL() in models/job.py only lazily imported and returned
roe._generated.types.UNSET. The module already imports from
roe._generated at the top, so import UNSET there and drop the wrapper.

Tested: uv run pytest, ruff check, ruff format --check pass; manual
check that JobBatch.retrieve_status still sets error_message to Unset
for both fresh and cached statuses.
@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low impact] This PR appears safe to merge; no actionable issues were found.

Summary

Removes unused private code without changing the public API or the reviewed behavior.

  • Agent batch calls share one splitter and keep the same 1000-item limit.
  • Job status objects use the generated missing-value marker directly.
  • The root greeting script and empty policy type-checking block are removed.

No actionable issues found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "Use UNSET directly instead of the _UNSET..." · Reviewed by Greptile

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