refactor(plugin): remove metadata assertions
Guard optional plugin metadata and pane identifiers before passing them to cleanup and warning paths. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -103,8 +103,11 @@ export async function deleteTeam(
|
||||
const removedLayout = config.tmux_visualization && tmuxMgr !== undefined && deps.canVisualize()
|
||||
if (removedLayout) {
|
||||
const memberPaneIds = runtimeState.members
|
||||
.filter((member) => member.agentType !== "leader" && member.tmuxPaneId)
|
||||
.map((member) => member.tmuxPaneId!)
|
||||
.flatMap((member) => (
|
||||
member.agentType !== "leader" && member.tmuxPaneId
|
||||
? [member.tmuxPaneId]
|
||||
: []
|
||||
))
|
||||
|
||||
const cleanupTarget = runtimeState.tmuxLayout
|
||||
? {
|
||||
|
||||
@@ -43,8 +43,8 @@ export async function applyCommandConfig(params: {
|
||||
const includeClaudeSkills = params.pluginConfig.claude_code?.skills ?? true;
|
||||
|
||||
const externalSkillPlugin = detectExternalSkillPlugin(params.ctx.directory);
|
||||
if (includeClaudeSkills && externalSkillPlugin.detected) {
|
||||
log(getSkillPluginConflictWarning(externalSkillPlugin.pluginName!));
|
||||
if (includeClaudeSkills && externalSkillPlugin.detected && externalSkillPlugin.pluginName) {
|
||||
log(getSkillPluginConflictWarning(externalSkillPlugin.pluginName));
|
||||
}
|
||||
|
||||
const [
|
||||
|
||||
@@ -101,8 +101,8 @@ export function createSessionHooks(args: {
|
||||
if (isHookEnabled("session-notification")) {
|
||||
const forceEnable = pluginConfig.notification?.force_enable ?? false
|
||||
const externalNotifier = detectExternalNotificationPlugin(ctx.directory)
|
||||
if (externalNotifier.detected && !forceEnable) {
|
||||
log(getNotificationConflictWarning(externalNotifier.pluginName!))
|
||||
if (externalNotifier.detected && externalNotifier.pluginName && !forceEnable) {
|
||||
log(getNotificationConflictWarning(externalNotifier.pluginName))
|
||||
} else {
|
||||
sessionNotification = safeHook("session-notification", () => createSessionNotification(ctx))
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export function logLegacyPluginStartupWarning(deps: LogLegacyPluginStartupWarnin
|
||||
const migrateLegacyPluginEntryFn = deps.migrateLegacyPluginEntry ?? migrateLegacyPluginEntry
|
||||
|
||||
const result = checkForLegacyPluginEntryFn()
|
||||
if (!result.hasLegacyEntry) {
|
||||
if (!result.hasLegacyEntry || !result.configPath) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export function logLegacyPluginStartupWarning(deps: LogLegacyPluginStartupWarnin
|
||||
+ ` Attempting auto-migration...`,
|
||||
)
|
||||
|
||||
const migrated = migrateLegacyPluginEntryFn(result.configPath!)
|
||||
const migrated = migrateLegacyPluginEntryFn(result.configPath)
|
||||
if (migrated) {
|
||||
console.warn(`[oh-my-openagent] Auto-migrated opencode.json: ${result.legacyEntries.join(", ")} -> ${suggestedEntries.join(", ")}`)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user