feat: projects as backend sources with system prompt injection (#8739)

Signed-off-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Douwe Osinga
2026-05-07 10:30:15 -04:00
committed by GitHub
parent bced4ea5ec
commit ff42171903
29 changed files with 1241 additions and 919 deletions
+1 -1
View File
@@ -3150,7 +3150,7 @@ impl GooseAcpAgent {
})
}
async fn update_thread_metadata(
pub(super) async fn update_thread_metadata(
&self,
thread_id: &str,
f: impl FnOnce(&mut crate::session::ThreadMetadata),
+20 -2
View File
@@ -5,13 +5,26 @@ impl GooseAcpAgent {
&self,
req: CreateSourceRequest,
) -> Result<CreateSourceResponse, agent_client_protocol::Error> {
let project_dir = match (&req.project_id, &req.project_dir) {
(Some(pid), _) if !req.global => {
let dirs = crate::sources::project_working_dirs(pid);
Some(dirs.into_iter().next().ok_or_else(|| {
agent_client_protocol::Error::invalid_params().data(format!(
"Project \"{pid}\" has no working directories configured"
))
})?)
}
(_, Some(pd)) => Some(pd.clone()),
_ => None,
};
let source = crate::sources::create_source(
req.source_type,
&req.name,
&req.description,
&req.content,
req.global,
req.project_dir.as_deref(),
project_dir.as_deref(),
req.properties,
)?;
Ok(CreateSourceResponse { source })
}
@@ -20,7 +33,11 @@ impl GooseAcpAgent {
&self,
req: ListSourcesRequest,
) -> Result<ListSourcesResponse, agent_client_protocol::Error> {
let sources = crate::sources::list_sources(req.source_type, req.project_dir.as_deref())?;
let sources = crate::sources::list_sources(
req.source_type,
req.project_dir.as_deref(),
req.include_project_sources,
)?;
Ok(ListSourcesResponse { sources })
}
@@ -34,6 +51,7 @@ impl GooseAcpAgent {
&req.name,
&req.description,
&req.content,
req.properties,
)?;
Ok(UpdateSourceResponse { source })
}