Skip to content

Quality gate: no new Callable[..., Any] under harness ports and shell runtime #5244

Description

@YauhenBichel

Claiming this issue: before starting, ask for it in the OpenSRE Discord (https://discord.com/invite/opensre) so a maintainer can assign it to you and nobody duplicates the work.

Untyped callable seams keep reappearing in core/agent_harness/ports.py, platform/harness_ports.py, and surfaces/interactive_shell/runtime/. Sibling issues burn the existing ones down; this issue stops new ones arriving.

Change: add a quality test (precedent: tests/quality/test_no_constant_condition_toggles.py) that counts Callable[..., Any] occurrences under those three paths and pins today's count as a baseline. New occurrences fail the test; the assertion message tells the author to type the seam or (for a legitimate removal) lower the baseline.

Verify: the new test passes on main and fails when you add one occurrence anywhere under the covered paths.

Run it locally (baseline before, repeat after your change)

  1. One-time setup from the repo root: make install
  2. Start the shell: uv run opensre
    • First run: the onboarding prompts appear — Escape skips GitHub sign-in and the loops picker; submitting a blank LLM key defers key setup (you can add one later with /auth login <provider>).
  3. Type good morning — a normal streamed assistant reply proves the turn engine and your LLM config work end to end.
  4. Leave with /exit.

Run this once on main before you start (so you know what healthy looks like) and again on your branch after the change.

Manual check for this change
No shell walk needed — this adds a test only. Verify by running uv run pytest tests/quality -q, then temporarily add x: Callable[..., Any] to a covered file and confirm the new test fails with a message that tells the author what to do.


Ground rules for this change

  • New or changed Protocol methods use a docstring-only body — no ..., no pass, no raise NotImplementedError (AGENTS.md, Code Style). Do not convert pre-existing NotImplementedError stubs elsewhere — out of scope.
  • Remove any retired name or alias completely in the same PR — no compatibility re-exports.
  • CI's typecheck does not cover tests/: run uv run mypy <touched test files> yourself.
  • No new module-level mutable state; dependencies arrive via constructor or parameter.
  • Before opening the PR follow CI.md (lint, format, typecheck, tests) and fill the PR template, including the AI-usage disclosure.

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomersmaintainabilityImproves long-term code maintainabilitytestsTest coverage and test organization

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions