Skip to content

Reviewing repository for errors and issues#4

Merged
krutftw merged 1 commit into
mainfrom
copilot/check-repo-errors
May 30, 2026
Merged

Reviewing repository for errors and issues#4
krutftw merged 1 commit into
mainfrom
copilot/check-repo-errors

Conversation

Copilot AI commented May 30, 2026

Copy link
Copy Markdown
Contributor

Pull request created by AI Agent

…s env

- Add enablement parameter to GitHub Pages workflow to fix deploy failures
- Add try-catch around JSON.parse in ollamaClient, openAiCompatibleClient, and gammaClient to handle non-JSON responses gracefully
- Restrict environment variables passed to CLI subprocess (PATH, HOME, LANG, TERM only)
@krutftw krutftw marked this pull request as ready for review May 30, 2026 14:55
Copilot AI review requested due to automatic review settings May 30, 2026 14:55
@krutftw krutftw merged commit fdab4b8 into main May 30, 2026
4 checks passed
@krutftw krutftw deleted the copilot/check-repo-errors branch May 30, 2026 14:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens server-side integrations by improving how upstream/provider HTTP responses are parsed (explicitly handling non-JSON bodies) and adjusts runtime configuration for spawned CLI processes, plus a small GitHub Pages workflow tweak.

Changes:

  • Add explicit non-JSON response handling in fetchJson helpers for OpenAI-compatible, Ollama, and Gamma API clients.
  • Restrict environment variables passed to spawned CLI processes.
  • Add an enablement input to the GitHub Pages configure-pages workflow step.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/server/openAiCompatibleClient.js Adds guarded JSON parsing with a clearer error when the provider returns non-JSON.
src/server/ollamaClient.js Adds guarded JSON parsing with a clearer error when Ollama returns non-JSON.
src/server/gammaClient.js Adds guarded JSON parsing with a clearer error when Gamma returns non-JSON.
src/server/cliRunner.js Changes spawn() to pass a restricted env instead of inheriting process.env.
.github/workflows/pages.yml Adds enablement: true to actions/configure-pages@v5.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +9 to +17
let payload = {};
if (text) {
try {
payload = JSON.parse(text);
} catch {
throw new Error(
`Provider returned non-JSON response (${response.status}): ${text.slice(0, 200)}`
);
}
Comment on lines +23 to +32
let data = {};
if (text) {
try {
data = JSON.parse(text);
} catch {
throw new Error(
`Ollama returned non-JSON response (${response.status}): ${text.slice(0, 200)}`
);
}
}
Comment thread src/server/gammaClient.js
Comment on lines +13 to +22
let data = {};
if (text) {
try {
data = JSON.parse(text);
} catch {
throw new Error(
`Gamma API returned non-JSON response (${response.status}): ${text.slice(0, 200)}`
);
}
}
Comment thread src/server/cliRunner.js
Comment on lines +65 to 71
env: {
PATH: process.env.PATH,
HOME: process.env.HOME,
LANG: process.env.LANG,
TERM: process.env.TERM
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants