card-callback-performance

Enforce a 3-second response limit for IM card callbacks with a 30-second TTL cache.

2|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/liuyu520/cc-connect-fork --skill card-callback-performance
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: card-callback-performance
Source: https://github.com/liuyu520/cc-connect-fork/tree/main/.claude/skills/card-callback-performance
Command: npx skills add https://github.com/liuyu520/cc-connect-fork --skill card-callback-performance

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when encountering IM platform card callback timeouts (error 200340), "card interaction timeout", "card page turn slow", "renderListCard slow", "renderDeleteModeCard slow", "ListSessions slow", "3 second timeout", "session list cache", "sessionListCache", "listSessionsCached", or when adding new card rendering code that calls expensive I/O operations (ListSessions, file scanning, JSONL parsing) in card callback paths.

Core Features & Use Cases

  • Document the 3-second timeout constraint on card interactions (e.g., next/prev page, checkbox toggles, form submissions) and the need to render quickly.
  • Provide a robust caching pattern for expensive card data (e.g., ListSessions), including a TTL-based cache and invalidation hooks on mutations.
  • Serve as a guide for adding new card rendering code that relies on cached data to avoid blocking I/O.

Quick Start

Use the card-callback-performance skill to implement a session data cache to ensure card callbacks stay under 3 seconds and invalidate on mutation.

Frequently Asked Questions about card-callback-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my IM card callback timeout with error 200340?

Card callback timeout error 200340 occurs when card interactions exceed the 3-second response limit on IM platforms. Expensive I/O operations like ListSessions, file scanning, or JSONL parsing in the callback path block rendering and trigger this timeout.

How do I keep Feishu card interactions under the 3-second timeout?

To keep Feishu card interactions under 3 seconds, implement a deterministic caching pattern with a 30-second TTL for expensive data like ListSessions. This prevents blocking I/O during card callbacks such as page turns and checkbox toggles.

What is the best way to cache session lists for IM platform cards?

The best way to cache session lists for IM cards is using a TTL-based cache with a 30-second expiration. This approach ensures list rendering data is served quickly while providing explicit invalidation hooks when mutations occur.

When do I need to invalidate the session list cache in a card callback flow?

You need to invalidate the session list cache when mutations occur, such as data modifications from card interactions. Explicit invalidation clears the 30-second TTL cache, ensuring the next card render fetches fresh data without causing timeouts.

Can I use the same caching pattern for slash commands and card callbacks?

No, you should use separate paths for card callbacks versus slash commands. Card callbacks enforce a strict 3-second timeout for rendering interactions, requiring a 30-second TTL cache, while slash commands can handle I/O differently.