Make it startable from playwright and also isolate (#5016)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-10-06 20:59:26 -04:00
committed by GitHub
parent 1690cf9091
commit d3a222ddbf
22 changed files with 150 additions and 144 deletions
@@ -5,9 +5,8 @@ use axum::{
routing::{delete, get, post},
Json, Router,
};
use etcetera::{choose_app_strategy, AppStrategy};
use goose::config::paths::Paths;
use goose::config::ExtensionEntry;
use goose::config::APP_STRATEGY;
use goose::config::{Config, ConfigError};
use goose::model::ModelConfig;
use goose::providers::base::ProviderMetadata;
@@ -565,11 +564,7 @@ pub async fn upsert_permissions(
)
)]
pub async fn backup_config() -> Result<Json<String>, StatusCode> {
let config_dir = choose_app_strategy(APP_STRATEGY.clone())
.expect("goose requires a home dir")
.config_dir();
let config_path = config_dir.join("config.yaml");
let config_path = Paths::config_dir().join("config.yaml");
if config_path.exists() {
let file_name = config_path
@@ -630,11 +625,7 @@ pub async fn recover_config() -> Result<Json<String>, StatusCode> {
)
)]
pub async fn validate_config() -> Result<Json<String>, StatusCode> {
let config_dir = choose_app_strategy(APP_STRATEGY.clone())
.expect("goose requires a home dir")
.config_dir();
let config_path = config_dir.join("config.yaml");
let config_path = Paths::config_dir().join("config.yaml");
if !config_path.exists() {
return Ok(Json("Config file does not exist".to_string()));