mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-30 15:03:57 +00:00
Improve inline autocomplete reliability, sanitization, and debug logging (#407)
* Enhance autocomplete functionality and logging. Increased debounce time for autocomplete suggestions and added minimum context character requirement. Improved inline suggestion handling with new cleanup logic for tab acceptance. Introduced a new logging option for autocomplete-only logs in CLI. Updated various components to support these changes, including sanitization and error handling in the autocomplete engine. * Add autocomplete CLI adapter for improved argument handling This commit introduces a new module, , which encapsulates the argument parsing and logging logic specific to the autocomplete namespace in the CLI. Key features include extraction of leading verbose flags, handling of the flag, and improved help message printing. The existing CLI command handling has been refactored to utilize this new adapter, enhancing code organization and maintainability. * Refactor inline completion sanitization and enhance context handling
This commit is contained in:
@@ -92,7 +92,7 @@ fn run_ingest(args: &[String]) -> Result<()> {
|
||||
anyhow::anyhow!("missing file argument. Use a file path or '-' for stdin.")
|
||||
})?;
|
||||
|
||||
crate::core::logging::init_for_cli_run(verbose);
|
||||
crate::core::logging::init_for_cli_run(verbose, crate::core::logging::CliLogDefault::Global);
|
||||
|
||||
let content = read_input(&file_path)?;
|
||||
let doc_key = key.unwrap_or_else(|| file_path.clone());
|
||||
@@ -194,7 +194,7 @@ fn run_docs(args: &[String]) -> Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
crate::core::logging::init_for_cli_run(verbose);
|
||||
crate::core::logging::init_for_cli_run(verbose, crate::core::logging::CliLogDefault::Global);
|
||||
|
||||
let rt = tokio::runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
@@ -245,7 +245,7 @@ fn run_graph_query(args: &[String]) -> Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
crate::core::logging::init_for_cli_run(verbose);
|
||||
crate::core::logging::init_for_cli_run(verbose, crate::core::logging::CliLogDefault::Global);
|
||||
|
||||
let rt = tokio::runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
@@ -307,7 +307,7 @@ fn run_query(args: &[String]) -> Result<()> {
|
||||
namespace.ok_or_else(|| anyhow::anyhow!("--namespace is required for query"))?;
|
||||
let query = query.ok_or_else(|| anyhow::anyhow!("--query is required"))?;
|
||||
|
||||
crate::core::logging::init_for_cli_run(verbose);
|
||||
crate::core::logging::init_for_cli_run(verbose, crate::core::logging::CliLogDefault::Global);
|
||||
|
||||
let rt = tokio::runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
@@ -339,7 +339,7 @@ fn run_namespaces(args: &[String]) -> Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
crate::core::logging::init_for_cli_run(verbose);
|
||||
crate::core::logging::init_for_cli_run(verbose, crate::core::logging::CliLogDefault::Global);
|
||||
|
||||
let rt = tokio::runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
@@ -382,7 +382,7 @@ fn run_clear(args: &[String]) -> Result<()> {
|
||||
let namespace =
|
||||
namespace.ok_or_else(|| anyhow::anyhow!("--namespace is required for clear"))?;
|
||||
|
||||
crate::core::logging::init_for_cli_run(verbose);
|
||||
crate::core::logging::init_for_cli_run(verbose, crate::core::logging::CliLogDefault::Global);
|
||||
|
||||
let rt = tokio::runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
|
||||
Reference in New Issue
Block a user