Skip to content

chore: clean up 15 unused imports in src/backend/routers/agents.py (ruff F401) #984

Closed

Description

@AndriiPasternak31

Summary

src/backend/routers/agents.py carries 15 ruff F401 unused-import errors. This is pre-existing platform debt — origin/dev has 16, so recent work (e.g. the #307 heartbeat layer) is debt-neutral and did not introduce them. Surfaced during the #307 engineering review; filing as a separate cleanup so it doesn't ride along in a feature PR.

The errors (ruff check --output-format=concise)

src/backend/routers/agents.py:14:8   F401 `docker` imported but unused
src/backend/routers/agents.py:16:21  F401 `pathlib.Path` imported but unused
src/backend/routers/agents.py:25:5   F401 `services.docker_service.docker_client` imported but unused
src/backend/routers/agents.py:30:39  F401 `services.docker_utils.container_reload` imported but unused
src/backend/routers/agents.py:31:5   F401 `services.docker_utils.volume_get` imported but unused
src/backend/routers/agents.py:31:17  F401 `services.docker_utils.volume_remove` imported but unused
src/backend/routers/agents.py:33:22  F401 `services.git_service` imported but unused
src/backend/routers/agents.py:34:47  F401 `services.image_generation_prompts.AVATAR_EMOTIONS` imported but unused
src/backend/routers/agents.py:44:5   F401 `services.agent_service.get_agents_by_prefix` imported but unused
src/backend/routers/agents.py:45:5   F401 `services.agent_service.get_next_version_name` imported but unused
src/backend/routers/agents.py:46:5   F401 `services.agent_service.get_latest_version` imported but unused
src/backend/routers/agents.py:47:5   F401 `services.agent_service.check_shared_folder_mounts_match` imported but unused
src/backend/routers/agents.py:48:5   F401 `services.agent_service.check_api_key_env_matches` imported but unused
src/backend/routers/agents.py:51:5   F401 `services.agent_service.recreate_container_with_updated_config` imported but unused
src/backend/routers/agents.py:292:26 F401 `datetime.datetime` imported but unused

Suggested fix

ruff check --fix src/backend/routers/agents.py removes all 15 automatically.

⚠️ Verify before blind --fix: confirm none of these are intentional re-exports consumed elsewhere via from routers.agents import X (e.g. the services.agent_service.* helpers). Grep each symbol across the codebase first; remove only the genuinely-dead ones. After the fix, run the backend test suite to confirm nothing imported these transitively.

Scope / priority

Non-blocking cleanup (P3). Good first issue — mechanical, well-bounded, with a clear verification path.

Filed from the #307 engineering-review follow-up.

Activity

  1. Shivammm77 commented on May 30, 2026

    @Shivammm77

    hii i am first time open source contributor and i would love to work on this cleanup as my first issue. could you please assign it to me

  2. added
    theme-devex
    type-refactor
    on Jun 3, 2026
  3. added
    complexity-low
    status-incubating
    on Jun 12, 2026
  4. added a commit that references this issue on Jun 21, 2026
    a88f5fc
  5. removed
    status-incubating
    on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-lowgood first issuepriority-p3theme-devextype-refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions