Loading
Fix: _get_tdoc now correctly retrieves TDocs from database
Fixed bug in TDocDatabase._get_tdoc that caused TDocs to not be
found in the local database, leading to unnecessary external API calls
to whatthespec.net.
Issue:
- _get_tdoc used self.connection.model_from_table("tdocs", tdoc_id.upper())
- This method was throwing KeyError, causing all lookups to fail
- As a result, checkout_tdoc_to_workspace fell back to whatthespec.net
even for TDocs that existed in the local database
Fix:
- Changed _get_tdoc to use direct SQL query instead of model_from_table
- Query retrieves all required fields from actual database schema
- Returns properly constructed TDocMetadata object
Impact:
- TDocs with URLs in database are now correctly found
- whatthespec.net is only contacted for TDocs NOT in database
- Commands like `ai workspace add-members` work efficiently
Tested with:
- S4AQ200164: Now correctly retrieved from database with URL
- Non-existent TDocs: Return None as expected