Skip to content

fix(kanban): close sqlite connections in specify helpers#28803

Closed
worlldz wants to merge 2 commits into
NousResearch:mainfrom
worlldz:codex/fix-kanban-specify-fd-leak-originbase
Closed

fix(kanban): close sqlite connections in specify helpers#28803
worlldz wants to merge 2 commits into
NousResearch:mainfrom
worlldz:codex/fix-kanban-specify-fd-leak-originbase

Conversation

@worlldz

@worlldz worlldz commented May 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #28802

hermes_cli.kanban_specify currently uses with kb.connect() as conn: in helper paths like list_triage_ids() and specify_task().

For sqlite3.Connection, that pattern does not close the connection on exit. It only manages transaction scope, so repeated helper calls leak file descriptors in long-lived processes.

This patch switches those helper paths to explicit closing and adds regression coverage for sqlite-like connections whose context manager does not call close().

Validation:
uv run --extra dev pytest tests/hermes_cli/test_kanban_specify.py -q -k 'closes_connection or test_list_triage_ids'

Result:
3 passed in 8.46s

Live repro before fix:
{'base': 5, 'after': 52, 'delta': 47}

Live repro after fix:
{'base': 5, 'after': 5, 'delta': 0}

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Closing as already fixed on main — landed via commit ebe04c66c (fix(kanban): close kanban.db FD after every connect() in long-lived processes). All kanban_specify.py connection sites now use kb.connect_closing(). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: kanban specify helpers leak sqlite connections in long-lived processes

3 participants