WeKnora/internal/application/service
ochan.kwon c15c3e972f fix(retriever): rebuild a missing vector store engine on demand
The engine registry is per-process, so a store's engine is missing
whenever this process did not create it. That happens three ways:

  - Startup skips a store whose engine fails to construct and never
    retries it, so that instance cannot serve the store again -- not
    even after a restart, if the backend is slow to come up.
  - A store registered on one instance is absent on every other until
    they restart, because registration is not broadcast.
  - Registration can fail on the instance handling the create, leaving
    the store missing even there.

Each one surfaces as "vector store is currently unavailable" and is
cleared today only by restarting the process.

Add GetOrLoadByStoreID, which falls back to building the engine from the
store row when the lookup misses, and route the two bound-store lookups
through it. The method goes on RetrieveEngineRegistry rather than
StoreRegistry because that is the interface the factory functions
receive; the two declare GetByStoreID separately and neither embeds the
other.

Concurrent callers collapse onto one build. That build runs on a context
detached from the caller that started it: callers share the result, so
letting the first one's cancellation abort it would fail everyone else
waiting. A panic inside the build is contained, because singleflight
re-raises it on a goroutine the HTTP recovery middleware cannot reach
and the build calls third-party client constructors.

Publishing is guarded by a per-store generation sampled before the
build, so an engine that finishes after the entry was registered or
removed by someone else does not overwrite it and leave that engine
orphaned with its connections open. A failed build starts a cooldown:
collapsing only helps concurrent callers, so without it a backend that
stays down would cost a full build timeout on every sequential request.

Separate "the store is gone" from "its engine cannot be built right
now". Async delete handlers answer ErrVectorStoreNotFound with
asynq.SkipRetry, so reporting a database blip or a backend outage that
way would permanently discard knowledge-base and index delete tasks and
orphan the vector data they exist to remove. ErrVectorStoreUnavailable
covers the retryable cases; the repository already distinguishes them,
returning (nil, nil) for a missing row and an error for a failure.

For the same reason a caller's own cancellation is never folded into a
store sentinel. The ownership check runs first and queries the database
with that context, so on a shutdown it is usually where cancellation is
noticed.

A search resolves one engine per distinct store, sequentially, and this
server sets no HTTP read or write timeout, so the resolution loop gets a
budget above a single build. An exhausted budget still leaves the
engines warming, since the build is detached, and is reported as an
unavailable store because retrying is likely to succeed.

Build failures are logged where they happen, with the panic stack. The
cause cannot travel back to the caller -- factory errors embed endpoints
and credentials -- so without this the one thing an operator needs when
self-healing fails to heal would be discarded with the error.

Note a deliberate contract change: an ownership lookup failure used to
be reported as not-found, and a test asserted that on purpose. A
database failure says nothing about whether the store exists, and
treating it as permanent is what discards the task, so that assertion is
inverted rather than preserved.
2026-07-29 12:25:18 +08:00
..
chat_pipeline fix(chat): prevent duplicate terminal answer events 2026-07-28 21:33:33 +08:00
file feat(resource): add stable resource registry with LLM-context alias compaction 2026-07-15 17:02:43 +08:00
metric fix: resolve failing test and build errors 2026-04-22 21:17:29 +08:00
retriever fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
agent_history.go feat(llm): introduce request-local source reference aliases 2026-07-17 10:19:43 +08:00
agent_history_test.go feat(llm): introduce request-local source reference aliases 2026-07-17 10:19:43 +08:00
agent_rerank_requirement_test.go feat(agent): enforce model readiness and polish selector UX 2026-06-25 23:33:39 +08:00
agent_service.go fix(agent): harden search-target scope and model-handle policies 2026-07-27 11:05:43 +08:00
agent_service_scope_test.go feat(chat): add @Skill/@MCP mentions with scoped agent runtime 2026-06-29 18:09:44 +08:00
agent_service_test.go fix(agent): exclude processing docs from prompt 2026-05-18 16:49:14 +08:00
agent_share.go fix(security): harden agent share listing and align full-access API key routes 2026-07-13 17:09:58 +08:00
audit_log.go fix(audit_log): prevent deadlock in Stop() when Start() is never called 2026-05-18 17:28:58 +08:00
audit_log_retention.go fix(audit_log): prevent deadlock in Stop() when Start() is never called 2026-05-18 17:28:58 +08:00
audit_log_retention_test.go fix(audit_log): prevent deadlock in Stop() when Start() is never called 2026-05-18 17:28:58 +08:00
audit_log_test.go feat(rbac): per-tenant audit log for RBAC events (PR 6, #1303) 2026-05-18 17:28:58 +08:00
chunk.go fix(knowledge): harden summary refresh after review feedback 2026-07-28 20:23:48 +08:00
chunk_edit_parent_test.go fix(chunks): retain questions across content edits 2026-07-28 20:23:48 +08:00
custom_agent.go fix(chunks): retain questions across content edits 2026-07-28 20:23:48 +08:00
custom_agent_api_key_scope_test.go feat(agent): enhance suggested questions API with tag scopes 2026-07-17 10:19:43 +08:00
custom_agent_suggestion_limit_test.go fix(agent): honor suggested-questions limit parameter 2026-07-24 10:46:53 +08:00
custom_agent_suggestion_scope_test.go feat(agent): enhance suggested questions API with tag scopes 2026-07-17 10:19:43 +08:00
dataset.go init commit 2025-08-05 15:08:07 +08:00
datasource_result_cap_test.go fix(feishu): resilient large-wiki sync — retry, streaming resume, failure visibility 2026-07-21 16:14:22 +08:00
datasource_service.go fix(knowledge): harden file-type scoped duplicate detection 2026-07-29 10:36:17 +08:00
datasource_service_test.go fix(feishu): resilient large-wiki sync — retry, streaming resume, failure visibility 2026-07-21 16:14:22 +08:00
datasource_stream_test.go fix(feishu): resilient large-wiki sync — retry, streaming resume, failure visibility 2026-07-21 16:14:22 +08:00
datasource_sweep_wiring_test.go fix(knowledge): harden file-type scoped duplicate detection 2026-07-29 10:36:17 +08:00
embed_channel.go fix(agent): honor suggested-questions limit parameter 2026-07-24 10:46:53 +08:00
embed_channel_chunk_test.go feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
embed_channel_public_config_test.go refactor: remove Neo4j-based conversation memory feature 2026-07-18 23:41:48 +08:00
embed_channel_update_test.go refactor: remove Neo4j-based conversation memory feature 2026-07-18 23:41:48 +08:00
embed_session.go feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
embed_session_test.go feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
embed_webhook.go fix(security): harden outbound requests and file previews 2026-07-02 19:15:46 +08:00
embed_webhook_test.go fix(security): harden outbound requests and file previews 2026-07-02 19:15:46 +08:00
evaluation.go feat(knowledge): add channel support to knowledge entries and related components 2026-03-25 22:08:29 +08:00
extract.go feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
fallback_messages_test.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
faq_clone_sync.go feat(knowledge): enhance FAQ export functionality 2026-07-23 10:50:32 +08:00
graph.go fix(knowledge): stitch chunks by text overlap, not by position 2026-05-30 17:53:47 +08:00
image_multimodal.go feat(resource): add stable resource registry with LLM-context alias compaction 2026-07-15 17:02:43 +08:00
image_multimodal_orphan_test.go feat(tests): enhance image multimodal service tests and runtime task handling 2026-07-14 15:38:06 +08:00
image_multimodal_prompt_test.go Add instruction fields to knowledge base configuration 2026-07-13 12:16:19 +08:00
kb_activity.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
kb_activity_test.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
kbshare.go feat(knowledge): add scoped activity audit trail 2026-07-23 10:50:32 +08:00
knowledge.go fix(knowledge): enqueue stale summary refreshes 2026-07-28 20:23:48 +08:00
knowledge_clone_image_test.go fix(knowledge): copy embedded chunk images into exports namespace 2026-07-22 15:27:11 +08:00
knowledge_clone_move.go fix(knowledge): reconcile wiki state when moving documents across KBs 2026-07-27 15:02:02 +08:00
knowledge_create.go fix(storage): allow image uploads to use file service fallback 2026-07-29 11:36:24 +08:00
knowledge_create_test.go fix(storage): allow image uploads to use file service fallback 2026-07-29 11:36:24 +08:00
knowledge_delete.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
knowledge_delete_test.go fix(knowledge): clean bound vector stores in batch delete 2026-07-27 11:32:30 +08:00
knowledge_faq.go feat(knowledge): enhance FAQ entry filtering and tagging 2026-07-23 10:50:32 +08:00
knowledge_faq_import.go feat(knowledge): enhance FAQ export functionality 2026-07-23 10:50:32 +08:00
knowledge_housekeeping.go fix(knowledge): recover tasks safely after server restart 2026-07-14 17:55:26 +08:00
knowledge_housekeeping_test.go fix(knowledge): recover tasks safely after server restart 2026-07-14 17:55:26 +08:00
knowledge_image_cleanup_test.go fix(knowledge): delete extracted images from storage when knowledge is removed 2026-04-02 12:04:04 +08:00
knowledge_index_content.go refactor(knowledge): keep metadata document scoped 2026-07-28 20:23:48 +08:00
knowledge_index_content_test.go fix(knowledge): enqueue stale summary refreshes 2026-07-28 20:23:48 +08:00
knowledge_manual_test.go fix: sanitize tab chars and avoid double .md extension in manual download filename 2026-03-16 18:18:23 +08:00
knowledge_move_gate_test.go fix: reject cross-store reuse_vectors knowledge move 2026-06-05 15:00:41 +08:00
knowledge_move_wiki_test.go fix(knowledge): reconcile wiki state when moving documents across KBs 2026-07-27 15:02:02 +08:00
knowledge_owner_chain_test.go feat(rbac): per-KB ownership for knowledge / chunks / wiki pages (#1303) 2026-05-18 17:28:58 +08:00
knowledge_post_process.go fix(wiki): prevent finalizing stalls on enqueue failure 2026-07-28 20:54:48 +08:00
knowledge_post_process_trace_test.go fix: correct graph and multimodal processing traces 2026-07-22 17:38:28 +08:00
knowledge_post_process_wiki_enqueue_test.go fix(wiki): prevent finalizing stalls on enqueue failure 2026-07-28 20:54:48 +08:00
knowledge_process.go fix(docreader): restore optional XLSX header context 2026-07-28 22:00:36 +08:00
knowledge_process_config.go fix(storage): allow image uploads to use file service fallback 2026-07-29 11:36:24 +08:00
knowledge_process_config_test.go fix(storage): allow image uploads to use file service fallback 2026-07-29 11:36:24 +08:00
knowledge_process_status_test.go fix(knowledge): unstick summary and isolate manual re-index trace attempts 2026-05-29 17:52:01 +08:00
knowledge_reparse_test.go fix(knowledge): clear stale errors on reparse 2026-07-28 20:44:34 +08:00
knowledge_shared_access_test.go feat(rbac): lift org membership from per-user to per-tenant (Plan 3, #1303) 2026-05-18 17:28:58 +08:00
knowledge_span_tracker.go fix: correct graph and multimodal processing traces 2026-07-22 17:38:28 +08:00
knowledge_span_tracker_test.go fix(knowledge): enqueue stale summary refreshes 2026-07-28 20:23:48 +08:00
knowledge_storage_config_test.go fix(storage): merge tos/s3/oss/ks3 tenant configs in buildStorageConfig (#1117) 2026-05-06 17:09:42 +08:00
knowledge_summary_refresh.go fix(knowledge): harden summary refresh after review feedback 2026-07-28 20:23:48 +08:00
knowledge_summary_refresh_test.go fix(knowledge): harden summary refresh after review feedback 2026-07-28 20:23:48 +08:00
knowledge_summary_sort_test.go fix(knowledge): harden summary refresh after review feedback 2026-07-28 20:23:48 +08:00
knowledge_summary_stale_test.go fix(knowledge): harden summary refresh after review feedback 2026-07-28 20:23:48 +08:00
knowledge_summary_test.go test(ingest): cover insufficient-content gate; allow threshold override 2026-05-06 11:23:32 +08:00
knowledge_task_options.go feat(worker): replace aggregate asynq concurrency with per-pool governance 2026-07-13 15:51:06 +08:00
knowledge_task_options_test.go feat(worker): replace aggregate asynq concurrency with per-pool governance 2026-07-13 15:51:06 +08:00
knowledge_util.go 修复共享知识库文档预览路径 2026-07-23 10:43:31 +08:00
knowledge_util_ssrf_test.go fix(security): block SSRF via redirects in knowledge URL import 2026-07-02 12:27:48 +08:00
knowledgebase.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
knowledgebase_delete_datasource_test.go fix(knowledgebase): delete data sources when knowledge base is removed 2026-06-23 17:30:38 +08:00
knowledgebase_pr3_test.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
knowledgebase_search.go feat(agent): enhance suggested questions API with tag scopes 2026-07-17 10:19:43 +08:00
knowledgebase_search_budget_test.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
knowledgebase_search_fanout.go feat(search): fan-out KB retrieval across bound vector stores 2026-05-20 22:25:39 +08:00
knowledgebase_search_fanout_test.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
knowledgebase_search_faq.go feat(search): fan-out KB retrieval across bound vector stores 2026-05-20 22:25:39 +08:00
knowledgebase_search_fusion.go feat(retrieval): configurable RRF parameters per tenant 2026-05-06 17:17:07 +08:00
knowledgebase_search_results.go fix(chunks): retain questions across content edits 2026-07-28 20:23:48 +08:00
knowledgebase_search_results_edit_test.go fix(chunks): keep edited retrieval content consistent 2026-07-28 20:23:48 +08:00
knowledgebase_search_shared.go feat(rbac): lift org membership from per-user to per-tenant (Plan 3, #1303) 2026-05-18 17:28:58 +08:00
knowledgebase_search_storegroup.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
knowledgebase_task_cancel_test.go fix(tasks): dequeue work for deleted knowledge bases 2026-07-23 12:17:14 +08:00
mcp_service.go feat: scope API MCP OAuth by principal 2026-06-30 20:01:05 +08:00
mcp_service_test.go feat(mcp): add OAuth2 authorization for MCP services 2026-06-22 20:19:31 +08:00
mcp_tool_approval_service.go feat(agent): human-in-the-loop approval for MCP tool calls (#1173) 2026-05-10 22:57:12 +08:00
message.go feat(session): add admin API session bucket and stabilize sidebar filter 2026-07-20 19:31:02 +08:00
message_suggestion.go feat(agent): enhance suggested questions API with tag scopes 2026-07-17 10:19:43 +08:00
message_suggestion_test.go fix(agent): ground follow-up suggestions and preserve KB scope on click 2026-07-15 19:16:53 +08:00
metric_hook.go refactor: Clean up code by removing unnecessary blank lines and improving comments for better readability and maintainability 2025-11-28 16:10:37 +08:00
model.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
model_builtin_management_test.go feat(models): let system admins edit builtin model config 2026-07-14 15:56:02 +08:00
model_delete_test.go feat(models): let system admins edit builtin model config 2026-07-14 15:56:02 +08:00
ocr_sanitizer.go feat: use language-neutral English prompts for multilingual LLM responses 2026-03-06 21:08:12 +08:00
ocr_sanitizer_test.go feat: introduce WeKnora Lite edition with lightweight configuration and deployment 2026-03-02 21:21:49 +08:00
organization.go feat(organization): transition membership model to tenant-level and enhance invite functionality 2026-05-18 17:28:58 +08:00
resource.go fix: normalize API key expiry timestamps to UTC (#2137) 2026-07-22 17:09:55 +08:00
resource_test.go feat(resource): add stable resource registry with LLM-context alias compaction 2026-07-15 17:02:43 +08:00
session.go feat: 修复IM问答无法读取session的问题 2026-07-22 14:25:55 +08:00
session_agent_qa.go feat(agent): enhance suggested questions API with tag scopes 2026-07-17 10:19:43 +08:00
session_agent_qa_scope_test.go refactor(agent): fix grep scope loss and consolidate per-turn @mention scoping 2026-06-29 18:09:44 +08:00
session_knowledge_qa.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
session_knowledge_qa_test.go fix(chat): emit retrieval references when citation output is disabled 2026-07-17 11:38:35 +08:00
session_model_requirement_test.go fix(agent): address readiness review findings 2026-06-25 23:33:39 +08:00
session_qa_api_key_scope_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
session_qa_helpers.go feat(agent): add per-agent citation output toggle 2026-07-17 10:19:43 +08:00
session_tag_targets_test.go feat(agent): enhance suggested questions API with tag scopes 2026-07-17 10:19:43 +08:00
session_user_scope_test.go feat: 修复IM问答无法读取session的问题 2026-07-22 14:25:55 +08:00
skill_service.go feat: adapt preloaded skills to smart-reasoning agent 2026-02-04 20:08:49 +08:00
slug_fuzzy.go perf(wiki-ingest): scale to 4w-doc KBs + generic task queue / dead-letter 2026-05-10 00:01:06 +08:00
slug_fuzzy_test.go perf(wiki-ingest): scale to 4w-doc KBs + generic task queue / dead-letter 2026-05-10 00:01:06 +08:00
storagebackend.go feat(resource): add stable resource registry with LLM-context alias compaction 2026-07-15 17:02:43 +08:00
storagebackend_test.go feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
system_setting.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
system_setting_validation_test.go feat(worker): replace aggregate asynq concurrency with per-pool governance 2026-07-13 15:51:06 +08:00
tag.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
temporary_document.go feat(attachments): implement normalization and limits for temporary attachment IDs 2026-07-16 17:41:27 +08:00
temporary_document_test.go feat(chat): add session-scoped temporary attachments with async parsing 2026-07-16 17:41:27 +08:00
tenant.go feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
tenant_api_key.go fix: normalize API key expiry timestamps to UTC (#2137) 2026-07-22 17:09:55 +08:00
tenant_api_key_test.go fix: normalize API key expiry timestamps to UTC (#2137) 2026-07-22 17:09:55 +08:00
tenant_invitation.go fix: prevent API keys from assigning owner role 2026-07-23 16:04:42 +08:00
tenant_invitation_test.go fix: prevent API keys from assigning owner role 2026-07-23 16:04:42 +08:00
tenant_member.go fix: prevent API keys from assigning owner role 2026-07-23 16:04:42 +08:00
tenant_member_test.go fix: prevent API keys from assigning owner role 2026-07-23 16:04:42 +08:00
tenant_storagebackend_test.go feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
user.go refactor: remove Neo4j-based conversation memory feature 2026-07-18 23:41:48 +08:00
user_auth_token_test.go feat(system): add admin password reset with session revocation 2026-07-13 20:11:00 +08:00
user_jwt_test.go fix(security): block refresh tokens as bearer and sandbox MCP uploads 2026-07-02 17:08:17 +08:00
user_oidc_security_test.go fix(security): harden outbound requests and file previews 2026-07-02 19:15:46 +08:00
user_provisioning_test.go feat(auth): support tenantless provisioning and gated self-service workspace creation 2026-07-13 18:13:51 +08:00
user_resource_favorite.go feat(favorites): implement user favorites and recents functionality 2026-05-18 17:28:58 +08:00
vectorstore.go fix: validate vector store connection addresses against SSRF policy 2026-06-04 15:26:56 +08:00
vectorstore_healthcheck.go fix: validate vector store connection addresses against SSRF policy 2026-06-04 15:26:56 +08:00
vectorstore_opensearch_test.go feat(retriever): activate OpenSearch k-NN driver (PR 3 of 3) 2026-05-29 16:32:27 +08:00
vectorstore_ssrf_test.go fix: validate vector store connection addresses against SSRF policy 2026-06-04 15:26:56 +08:00
vectorstore_test.go feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
web_search.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
web_search_provider.go feat(web-search): add Zhipu AI web search provider support 2026-07-20 12:15:35 +08:00
web_search_provider_test.go feat(web-search): add Zhipu AI web search provider support 2026-07-20 12:15:35 +08:00
web_search_state.go fix: update environment configuration for debugging and logging, enhance SQLite FTS5 table management, and improve API base URL handling 2026-04-11 18:51:16 +08:00
weknoracloud.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
wiki_deleted_kb_guard_test.go fix(tasks): dequeue work for deleted knowledge bases 2026-07-23 12:17:14 +08:00
wiki_folder_prune_finalize_test.go feat(wiki): prune empty folders after document retract 2026-07-22 19:27:22 +08:00
wiki_ingest.go fix(wiki): prevent finalizing stalls on enqueue failure 2026-07-28 20:54:48 +08:00
wiki_ingest_batch.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
wiki_ingest_cite.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
wiki_ingest_cite_test.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
wiki_ingest_dedup.go fix(wiki): harden slug integrity across ingest and agent write paths 2026-07-24 15:57:08 +08:00
wiki_ingest_dedup_test.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
wiki_ingest_retry_test.go perf(wiki): move ingest log to event table and index to on-demand API 2026-05-08 21:48:52 +08:00
wiki_ingest_taxonomy.go feat(wiki): implement folder management features in wiki API 2026-06-16 23:51:29 +08:00
wiki_ingest_taxonomy_test.go feat(i18n): add optional embedding model descriptions for multiple locales 2026-06-16 23:51:29 +08:00
wiki_ingest_test.go feat(llm): add prompt-cache observability and wiki cache-friendly prompts 2026-07-23 19:17:30 +08:00
wiki_linkify.go feat: Refactor cross-link injection logic for wiki pages 2026-04-22 21:18:09 +08:00
wiki_linkify_test.go feat: Refactor cross-link injection logic for wiki pages 2026-04-22 21:18:09 +08:00
wiki_lint.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
wiki_page.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
wiki_page_revision_test.go feat(wiki): add page revision history with diff, revert, and manual editing 2026-07-27 15:03:24 +08:00
wiki_page_test.go feat(wiki): add page revision history with diff, revert, and manual editing 2026-07-27 15:03:24 +08:00
wiki_slug_handles.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
wiki_slug_handles_test.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00