Skip to content

fix(ci): Python SDK CI failures — missing dotenv dep + sqlite3.Row AttributeError#8

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/fix-ci-issues
Closed

fix(ci): Python SDK CI failures — missing dotenv dep + sqlite3.Row AttributeError#8
Copilot wants to merge 2 commits intomainfrom
copilot/fix-ci-issues

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 25, 2026

📋 Description

Python SDK CI job was failing at import time due to a missing python-dotenv dependency, and after unblocking that, all three omnibus tests failed with AttributeError: 'sqlite3.Row' object has no attribute 'get' in hsg.py.

Three fixes:

  • pyproject.toml — added python-dotenv>=1.0 to dependencies. config.py calls from dotenv import load_dotenv at module level but the package was never declared.

  • connectors/langchain.pyexcept ImportError stub only defined BaseChatMessageHistory and BaseRetriever; left BaseMessage, HumanMessage, AIMessage, Document, and CallbackManagerForRetrieverRun undefined. Any import of the module without langchain_core installed raised NameError at class definition time.

    # Before
    except ImportError:
        BaseChatMessageHistory = object
        BaseRetriever = object
    
    # After
    except ImportError:
        BaseChatMessageHistory = object
        BaseRetriever = object
        BaseMessage = object
        HumanMessage = object
        AIMessage = object
        Document = object
        CallbackManagerForRetrieverRun = object
  • memory/hsg.pycompute_tag_match_score — function typed its mem param as dict but receives sqlite3.Row, which has no .get(). Replaced with direct bracket access guarded by try/except (KeyError, IndexError).

    # Before
    def compute_tag_match_score(mem: dict, q_toks: Set[str]) -> float:
        if not mem or not mem.get("tags"): return 0.0
    
    # After
    def compute_tag_match_score(mem, q_toks: Set[str]) -> float:
        if not mem: return 0.0
        try:
            tags_val = mem["tags"]
        except (KeyError, IndexError):
            return 0.0
        if not tags_val: return 0.0

🔄 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Style/UI changes
  • ♻️ Code refactoring
  • ⚡ Performance improvements
  • 🧪 Test updates
  • 🔧 Build/CI changes

🧪 Testing

  • I have tested this change locally
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

All 3 Python omnibus tests (test_evolutionary_stability, test_boolean_metadata_logic, test_content_robustness) pass. Node.js SDK job was already green and is unaffected.

📱 Screenshots (if applicable)

N/A

🔍 Code Review Checklist

  • Code follows the project's coding standards
  • Self-review of the code has been performed
  • Code is properly commented, particularly in hard-to-understand areas
  • Changes generate no new warnings
  • Any dependent changes have been merged and published

📚 Related Issues

🚀 Deployment Notes

No deployment changes required.

📋 Additional Context

The sqlite3.Row bug would also silently swallow tag-match scoring in production (all tag scores returning 0.0) for any query path that reached compute_tag_match_score, so this fix has correctness impact beyond CI.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…hsg.py

Co-authored-by: russellbrenner <5236354+russellbrenner@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI issues causing job failures fix(ci): Python SDK CI failures — missing dotenv dep + sqlite3.Row AttributeError Feb 25, 2026
Copilot AI requested a review from russellbrenner February 25, 2026 05:48
russellbrenner pushed a commit that referenced this pull request Feb 26, 2026
Upstream changes (9 commits, 6 unique):
- Add Siray embedding provider (JS + Python SDKs)
- Improve Docker reliability (bookworm-slim base, inline Node healthcheck)
- Add dashboard service profile gating (docker compose --profile ui)
- Fix SQLite path in .env.example for Docker volume alignment
- Add Doppler compose wrapper and dashboard build-time env vars
- Fix dashboard to load memories without requiring NEXT_PUBLIC_API_KEY

Fork PR integration (#8, #9):
- Add python-dotenv to Python SDK dependencies
- Fix sqlite3.Row compat in Python hsg.py compute_tag_match_score
- Add langchain connector fallback imports for missing deps
- Switch dashboard fonts from Google Fonts to local geist package

All omnibus tests pass (TS 3/3, Python 3/3). Dashboard builds clean.

https://claude.ai/code/session_01AvLytv3nsAZWqiDqxEKBfh
@russellbrenner russellbrenner deleted the copilot/fix-ci-issues branch March 6, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants