Skip to content

fix(ci): green the check + check-docs gates (tsgo, lint, docs) - #69

Merged
cryptolir merged 1 commit into
mainfrom
fix/tsgo-type-errors
Jun 17, 2026
Merged

cryptolir merged 1 commit into
mainfrom
fix/tsgo-type-errors

Conversation

@cryptolir

Copy link
Copy Markdown
Owner

Green the check + check-docs CI gates so openclaw PRs stop needing --admin. Follows #67 (which cleared the oxfmt cause and exposed the deeper failures underneath). Pure tooling/correctness — no runtime feature change.

check (= format:check && tsgo && lint)

tsgo — 9 errors across 4 files (enumerated against CI's real scope; the worktree symlink produces phantom ui/* / TS2742 errors CI never sees — reproduced clean with bind mounts):

  • chat.ts:417 (the real soundness gap): contentBlocks was typed Record<string,unknown>[], erasing that params.content is genuinely AssistantContentBlock[] (text | image). Fixed to its real union; the type === "text" predicate now honestly narrows to AssistantTextContentBlock; and a single commented boundary cast to Extract<AppendMessageArg, {role:"assistant"}>["content"] covers the genuine gap that Pi's AssistantMessage.content union has no image variant even though the transcript JSONL stores image blocks as-is. No any.
  • self-info-tool.e2e.test.ts — narrow content[0] before reading .text.
  • skills-bundled.test.ts — modern single-fn-type vi.fn signature.
  • login-qr.test.ts — type the WhatsApp-socket mock as a partial at the mock boundary (commented).

lint (oxlint): dropped an unused loadConfig import (bot-members.ts) + 3 redundant <Record<string,unknown>> type args (self-info-tool.ts).

check-docs (= format:docs && lint:docs && check-links)

Pre-existing doc debt unrelated to the type work, fixed to fully green the gate: a bare URL + malformed emphasis (life-per-user-memory.md), and a missing table cell (MD056) + an unvalidatable out-of-docs link (INFRASTRUCTURE.md).

Gate (matching CI)

  • pnpm check → green (0 lint errors, tsgo exit 0).
  • pnpm check:docs → green.
  • oxfmt --check → clean.
  • vitest for the touched areas passes: self-info-tool e2e (8), skills-bundled (14), login-qr (3), chat transcript/abort/send.

After this, check/check-docs are green on main and PRs no longer need --admin.

🤖 Generated with Claude Code

Resolve every pre-existing failure in `pnpm check` (format && tsgo && lint) and
`pnpm check:docs` (format:docs && lint:docs && check-links) so openclaw PRs stop
needing --admin.

tsgo (9 errors, 4 files):
- chat.ts:417 — type contentBlocks as its real AssistantContentBlock[] union
  (text|image) instead of Record<string,unknown>[]; make the text-block
  predicate honest; isolate one commented boundary cast to the Pi
  AssistantMessage.content type (Pi's union has no image variant, but the
  transcript stores image blocks as-is). No `any`.
- self-info-tool.e2e.test.ts — narrow content[0] before reading .text.
- skills-bundled.test.ts — modern single-fn-type vi.fn signature.
- login-qr.test.ts — type the WhatsApp socket mock as a partial at the mock
  boundary (commented).

lint (oxlint): drop an unused import (bot-members.ts) + 3 redundant
<Record<string,unknown>> type args (self-info-tool.ts).

docs (markdownlint + link-check): bare URL + malformed emphasis
(life-per-user-memory.md), a missing table cell + an unvalidatable out-of-docs
link (INFRASTRUCTURE.md).

Gate: pnpm check, pnpm check:docs, oxfmt --check all green; vitest for the
touched areas passes (self-info-tool e2e 8, skills-bundled 14, login-qr 3,
chat transcript/abort/send).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@cryptolir

Copy link
Copy Markdown
Owner Author

@codex review

Greens the check + check-docs gates (pre-existing failures, not from any feature). The one judgment call to scrutinize:

chat.ts:417 — params.content is AssistantContentBlock[] (text | image). I typed contentBlocks as that real union and isolated ONE commented boundary cast as Extract<AppendMessageArg, {role:"assistant"}>["content"] because Pi's AssistantMessage.content union models only text|thinking|toolCall — no image — yet the transcript stores image blocks as-is at runtime. Is the boundary cast the right call here, or should Pi's content type be widened upstream instead? Any runtime path where an image block reaching appendMessage is mishandled? (The Extract<…,{role:"assistant"}>["content"] pattern is already used elsewhere, e.g. google.ts:83.)

Also confirm the test-mock fixes (skills-bundled vi.fn signature, login-qr partial-socket cast, self-info content narrowing) are honest, not masking a real type bug. The docs fixes are markdownlint/link-only.

Gate: pnpm check + pnpm check:docs + oxfmt --check all green; vitest touched areas pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 60c6684db8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cryptolir
cryptolir merged commit 2bb5f44 into main Jun 17, 2026
16 of 24 checks passed
@cryptolir
cryptolir deleted the fix/tsgo-type-errors branch June 17, 2026 08:09
cryptolir added a commit that referenced this pull request Jun 17, 2026
Record the per-user-profile Phase 3 deploy: PR #68 (app_profile context
injection) + #69 (CI gate fix) merged; gateway image v2026.06.17.1
(sourceSha 50f6c2d) built and pinned to the life agent only on 2ndClaw;
life workspace AGENTS.md gained the app_profile writable section + rules.
Note the intentional life-ahead image drift on the US host.

Co-authored-by: Liran Peretz <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant