Skip to content
TheChatArchiveThe Chat Archive
fable-5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

Cron sessions do not appear under their assigned project Non-empty cron or background…

  1. User

    Cron sessions do not appear under their assigned project

    Non-empty cron or background sessions assigned to a project must be shown when that project is selected. They remain hidden in default, unassigned, empty, and unrelated-project views. The behavior must be consistent across supported session retrieval modes.

    Interface

    No new interfaces are introduced.

  2. Assistant

    Now let me look at the client-side filtering code in detail:

  3. Assistant

    Now the client side. First add a background-session helper next to _isCliSession:

  4. Assistant

    Now let me write a regression test:

  5. Assistant

    All 11 pass. Now run the related existing suites to check for regressions:

  6. Assistant

    Those 8 failures pre-exist on the clean tree (environment-related, not from my change). Re-run the broader selection:

  7. Assistant

    Now thread the parameter through both retrieval modes of all_sessions():

  8. Assistant

    Now update the /api/sessions handler in routes.py:

  9. Assistant

    Now the client: the sessions fetch must carry the active project, and selecting a project chip must trigger a re-fetch. Let me find the fetch:

  10. Assistant

    Now update the chip click handlers to re-fetch when the project scope changes:

  11. Assistant

    Now I need to update my regression test to match the query-param design:

  12. Assistant

    Let me add an endpoint-level integration test for the CLI-bridge mode. First check the gateway test helpers:

  13. Assistant

    The test_server fixture is autouse. Add an endpoint-level integration test:

  14. Assistant

    Now run the broader test selection to verify no regressions:

  15. Assistant

    No conflicts. Now run the full test suite:

  16. Assistant

    Clean tree has 96 failures vs 85 with my changes — let me diff the failure sets precisely:

  17. Assistant

    Now implement the redesigned server side. First api/models.py:

  18. Assistant

    Now revert the all_sessions signature changes:

  19. Assistant

    Now update api/routes.py:

  20. Assistant

    Now fix the client fetch to preserve the pinned api('/api/sessions' + allProfilesQS) expression:

  21. Assistant

    Update the regression tests to the final design:

  22. Assistant

    All 105 pass. Run the full suite and diff against the clean-tree baseline:

  23. Assistant

    No new failures — all 82 are a subset of the 96 pre-existing baseline failures (mostly missing node in this environment). Let me review the final diff:

  24. Assistant

    The diff is complete and coherent. Let me add a CHANGELOG entry per repo convention:

  25. Assistant

    All green — no new failures against the pre-existing baseline. The fix is complete.

    Summary

    Bug: Cron/background sessions assigned to a project (e.g. the auto-created "Cron Jobs" project) never appeared when that project was selected in the sidebar. The server unconditionally dropped cron rows via _hide_from_default_sidebar() in every retrieval mode, so the client's project filter — which operates on the fetched payload — could never match them: the project chip always looked empty.

    Fix (two-stage filtering, keeping cron rows hidden in all default views):

    1. api/models.py

      • _hide_from_default_sidebar() (api/models.py:2183) now passes through cron rows that are project-assigned and non-empty so the request layer can scope them; empty or unassigned cron rows are still dropped outright. Both all_sessions() retrieval modes (session-index path and full-scan fallback) share this predicate, so they stay consistent.
      • New hide_background_session_for_project_scope(session, selected_project_id) (api/models.py:2204) — the per-request decision: a cron row is visible only when the selected project matches its project_id and it holds real messages; hidden in default, unassigned, empty, and unrelated-project views.
    2. api/routes.py

      • /api/sessions reads an optional project_id query param and applies the scope filter to both retrieval modes: WebUI-store rows (api/routes.py:4436) and the CLI/agent-bridge rows in deduped_cli (api/routes.py:4464). The all_sessions(diag=diag) call contract is untouched (pinned by existing tests).
      • /api/sessions/search has no project scope, so it filters the passed-through cron rows back out (api/routes.py:6996).
    3. static/sessions.js

      • renderSessionList() appends project_id=<active project> to the sessions fetch when a project chip is selected; project-chip clicks trigger a scoped re-fetch after the instant cache render.
      • New _isBackgroundSession() helper keeps stale project-scoped cron rows out of the default ("All") view when switching chips before the re-fetch lands; the Unassigned and unrelated-project branches already exclude them via project_id checks.

    Tests: new tests/test_cron_project_sidebar_visibility.py (24 assertions across 21 tests) covering the projection matrix, the scope predicate, index vs full-scan mode agreement, an HTTP integration test through the CLI bridge (hidden by default → visible under the Cron Jobs project → hidden for unrelated projects), and source-contract pins. Full suite: 6372 passed; the 82 failures are all pre-existing on the clean tree (missing node in this environment) — zero new failures. CHANGELOG updated.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.