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

+8 -5
View File
@@ -68,25 +68,28 @@ describe('interpolateEnvExpressions', () => {
it('replaces references and interpolates inside a larger string', () => {
expect(interpolateEnvExpressions('https://${{ vars.HOST }}/${{ secrets.TOKEN }}', lookup)).toEqual({
value: 'https://example.com/super-secret',
missing: [],
})
})
it('resolves a missing reference to an empty string and reports it', () => {
it('resolves a missing reference to an empty string', () => {
expect(interpolateEnvExpressions('x-${{ secrets.MISSING }}-y', lookup)).toEqual({
value: 'x--y',
missing: [{ context: 'secrets', name: 'MISSING' }],
})
})
it('leaves an unsupported expression untouched', () => {
expect(interpolateEnvExpressions('${{ github.sha }}', lookup)).toEqual({
value: '${{ github.sha }}',
missing: [],
})
})
it('leaves an expression with an invalid name untouched', () => {
expect(interpolateEnvExpressions('${{ secrets.1BAD }}', lookup)).toEqual({
value: '${{ secrets.1BAD }}',
})
})
it('leaves a literal value untouched', () => {
expect(interpolateEnvExpressions('literal', lookup)).toEqual({ value: 'literal', missing: [] })
expect(interpolateEnvExpressions('literal', lookup)).toEqual({ value: 'literal' })
})
})