Wrapper health: unused `praisonai/ui/database_config.py` leaves the FORCE_SQLITE escape hatch wired to nothing
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Read src/praisonai/praisonai/ui/database_config.py, its test at src/praisonai/tests/unit/test_database_config.py, and the UI database-selection path. First determine whether FORCE_SQLITE is still intended, then either remove the unused module and smoke script or wire the override into the selection path and add asserting tests. Done means the chosen behavior is connected or the dead code is removed, with tests matching that decision.
索引モデルが issue の本文から書いたものです。
説明
Summary
src/praisonai/praisonai/ui/database_config.py (56 lines) is a self-contained helper module with no production consumers anywhere in the monorepo. Its three functions implement a FORCE_SQLITE environment-variable override for UI database selection, but nothing in praisonai, praisonai-code or praisonai-bot ever calls them — so the FORCE_SQLITE escape hatch is implemented but not connected to any code path.
This is a lightweight wrapper-health cleanup, not a feature cut: either the module is dead code to be removed, or the FORCE_SQLITE override it was meant to provide has regressed and should be re-wired.
Current behaviour
src/praisonai/praisonai/ui/database_config.pydefinesshould_force_sqlite(),get_database_url_with_sqlite_override()andget_database_config_for_sqlalchemy()(database_config.py:12,:22,:40).- The token
FORCE_SQLITEand all three function names appear in exactly two files acrosssrc/: this module and its own testsrc/praisonai/tests/unit/test_database_config.py. There are zero other references (verified by repository-wide grep, including dynamic/string import paths). src/praisonai/tests/unit/test_database_config.pyis aprint()-based__main__smoke script with no assertions, so it pins no behaviour (it is not a guard/ratchet test).- Context: the
FORCE_SQLITEhelper appears to originate from the fix for #335 ("Database Conflict When PraisonAI Detects Supabase/Postgres", now closed). In the current tree the override logic is no longer invoked, so a user settingFORCE_SQLITE=trueto avoid Supabase/Postgres auto-detection would see no effect from this module.
Why it matters
- Maintenance / duplication clarity: ~56 lines of public-looking utility (
praisonai.ui.database_config) carried with no caller invites confusion and accidental re-use of a dead path. - Possible silent capability regression: if the
FORCE_SQLITEescape hatch from #335 is still intended, it currently does nothing — worth a maintainer decision rather than leaving it ambiguous.
No import or hot-path cost (the module is never imported at runtime); the concern is purely structural.
Category
Dead code (with a possible regressed-feature angle)
Capability preserved
- No CLI command, YAML path, or Python API is removed.
praisonai.ui.database_confighas no live consumers, so removing it (or wiring it in) changes nothing user-facing today. - If the maintainer intent is to keep the
FORCE_SQLITEbehaviour, the fix is to re-wire it into the UI DB-resolution path rather than remove it — preserving the intended #335 escape hatch.
Proposed approach
Pick one, based on whether the FORCE_SQLITE override is still desired:
- If the override is obsolete: remove
ui/database_config.pytogether with its non-assertingtests/unit/test_database_config.py(nothing else references either). - If the override is still wanted: call
should_force_sqlite()/get_database_url_with_sqlite_override()from the actual UI database-selection code and replace the print-script with a real asserting unit test.
Either way the change is small and non-breaking.
Resolution sketch
# Option A — remove dead module + its non-test script (no consumers):
# git rm src/praisonai/praisonai/ui/database_config.py
# git rm src/praisonai/tests/unit/test_database_config.py
# Option B — if FORCE_SQLITE should stay live, wire it where the UI DB URL is resolved:
from praisonai.ui.database_config import get_database_url_with_sqlite_override
database_url = get_database_url_with_sqlite_override() # None => fall back to SQLite
# ...and add an asserting test (assert should_force_sqlite() is True when FORCE_SQLITE=true)
Layer placement
- Primary layer: wrapper (
praisonai/ui/) - Touches core/tools/plugins: none
- 3-way surface (CLI + YAML + Python): not applicable — internal utility with no exposed surface; preserved either way
Severity
Low — isolated, zero-consumer module; cleanup or a small re-wire, no blast radius.
Validation
- Repository-wide grep:
FORCE_SQLITE,should_force_sqlite,get_database_url_with_sqlite_override,get_database_config_for_sqlalchemyresolve only to the module and its own test. - The test contains no assertions, so it encodes no decision to preserve.
- Not import-time or hot-path code; no runtime regression from either option.
Keep unchanged
praisonai/storage/adapters (PostgreSQLStorageAdapter,DynamoDBStorageAdapter, etc.) — these are load-bearing:praisonaiagents/storage/backends.pymaps them by string topraisonai.storage. Do not treat them as dead.praisonai/persistence/factory and state adapters — config-gated, lazily imported.- All back-compat shims (
bots,gateway,deploy,cli/*) and theintegration/(UI host bootstrap + bridges) vsintegrations/(managed-agent/CLI backends) split — distinct concerns, both canonical.
- 主要言語
- Python
- スター
- 9.3k
- フォーク
- 1.5k
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 520
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MervinPraison/PraisonAI のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
MervinPraison/PraisonAI#6710 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
claude
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
MervinPraison/PraisonAI#6707 ·
メンテナーはふだん 1 日以内に返信
-
bug claude
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
MervinPraison/PraisonAI#6671 ·
メンテナーはふだん 1 日以内に返信
-
Compaction budget regression fixture remains below budget with accurate tokenization再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
MervinPraison/PraisonAI#5418 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
bug claude documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
MervinPraison/PraisonAI#5341 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
MervinPraison/PraisonAI の issue をすべて見る
似ている issue
-
cognition
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
collabnix/awesome-mcp-lists#433 ·
メンテナーはふだん 4 日以内に返信
-
CrossEntropyFilter raises on zero probabilities and single-class results対応中かも @NopeCharon が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
datajoint/datajoint-python#1703 ·
メンテナーはふだん 6 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Archmonger/ServeStatic#129 ·