Conversation
Cluster Performance
Run: workflow run for |
|
|
||
| const snapshotId = | ||
| params.snapshotId ?? | ||
| `${params.owner}-${params.repo}-${nowIso().replace(/[:.]/g, '-').replace(/Z$/, 'Z')}`; |
Check warning
Code scanning / CodeQL
Replacement of a substring with itself Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 15 days ago
In general, to fix this issue you should either remove the no-op replace or change it to perform the intended transformation (for example, removing the Z or replacing it with a different suffix). Since we must avoid changing existing functionality where possible, the safest correction is to remove the redundant replace(/Z$/, 'Z') call, leaving the snapshot ID construction unchanged in observable behavior (because the call had no effect) while eliminating the CodeQL warning.
Concretely, in packages/api-core/src/service.ts around line 1398, the snapshotId default is built as:
`${params.owner}-${params.repo}-${nowIso().replace(/[:.]/g, '-').replace(/Z$/, 'Z')}`;We should remove the .replace(/Z$/, 'Z') segment so that the code becomes:
`${params.owner}-${params.repo}-${nowIso().replace(/[:.]/g, '-')}`;No additional imports, methods, or definitions are needed, and this does not change the resulting string, since the removed operation was a no-op.
| @@ -1397,7 +1397,7 @@ | ||
|
|
||
| const snapshotId = | ||
| params.snapshotId ?? | ||
| `${params.owner}-${params.repo}-${nowIso().replace(/[:.]/g, '-').replace(/Z$/, 'Z')}`; | ||
| `${params.owner}-${params.repo}-${nowIso().replace(/[:.]/g, '-')}`; | ||
| const archiveManifest: SeedSidecarArchiveWriterInput = { | ||
| manifest: { | ||
| schemaVersion: 1, |
Summary
This PR adds the first end-to-end seed sidecar workflow for
openclaw/openclaw:ghcrawl initso GitHub-only setup is validseed-installfor importing a published starter sidecar into a local reposeed-exportfor maintainers to generate the sidecar locallyseed-auditto validate a generated sidecar before publishing it anywhereHow It Works
Install path
ghcrawl seed-install openclaw/openclawnow:--no-syncis requestedcontent_hashThe sidecar import is intentionally narrow:
openclaw/openclawExport path
Maintainers can generate a seed locally with:
The sidecar format is a streamed gzip NDJSON archive with:
This exporter now streams directly from SQLite so large OpenClaw exports no longer OOM.
Audit path
Before publishing a generated seed, maintainers can audit it with:
The audit is a streaming validation pass that fails if:
Seed Contents
The exported seed currently contains:
titleembeddingsbodyembeddingsIt explicitly does not export
dedupe_summaryembeddings.Where Seeds Are Supposed To Go
This PR does not publish any seed automatically.
The intended model is:
seed-exporton a populated local dev boxseed-auditlocally.seed.json.gzand.sha256are uploaded manually to a large-file distribution targetThe code already supports downloading from an arbitrary HTTPS URL, so the published artifact can live in:
There is intentionally no CI or merge-triggered seed publishing in this PR.
Compatibility
The sidecar manifest carries compatibility metadata:
schemaVersionformatsnapshotIdcompatibleCliembedModelsourceKindsseed-installvalidates that metadata before import and rejects incompatible assets.Notes
Testing
pnpm typecheckpnpm --filter @ghcrawl/api-core testpnpm --filter ghcrawl testopenclaw/openclawsidecar generated successfully at ~607 MB compressed with the streaming exporteropenclaw/openclawand intentional failing audit for a mismatched repo