aKode fase 2b-2: rimosso login ChatGPT e tutti i sottosistemi solo-ChatGPT
- Login: resta solo chiave API (+ header, Bedrock). Rimossi OAuth/browser, device code, refresh/revoke su auth.openai.com, PAT, agent/workload identity, runtime agent instance, backend-client e openapi-models, workspace routing. - Rimossi: generazione immagini (ext + skill imagegen), history notes, plugin remoti (catalogo, sync, share), cyber access program, daybreak, cloud config e requirements (config_server ora fail-closed), attestation, frozen cloud skills, EMA MCP auth, Codex Apps/connettori, ricerca ospitata, header/zstd/ routing/cookie del backend Codex, fallback OPENAI_API_KEY del realtime. - Messaggi d'errore senza link a chatgpt.com. - Chiavi di config legacy accettate e ignorate; feature rimosse = Stage::Removed. - Test: cancellati solo quelli del codice rimosso; test di sicurezza (sandbox estensioni, permessi, redazione, auth storage, requirements) adattati. Restano solo fallimenti d'ambiente (code-mode-host/V8, ~/.agents). - Istruzioni di sistema invariate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,8 +14,6 @@ pub enum SkillSourceKind {
|
||||
Host,
|
||||
/// Skills owned by an execution environment.
|
||||
Executor,
|
||||
/// Skills owned by the cloud rather than an execution environment.
|
||||
Cloud,
|
||||
/// Extension-private source kind for future providers that do not fit an
|
||||
/// existing transport category.
|
||||
Custom(String),
|
||||
@@ -30,7 +28,6 @@ impl SkillSourceKind {
|
||||
match self {
|
||||
Self::Host => "host",
|
||||
Self::Executor => "executor",
|
||||
Self::Cloud => "cloud",
|
||||
Self::Custom(kind) => kind,
|
||||
}
|
||||
}
|
||||
@@ -306,7 +303,7 @@ impl SkillCatalogEntry {
|
||||
|
||||
pub(crate) fn unaliased_locator(&self) -> &str {
|
||||
match &self.authority.kind {
|
||||
SkillSourceKind::Executor | SkillSourceKind::Cloud => self.id.0.as_str(),
|
||||
SkillSourceKind::Executor => self.id.0.as_str(),
|
||||
SkillSourceKind::Host | SkillSourceKind::Custom(_) => self.rendered_path(),
|
||||
}
|
||||
}
|
||||
@@ -374,40 +371,27 @@ impl SkillCatalog {
|
||||
}
|
||||
}
|
||||
|
||||
/// Applies plugin denials and requires accepted Cloud or executor roots before merging skills.
|
||||
/// Applies plugin denials and requires accepted executor roots before merging skills.
|
||||
pub(crate) fn apply_plugin_denials(catalog: &mut SkillCatalog, snapshot: &SelectedPluginSnapshot) {
|
||||
for skill in &mut catalog.entries {
|
||||
if !matches!(
|
||||
skill.authority.kind,
|
||||
SkillSourceKind::Cloud | SkillSourceKind::Executor
|
||||
) {
|
||||
if skill.authority.kind != SkillSourceKind::Executor {
|
||||
continue;
|
||||
}
|
||||
// Standalone skills do not require plugin acceptance.
|
||||
if skill.remote_plugin_id.is_none() && skill.plugin_id.is_none() {
|
||||
continue;
|
||||
}
|
||||
let accepted = if skill.authority.kind == SkillSourceKind::Executor {
|
||||
let (Some(environment_id), Some(plugin_id)) =
|
||||
(skill.main_prompt.environment_id(), &skill.plugin_id)
|
||||
else {
|
||||
skill.enabled = false;
|
||||
continue;
|
||||
};
|
||||
let root_id = format!("{environment_id}:{plugin_id}");
|
||||
snapshot
|
||||
.plugins
|
||||
.iter()
|
||||
.any(|plugin| plugin.selected_root_id.as_deref() == Some(root_id.as_str()))
|
||||
} else {
|
||||
let Some(remote_plugin_id) = &skill.remote_plugin_id else {
|
||||
skill.enabled = false;
|
||||
continue;
|
||||
};
|
||||
snapshot.plugins.iter().any(|plugin| {
|
||||
plugin.selected_root_id.is_none() && plugin.plugin_id.as_str() == remote_plugin_id
|
||||
})
|
||||
let (Some(environment_id), Some(plugin_id)) =
|
||||
(skill.main_prompt.environment_id(), &skill.plugin_id)
|
||||
else {
|
||||
skill.enabled = false;
|
||||
continue;
|
||||
};
|
||||
let root_id = format!("{environment_id}:{plugin_id}");
|
||||
let accepted = snapshot
|
||||
.plugins
|
||||
.iter()
|
||||
.any(|plugin| plugin.selected_root_id.as_deref() == Some(root_id.as_str()));
|
||||
skill.enabled &= skill
|
||||
.remote_plugin_id
|
||||
.as_ref()
|
||||
@@ -420,54 +404,6 @@ pub(crate) fn apply_plugin_denials(catalog: &mut SkillCatalog, snapshot: &Select
|
||||
}
|
||||
}
|
||||
|
||||
fn remote_key(entry: &SkillCatalogEntry) -> Option<(&str, &str)> {
|
||||
Some((entry.remote_plugin_id.as_deref()?, entry.name.as_str()))
|
||||
}
|
||||
|
||||
/// Merges available Cloud counterparts, disabling unmatched remote skills only when Cloud is complete.
|
||||
pub fn merge_catalogs(cloud: Option<SkillCatalog>, executor: SkillCatalog) -> SkillCatalog {
|
||||
let Some(mut merged) = cloud else {
|
||||
return executor;
|
||||
};
|
||||
let cloud_is_partial = merged.is_partial;
|
||||
merged.is_partial |= executor.is_partial;
|
||||
let cloud_entry_count = merged.entries.len();
|
||||
merged.warnings.extend(executor.warnings);
|
||||
for mut entry in executor.entries {
|
||||
let Some(key) = remote_key(&entry) else {
|
||||
merged.entries.push(entry);
|
||||
continue;
|
||||
};
|
||||
// Executor entries cannot authorize or merge with one another.
|
||||
let Some(cloud_entry) = merged.entries[..cloud_entry_count]
|
||||
.iter_mut()
|
||||
.find(|cloud_entry| remote_key(cloud_entry) == Some(key))
|
||||
else {
|
||||
if !cloud_is_partial {
|
||||
entry.enabled = false;
|
||||
for source in &mut entry.sources {
|
||||
source.enabled = false;
|
||||
}
|
||||
}
|
||||
merged.entries.push(entry);
|
||||
continue;
|
||||
};
|
||||
let primary_source = entry.primary_source();
|
||||
for mut source in std::iter::once(primary_source).chain(entry.sources) {
|
||||
source.enabled &= cloud_entry.enabled;
|
||||
let already_present = cloud_entry.sources.iter().any(|existing| {
|
||||
existing.authority == source.authority
|
||||
&& existing.package == source.package
|
||||
&& existing.main_prompt.environment_id() == source.main_prompt.environment_id()
|
||||
});
|
||||
if !already_present {
|
||||
cloud_entry.sources.push(source);
|
||||
}
|
||||
}
|
||||
}
|
||||
merged
|
||||
}
|
||||
|
||||
/// Contents returned after resolving a skill resource through its owner.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct SkillReadResult {
|
||||
@@ -511,7 +447,3 @@ impl std::fmt::Display for SkillProviderError {
|
||||
impl std::error::Error for SkillProviderError {}
|
||||
|
||||
pub type SkillProviderResult<T> = Result<T, SkillProviderError>;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "catalog_tests.rs"]
|
||||
mod tests;
|
||||
|
||||
Reference in New Issue
Block a user