Skip to content

Add frontend utility tests#5

Merged
samxu01 merged 1 commit intomainfrom
ed6149-codex/add-more-tests-to-frontend
May 28, 2025
Merged

Add frontend utility tests#5
samxu01 merged 1 commit intomainfrom
ed6149-codex/add-more-tests-to-frontend

Conversation

@samxu01
Copy link
Copy Markdown
Contributor

@samxu01 samxu01 commented May 28, 2025

Summary

  • add Jest tests for avatar utils, refresh utils and style utils

Testing

  • npm run lint:frontend
  • CI=true npm test -- --runTestsByPath src/utils/avatarUtils.test.js src/utils/refreshUtils.test.js src/utils/styleUtils.test.js

@samxu01 samxu01 merged commit 60da583 into main May 28, 2025
2 checks passed
samxu01 pushed a commit that referenced this pull request Feb 2, 2026
@samxu01 samxu01 deleted the ed6149-codex/add-more-tests-to-frontend branch February 2, 2026 04:35
samxu01 added a commit that referenced this pull request Feb 27, 2026
- agent-runtime skill: add debug checklist item #5 and anti-pattern section
  for agents that rewrite their workspace SKILL.md/HEARTBEAT.md with invented
  tool names (commonly_read_context, commonly_get_summaries, etc.)
- content-curator skill: add prominent warning that no commonly_* tool shortcuts
  exist; update last_updated date

Root cause from x-curator incident (2026-02-25): agent self-"fixed" its
HEARTBEAT.md and skills/commonly/SKILL.md by replacing real HTTP endpoints
with non-existent tool names, causing silent failures and "no activity" narration.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
samxu01 pushed a commit that referenced this pull request Apr 3, 2026
samxu01 pushed a commit that referenced this pull request Apr 3, 2026
- agent-runtime skill: add debug checklist item #5 and anti-pattern section
  for agents that rewrite their workspace SKILL.md/HEARTBEAT.md with invented
  tool names (commonly_read_context, commonly_get_summaries, etc.)
- content-curator skill: add prominent warning that no commonly_* tool shortcuts
  exist; update last_updated date

Root cause from x-curator incident (2026-02-25): agent self-"fixed" its
HEARTBEAT.md and skills/commonly/SKILL.md by replacing real HTTP endpoints
with non-existent tool names, causing silent failures and "no activity" narration.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
MubaiHua pushed a commit that referenced this pull request Apr 20, 2026
MubaiHua pushed a commit that referenced this pull request Apr 20, 2026
- agent-runtime skill: add debug checklist item #5 and anti-pattern section
  for agents that rewrite their workspace SKILL.md/HEARTBEAT.md with invented
  tool names (commonly_read_context, commonly_get_summaries, etc.)
- content-curator skill: add prominent warning that no commonly_* tool shortcuts
  exist; update last_updated date

Root cause from x-curator incident (2026-02-25): agent self-"fixed" its
HEARTBEAT.md and skills/commonly/SKILL.md by replacing real HTTP endpoints
with non-existent tool names, causing silent failures and "no activity" narration.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
lilyshen0722 added a commit that referenced this pull request Apr 27, 2026
…242)

The CAP HTTP surface (ADR-004) is the kernel; today every driver re-derives
its own in-process tool surface on top. OpenClaw agents go through a
hand-rolled extension at `_external/clawdbot/extensions/commonly/`; the
local-CLI wrapper has MCP plumbing but no Commonly MCP server to point at.
Adding a cross-driver tool (e.g. `commonly_dm_agent` for the Task #5
nova→sam-local-codex DM cutover) requires a fork PR + submodule bump on the
OpenClaw side and gives the CLI-wrapper side nothing.

ADR-010 ships `@commonly/mcp` — a stdio MCP server that wraps the kernel as
standard MCP tools. Any MCP-capable runtime (codex, Claude Code, OpenClaw if
it speaks MCP) loads one config entry and gets the standard `commonly_*`
surface. Phase 1: ship the server, refactor the existing `POST /room` to
dual-auth (the established `tasksApi.ts:34-36` pattern), wire sam-local-codex.
Phase 2: OpenClaw migration, gated on openclaw-MCP support investigation.
Phase 3: Task #5 cutover, mechanical once Phase 1 lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lilyshen0722 added a commit that referenced this pull request Apr 27, 2026
ADR-010 Phase 1: ship `@commonly/mcp` and refactor `POST /api/agents/runtime/room`
from human-auth-only to dual-auth so agents can open agent↔agent 1:1 rooms via
the new `commonly_dm_agent` MCP tool.

## What ships

- **`commonly-mcp/`** — new top-level package (`@commonly/mcp@0.1.0`). Stdio
  MCP server wrapping CAP (`/api/agents/runtime/*` per ADR-004) plus the
  dual-auth task surface (`/api/v1/tasks/*`) as 14 standard MCP tools matching
  the openclaw extension's `commonly_*` naming convention. Single-tenant per
  process, reads `COMMONLY_API_URL` and `COMMONLY_AGENT_TOKEN` from env at
  startup, fails fast if either is missing. 28 unit tests.

- **Backend `POST /room` dual-auth** — refactored to dispatch via the
  established `tasksApi.ts:34-36` pattern (`cm_agent_*` prefix → agent path,
  else → human path). Agent path resolves caller via `req.agentUser` (with
  installation-token fallback), refuses self-DM, calls existing
  `DMService.getOrCreateAgentRoom`. Human path unchanged below the new
  branch. 8 integration tests covering both paths + 1:1 invariant + symmetry.
  Rate-limited via `phase4RateLimit` (120/60s).

- **CI step for commonly-mcp tests** in `.github/workflows/tests.yml`.

- **`docs/agents/COMMONLY_MCP.md`** — install + env-var contract + tool
  reference, copyable into a host runtime's `mcp_servers` config.

## Out of scope

- Phase 2 (OpenClaw migration) — separate PR after openclaw-MCP investigation.
- Phase 3 (Task #5 nova HEARTBEAT cutover) — mechanical once Phase 1 lands.
- Live smoke against api-dev — runnable post-deploy via
  `commonly-mcp/__tests__/smoke.live.mjs` (excluded from `npm test`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
samxu01 added a commit that referenced this pull request Apr 28, 2026
…local-codex (#247)

Task #5 of ADR-005 Stage 3 / ADR-010 Phase 3. Nova's heartbeat retires
acpx_run as the codex implementation path and replaces it with DM-based
delegation to sam-local-codex.

Heartbeat is a separate model invocation per tick — nova posts a self-
contained task spec into her 1:1 agent-room with sam (podId hardcoded as
SamCodexDmPodId, pre-created via the dual-auth /room endpoint shipped in
PR #243), writes ## PendingDelegation to memory, and reads sam's reply
on the next tick. Five-branch decision tree (A: reply received, B: still
waiting, C: 90-min timeout → block, D: fresh task → delegate, E: idle).

Includes regression test asserting acpx_run is only in negative-instruction
lines, PendingDelegation + SamCodexDmPodId present, all five Branch labels.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant