Harrison/patch (#58)

* stash

* Apply suggestions from code review

* Update apps/open-swe/src/utils/load-model.ts

* Update apps/web/src/components/thread/index.tsx

* cr

---------

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This commit is contained in:
Brace Sproul 2025-05-30 15:18:19 -07:00 • committed by GitHub
parent 56d9df7246
commit c0d312601f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -384,8 +384,11 @@ export function fixGitPatch(
const result: string = buildPatch(parsed);
// If original had literal \n, convert back
if (patchString.includes("\\n") && !result.includes("\\n")) {
// More robust check for patches that use literal \n as line separators
const usesLiteralNewlines =
/^[^\\]*\\n/.test(patchString) && patchString.split("\n").length === 1;
if (usesLiteralNewlines && !result.includes("\\n")) {
return result.replace(/\n/g, "\\n");
}

View file

@ -65,7 +65,7 @@ export async function loadModel(config: GraphConfig, task: Task) {
thinking: { budget_tokens: thinkingBudgetTokens, type: "enabled" },
maxTokens,
}
: {}),
: { maxTokens: 5_000 }),
});
return model;