From 9ec7dcb15a5b02cf4a1320379db954eb5a060844 Mon Sep 17 00:00:00 2001 From: yeuimu <2197651308@qq.com> Date: Tue, 18 Aug 2026 07:49:51 +0000 Subject: [PATCH] docs(skill): warn --config must be flat action config Wrapping --config in {"config":{...}} deploys a silent empty script (succeeds in ~1ms, result {}). Document the trap + verification recipe (workflow get --json, nodes[].config.code non-empty). --- .../api-reference/action-types.md | 18 ++++++++++++++++++ .../inkreach-teable/guides/automation-guide.md | 2 ++ 2 files changed, 20 insertions(+) diff --git a/.agents/skills/inkreach-teable/api-reference/action-types.md b/.agents/skills/inkreach-teable/api-reference/action-types.md index f38e01f..a7ea0f1 100644 --- a/.agents/skills/inkreach-teable/api-reference/action-types.md +++ b/.agents/skills/inkreach-teable/api-reference/action-types.md @@ -96,6 +96,24 @@ inkreach-teable action update --dependencies '[]' # clear - `timeout`: default 60000 (120000 in batch mode). - `dependencies`: optional npm packages; `require('axios')` works in-sandbox. Install is cached by `name@version` hash; first run downloads, later runs reuse. CLI accepts JSON `[{"name","version?"}]` or shorthand `name@version,name`. `update` replaces the whole array (not append). +> ⚠️ **`--config` must be the FLAT action config itself** — the JSON above, exactly as shown. It is assigned directly to `node.config` (CLI does `config = JSON.parse(opts.config)`). +> Do **NOT** wrap it in a node envelope like `{"config": {...}}` or `{"type": "script", "config": {...}}` — the engine then reads `config.code` as `undefined` and the node becomes a **silent empty script**: it "succeeds" in ~1ms with empty stdout and `result: {}`, and every downstream `{{nodeId.result.*}}` variable reference breaks (e.g. sendNotification fails with `Missing required fields: message`). +> +> Correct: `--config '{"code":"return 1","timeout":120000}'` · Wrong: `--config '{"config":{"code":"return 1"}}'` +> +> **Verify after every `--config` deploy** (also guards against the automation editor overwriting CLI changes with a stale draft — close the editor before CLI updates): +> ```bash +> inkreach-teable workflow get --base-id --json | python3 -c " +> import json,sys +> d=json.load(sys.stdin) +> for n in d.get('nodes',[]): +> if n.get('id')=='': +> c=n.get('config') or {} +> print('keys:',list(c.keys()),'code-len:',len(c.get('code') or ''))" +> # expect keys ['code','timeout',...] and code-len > 0 +> ``` +> Symptom cheat-sheet: script "succeeded" but `executionTime` ≈ 1ms, `stdout` empty, `result` `{}` → config shape was wrong (code never deployed). + **Output:** ```json { "result": "", "logs": { "stdout": "...", "stderr": "..." }, "executionTime": 123 } diff --git a/.agents/skills/inkreach-teable/guides/automation-guide.md b/.agents/skills/inkreach-teable/guides/automation-guide.md index ee8f956..5d96402 100644 --- a/.agents/skills/inkreach-teable/guides/automation-guide.md +++ b/.agents/skills/inkreach-teable/guides/automation-guide.md @@ -67,6 +67,8 @@ Full config details: [trigger-types.md](../api-reference/trigger-types.md). Full config details: [action-types.md](../api-reference/action-types.md). +> ⚠️ `action update --config ''` takes the **flat action config** (e.g. `{"code":"...","timeout":120000}`), NOT `{"config":{...}}`. A wrapped config deploys an empty script that "succeeds" in ~1ms with `result: {}` and breaks downstream `{{nodeId.result.*}}` references. After any `--config` deploy, verify with `workflow get --json` that `nodes[].config.code` is non-empty. Details: [action-types.md § script](../api-reference/action-types.md). + ## Creation Workflow ```bash