Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

fix: steadier background sync

ogsamrat307d0422ffb5
diff --git a/apps/server/src/redact-policy.test.ts b/apps/server/src/redact-policy.test.ts
index de30ed54..75303f9b 100644
--- a/apps/server/src/redact-policy.test.ts
+++ b/apps/server/src/redact-policy.test.ts
@@ -185,3 +185,11 @@ test("client-raw: install arguments, command lines, web visits and git remotes g
assert.ok(text.includes(JSON.stringify(visit).slice(1, -1)), "the visit's address as visited");
assert.ok(text.includes(JSON.stringify(remote).slice(1, -1)), "the git remote as configured");
});
+
+test("client-raw: credential files and every .env* file stay out of snapshots", () => {
+ for (const name of ["app/.env", "app/.env.example", ".ssh/id_ed25519", "certs/server.pem", "keys/prod.json"]) {
+ withPolicy("client-raw", () => assert.equal(uploader.isUploadFileDenied(name), true, name));
+ }
+ assert.equal(uploader.isUploadFileDenied("app/.env.example"), false);
+ withPolicy("client-raw", () => assert.equal(uploader.isUploadFileDenied("src/app.ts"), false));
+});
diff --git a/apps/server/src/session-uploader.ts b/apps/server/src/session-uploader.ts
index 66faec1f..0f0b429a 100644
--- a/apps/server/src/session-uploader.ts
+++ b/apps/server/src/session-uploader.ts
@@ -1433,7 +1433,8 @@ export function isUploadPathDenied(path: string): boolean {
* workspace, attachments) keeps to isUploadPathDenied.
*/
export function isUploadFileDenied(path: string): boolean {
- return uploadPathDenied(path, true);
+ // client-raw scrubs nothing, so `.env*` templates stay out like every credential file.
+ return uploadPathDenied(path, !redactionRaw());
}
function uploadPathDenied(path: string, scrubbed: boolean): boolean {