Skip to content

Conversation

@MichaelAnders
Copy link
Contributor

Multiple fixes/enhancements

MichaelAnders and others added 5 commits January 23, 2026 10:34
Problem: Memory extraction was failing with:
  SqliteError: NOT NULL constraint failed: memory_entities.entity_type

Root cause: Function signature mismatch in extractor.js:105
- trackEntity() expects a single object parameter: { type, name, context }
- Code was passing positional arguments: trackEntity('code', entityName, {...})

Fix: Changed call to use correct object signature:
  store.trackEntity({
    type: 'code',
    name: entityName,
    context: { source: 'extraction' }
  });

Testing:
- Server starts without errors
- Test requests complete successfully
- No database constraint violations in logs

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…acters

Enhanced the prepareFTS5Query() function to sanitize all special characters
that could cause FTS5 syntax errors, including pipes (|), commas (,), and
other punctuation marks that appear in markdown tables and formatted text.

Changes:
- Expanded character removal regex to include: | , + = ? ! ; / \ @ # $ % ^ & { }
- Added additional safety check to remove any remaining non-alphanumeric characters
- Prevents "fts5: syntax error near ','" errors when searching with complex queries

The fix resolves FTS5 syntax errors that occurred when Claude CLI sent
messages containing markdown tables or other formatted text with special
characters.
Improves shutdown behavior to stop server within 2-3 seconds instead of 30+.

Changes:
- Make SIGINT/SIGTERM handlers async and await shutdown
- Add getShuttingDown() getter to health module
- Check shutdown flag at start of each agent loop iteration
- Return graceful 503 response when shutting down

This enables quick interruption of ongoing requests during server shutdown
without waiting for full request timeout.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ROVIDER is specified

Previously, setting MODEL_PROVIDER to an invalid value like "openaix" would
silently fall back to "databricks" and then throw a misleading Databricks
credential error. Users would see "Set DATABRICKS_API_BASE and DATABRICKS_API_KEY"
instead of being informed about the invalid provider value.

Changes:
- Add explicit validation for MODEL_PROVIDER before provider-specific checks
- Add explicit validation for FALLBACK_PROVIDER with same pattern
- Throw clear error listing all valid options when invalid provider specified
- Show original (case-preserved) value in error to help identify typos
- Add comprehensive test suite with 18 test cases covering all providers

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The error message format was improved in bf657d5 to be more user-friendly.
Updated test regex to match new format: 'Unsupported FALLBACK_PROVIDER.*Valid options are'

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vishalveerareddy123
Copy link
Collaborator

Thank you for the PR it helps us to fix a long standing issue with FTS5 bug.

@vishalveerareddy123 vishalveerareddy123 merged commit d7551d4 into Fast-Editor:main Jan 24, 2026
4 checks passed
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