Skip to content

Commit c5440c4

Browse files
committed
fix: pass by environ to opencode
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent be1f726 commit c5440c4

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

opencode/session.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ func (sm *SessionManager) CreateSession(message, title, sessionID string, files
9797
processmanager.WithArgs(args...),
9898
processmanager.WithStateDir(sessionDir),
9999
processmanager.WithWorkDir(sessionDir),
100+
processmanager.WithEnvironment(os.Environ()...),
100101
)
101102

102103
session := &Session{
@@ -122,17 +123,6 @@ func (sm *SessionManager) runSession(session *Session) {
122123
session.StartedAt = time.Now()
123124
session.Status = "running"
124125

125-
// Set up environment variables for opencode
126-
env := os.Environ()
127-
128-
// Add config from environment if provided
129-
if configContent := os.Getenv("OPENCODE_CONFIG_CONTENT"); configContent != "" {
130-
env = append(env, fmt.Sprintf("OPENCODE_CONFIG_CONTENT=%s", configContent))
131-
}
132-
if configPath := os.Getenv("OPENCODE_CONFIG"); configPath != "" {
133-
env = append(env, fmt.Sprintf("OPENCODE_CONFIG=%s", configPath))
134-
}
135-
136126
// Run the process
137127
err := session.Process.Run()
138128
if err != nil {

0 commit comments

Comments
 (0)