Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Revert "fix(webhook): extract links for incremental push syncs (#2850)"

Garry Tan45f85df8f4f2
diff --git a/src/commands/serve-http.ts b/src/commands/serve-http.ts
index 3a6c3fc7cd..9b01a183f3 100644
--- a/src/commands/serve-http.ts
+++ b/src/commands/serve-http.ts
@@ -2161,10 +2161,8 @@ export async function runServeHttp(engine: BrainEngine, options: ServeHttpOption
// Other event types (ping, pull_request, etc.) return 202 'ignored'
// so GitHub doesn't retry.
// D15.5: HMAC compare uses the shared safeHexEqual helper.
- // D18: submits 'sync' job with extraction + auto_embed_backfill enabled and
- // priority -10 (above autopilot's 0). This opts normal incremental pushes
- // into sync's inline extraction while pagesAffected still identifies the
- // changed pages. The sync core can still defer large (>100) changes.
+ // D18: submits 'sync' job with auto_embed_backfill=true and priority -10
+ // (above autopilot's 0).
// ---------------------------------------------------------------------------
const githubWebhookLimiter = rateLimit({
windowMs: 60_000,
@@ -2284,7 +2282,6 @@ export async function runServeHttp(engine: BrainEngine, options: ServeHttpOption
'sync',
{
sourceId: source.id,
- noExtract: false,
auto_embed_backfill: true,
embed_reason: 'webhook',
},
diff --git a/src/commands/sync.ts b/src/commands/sync.ts
index 4a5632c847..84f47488d2 100644
--- a/src/commands/sync.ts
+++ b/src/commands/sync.ts
@@ -1379,7 +1379,6 @@ See also:
{
sourceId: sourceIdArg,
repoPath: source.local_path,
- noExtract: false,
auto_embed_backfill: true,
embed_reason: 'sync_trigger',
},
diff --git a/test/sources-webhook.test.ts b/test/sources-webhook.test.ts
index e8fd75b405..fdda0ece91 100644
--- a/test/sources-webhook.test.ts
+++ b/test/sources-webhook.test.ts
@@ -16,7 +16,6 @@
*/
import { describe, test, expect } from 'bun:test';
import { createHmac } from 'node:crypto';
-import { readFileSync } from 'node:fs';
import { safeHexEqual } from '../src/core/timing-safe.ts';
const GITHUB_SECRET = 'super-secret-webhook-key';
@@ -124,25 +123,3 @@ describe('Branch ref construction (D5)', () => {
expect(pushedRef === `refs/heads/${trackedBranch}`).toBe(false);
});
});
-
-describe('Webhook sync job extraction contract', () => {
- test('opts into extraction before the pushed commit is consumed', () => {
- const serveSource = readFileSync(
- new URL('../src/commands/serve-http.ts', import.meta.url),
- 'utf8',
- );
- const routeStart = serveSource.indexOf("'/webhooks/github'");
- const queueStart = serveSource.indexOf('const job = await queue.add(', routeStart);
- const responseStart = serveSource.indexOf('res.status(202)', queueStart);
- expect(routeStart).toBeGreaterThanOrEqual(0);
- expect(queueStart).toBeGreaterThan(routeStart);
- expect(responseStart).toBeGreaterThan(queueStart);
-
- const routeSource = serveSource.slice(queueStart, responseStart);
- const payload = routeSource.match(
- /queue\.add\(\s*'sync',\s*\{([\s\S]*?)\}\s*,\s*\{/,
- );
- expect(payload).not.toBeNull();
- expect(payload?.[1]).toMatch(/\bnoExtract:\s*false\b/);
- });
-});
diff --git a/test/sync-trigger-cli.test.ts b/test/sync-trigger-cli.test.ts
index 07801b4ea7..ff31f7b45b 100644
--- a/test/sync-trigger-cli.test.ts
+++ b/test/sync-trigger-cli.test.ts
@@ -100,7 +100,6 @@ describe('runSyncTrigger', () => {
const job = jobs[0];
expect(job.priority).toBe(-10);
expect((job.data as { sourceId: string }).sourceId).toBe('default');
- expect((job.data as { noExtract: boolean }).noExtract).toBe(false);
expect((job.data as { auto_embed_backfill: boolean }).auto_embed_backfill).toBe(true);
});