fix(opencode): guard string-valued permission config (#781)

This commit is contained in:
Nic Barrett
2026-04-01 17:02:33 -05:00
parent 78e5c6d973
commit b12d684940
2 changed files with 80 additions and 1 deletions

View File

@@ -3985,8 +3985,14 @@ function configureOpencodePermissions(isGlobal = true) {
}
}
// OpenCode also allows a top-level string permission like "allow".
// In that case, path-specific permission entries are unnecessary.
if (typeof config.permission === 'string') {
return;
}
// Ensure permission structure exists
if (!config.permission) {
if (!config.permission || typeof config.permission !== 'object') {
config.permission = {};
}
@@ -5207,6 +5213,7 @@ if (process.env.GSD_TEST_MODE) {
validateHookFields,
installSdk,
promptSdk,
configureOpencodePermissions,
};
} else {