working mode

This commit is contained in:
Harshavardhan Musanalli
2025-11-16 10:29:24 +01:00
parent c268a3a42e
commit d519bf77e9
14 changed files with 1070 additions and 830 deletions

View File

@@ -54,18 +54,13 @@ func NewLinuxDiagnosticAgent() *LinuxDiagnosticAgent {
supabaseURL := os.Getenv("SUPABASE_PROJECT_URL")
if supabaseURL == "" {
logging.Warning("SUPABASE_PROJECT_URL not set, TensorZero integration will not work")
supabaseURL = "https://gpqzsricripnvbrpsyws.supabase.co" // fallback
}
model := os.Getenv("NANNYAPI_MODEL")
if model == "" {
model = "tensorzero::function_name::diagnose_and_heal"
logging.Warning("Using default model '%s'. Set NANNYAPI_MODEL environment variable for your specific function", model)
}
// Default model for diagnostic and healing
model := "tensorzero::function_name::diagnose_and_heal"
// Note: We don't use the OpenAI client anymore, we use direct HTTP to Supabase proxy
agent := &LinuxDiagnosticAgent{
client: nil, // Not used anymore
client: nil, // Not used - we use direct HTTP to Supabase proxy
model: model,
executor: executor.NewCommandExecutor(10 * time.Second), // 10 second timeout for commands
config: DefaultAgentConfig(), // Default concurrent execution config
@@ -84,18 +79,13 @@ func NewLinuxDiagnosticAgentWithAuth(authManager interface{}) *LinuxDiagnosticAg
supabaseURL := os.Getenv("SUPABASE_PROJECT_URL")
if supabaseURL == "" {
logging.Warning("SUPABASE_PROJECT_URL not set, TensorZero integration will not work")
supabaseURL = "https://gpqzsricripnvbrpsyws.supabase.co" // fallback
}
model := os.Getenv("NANNYAPI_MODEL")
if model == "" {
model = "tensorzero::function_name::diagnose_and_heal"
logging.Warning("Using default model '%s'. Set NANNYAPI_MODEL environment variable for your specific function", model)
}
// Default model for diagnostic and healing
model := "tensorzero::function_name::diagnose_and_heal"
// Note: We don't use the OpenAI client anymore, we use direct HTTP to Supabase proxy
agent := &LinuxDiagnosticAgent{
client: nil, // Not used anymore
client: nil, // Not used - we use direct HTTP to Supabase proxy
model: model,
executor: executor.NewCommandExecutor(10 * time.Second), // 10 second timeout for commands
config: DefaultAgentConfig(), // Default concurrent execution config