fix(secrets): forward only planned variables into the sandbox and cache repo env resolution

The sandbox shim forwards only the plan's pinned names, so turning sandbox Git credentials off withholds tokens. Sandboxed shells resolve repo env once, terminals on linked servers get no local env, mapping keys cannot override git credentials, masks are kept per directory, and directory resolution is cached. A legacy gh-env alias keeps adopted OpenCode processes working for one release.
This commit is contained in:
Chris Scott committed 2026-10-23 23:47:44 -04:00
1 parent a0d1d91f18
commit 3e51280894
36 files changed
+1010 -259

No files matched your search

+3
View File
@@ -4,6 +4,7 @@ import { getReposPath } from '@opencode-manager/shared/config/env'
import { ASSISTANT_REPO_ID, ASSISTANT_REPO_PATH, getRepoDisplayName } from '@opencode-manager/shared/utils'
import { getErrorMessage } from '../utils/error-utils'
import { canonicalPathSync } from '../utils/fs-safe'
import { invalidateRepoEnvCache } from '../utils/repo-env-cache'
import path from 'path'
interface RepoRow {
@@ -185,6 +186,7 @@ export function ensureAssistantRepo(db: Database): Repo {
}
export function createRepo(db: Database, repo: CreateRepoInput): Repo {
invalidateRepoEnvCache()
const normalizedPath = repo.localPath.trim().replace(/\/+$/, '')
const existing = repo.isLocal
@@ -358,4 +360,5 @@ export function deleteRepo(db: Database, id: number): void {
db.prepare('DELETE FROM repos WHERE id = ?').run(id)
})
remove()
invalidateRepoEnvCache()
}