Aller au contenu
login
arrow_backRetour aux issues
Tracer-Cloud/opensre #5248

Type the shell BackgroundRunFn seam (Protocol + TypedDict result)

ecoDébutant good first issue maintainability

descriptionDescription

**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. `surfaces/interactive_shell/runtime/background/runner.py` defines `BackgroundRunFn = Callable[..., dict[str, Any]]`. Both the accepted arguments and the result keys are stable in practice. **Change**: recover the real signature from the call sites, declare it as a Protocol, and describe the result dict as a TypedDict. Fix fallout. **Verify**: `make typecheck` clean; `uv run pytest tests/interactive_shell -q` green. **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 `). 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** Kick off work that runs in the background (start an investigation via `/investigate`, then keep typing) — the completion notification should still arrive in the shell, proving the background runner seam still round-trips its result dict. --- **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 ` 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.
codeOuvre sur GitHub