This commit is contained in:
Yaroslav Halchenko 2026-01-30 09:44:45 +01:00 committed by GitHub
commit ee06e6eee8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 50 additions and 17 deletions

7
.codespellrc Normal file
View File

@ -0,0 +1,7 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git*,*.svg,package-lock.json,vendor,*-lock.yaml,*.css,.codespellrc,dist,*.caf,*/a2ui/*,.cache,*.prose,.npm
check-hidden = true
# Ignore camelCase and PascalCase identifiers (common in code)
ignore-regex = \b[a-z]+[A-Z]\w*\b|\b[A-Z][a-z]+[A-Z]\w*\b
ignore-words-list = inout,rouge,statics,caf,afterall,cript,fro,nd,ot,fo

25
.github/workflows/codespell.yml vendored Normal file
View File

@ -0,0 +1,25 @@
# Codespell configuration is within .codespellrc
---
name: Codespell
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2

1
.gitignore vendored
View File

@ -71,3 +71,4 @@ USER.md
# local tooling
.serena/
.npm/

View File

@ -69,7 +69,7 @@ never show dollar cost.
Provider prompt caching only applies within the cache TTL window. OpenClaw can
optionally run **cache-ttl pruning**: it prunes the session once the cache TTL
has expired, then resets the cache window so subsequent requests can re-use the
has expired, then resets the cache window so subsequent requests can reuse the
freshly cached context instead of re-caching the full history. This keeps cache
write costs lower when a session goes idle past the TTL.

View File

@ -410,7 +410,7 @@ Notes:
- Role snapshot options (`--interactive`, `--compact`, `--depth`, `--selector`) force a role-based snapshot with refs like `ref=e12`.
- `--frame "<iframe selector>"` scopes role snapshots to an iframe (pairs with role refs like `e12`).
- `--interactive` outputs a flat, easy-to-pick list of interactive elements (best for driving actions).
- `--labels` adds a viewport-only screenshot with overlayed ref labels (prints `MEDIA:<path>`).
- `--labels` adds a viewport-only screenshot with overlaid ref labels (prints `MEDIA:<path>`).
- `click`/`type`/etc require a `ref` from `snapshot` (either numeric `12` or role ref `e12`).
CSS selectors are intentionally not supported for actions.
@ -427,7 +427,7 @@ OpenClaw supports two “snapshot” styles:
- Output: a role-based list/tree with `[ref=e12]` (and optional `[nth=1]`).
- Actions: `openclaw browser click e12`, `openclaw browser highlight e12`.
- Internally, the ref is resolved via `getByRole(...)` (plus `nth()` for duplicates).
- Add `--labels` to include a viewport screenshot with overlayed `e12` labels.
- Add `--labels` to include a viewport screenshot with overlaid `e12` labels.
Ref behavior:
- Refs are **not stable across navigations**; if something fails, re-run `snapshot` and use a fresh ref.

View File

@ -568,7 +568,7 @@ session "You are a helpful assistant. Analyze this code for bugs."
# ... later ...
session "You are a helpful assistant. Analyze this code for bugs."
# ... even later ...
session "You are a helpful assistent. Analyze this code for bugs." # Typo!
session "You are a helpful assistant. Analyze this code for bugs." # Typo!
```
**Why it's bad**: Inconsistency when updating. Typos go unnoticed.

View File

@ -121,9 +121,9 @@ describe("extractModelDirective", () => {
describe("edge cases", () => {
it("absorbs path-like segments when /model includes extra slashes", () => {
const result = extractModelDirective("thats not /model gpt-5/tmp/hello");
const result = extractModelDirective("that's not /model gpt-5/tmp/hello");
expect(result.hasDirective).toBe(true);
expect(result.cleaned).toBe("thats not");
expect(result.cleaned).toBe("that's not");
});
it("handles alias with special regex characters", () => {

View File

@ -152,33 +152,33 @@ describe("directive parsing", () => {
});
it("preserves spacing when stripping think directives before paths", () => {
const res = extractThinkDirective("thats not /think high/tmp/hello");
const res = extractThinkDirective("that's not /think high/tmp/hello");
expect(res.hasDirective).toBe(true);
expect(res.cleaned).toBe("thats not /tmp/hello");
expect(res.cleaned).toBe("that's not /tmp/hello");
});
it("preserves spacing when stripping verbose directives before paths", () => {
const res = extractVerboseDirective("thats not /verbose on/tmp/hello");
const res = extractVerboseDirective("that's not /verbose on/tmp/hello");
expect(res.hasDirective).toBe(true);
expect(res.cleaned).toBe("thats not /tmp/hello");
expect(res.cleaned).toBe("that's not /tmp/hello");
});
it("preserves spacing when stripping reasoning directives before paths", () => {
const res = extractReasoningDirective("thats not /reasoning on/tmp/hello");
const res = extractReasoningDirective("that's not /reasoning on/tmp/hello");
expect(res.hasDirective).toBe(true);
expect(res.cleaned).toBe("thats not /tmp/hello");
expect(res.cleaned).toBe("that's not /tmp/hello");
});
it("preserves spacing when stripping status directives before paths", () => {
const res = extractStatusDirective("thats not /status:/tmp/hello");
const res = extractStatusDirective("that's not /status:/tmp/hello");
expect(res.hasDirective).toBe(true);
expect(res.cleaned).toBe("thats not /tmp/hello");
expect(res.cleaned).toBe("that's not /tmp/hello");
});
it("does not treat /usage as a status directive", () => {
const res = extractStatusDirective("thats not /usage:/tmp/hello");
const res = extractStatusDirective("that's not /usage:/tmp/hello");
expect(res.hasDirective).toBe(false);
expect(res.cleaned).toBe("thats not /usage:/tmp/hello");
expect(res.cleaned).toBe("that's not /usage:/tmp/hello");
});
it("parses queue options and modes", () => {

View File

@ -65,7 +65,7 @@ export function resolveSessionKeyForRequest(opts: {
let sessionKey: string | undefined =
explicitSessionKey ?? (ctx ? resolveSessionKey(scope, ctx, mainKey) : undefined);
// If a session id was provided, prefer to re-use its entry (by id) even when no key was derived.
// If a session id was provided, prefer to reuse its entry (by id) even when no key was derived.
if (
!explicitSessionKey &&
opts.sessionId &&