Build a Python Codex SDK service that receives allowlisted Feishu messages, keeps per-user-per-chat multi-turn context, generates and safely executes read-only ODPS SQL, and automatically publishes results as tenant-readable Feishu spreadsheets.
.env without exposing thembusiness predicate and accept offline dt-only partition filteringopenai-codex==0.144.4, OpenRouter, GPT-5.6 Terra./new, /clear, /help plus exact English and Chinese aliases.nohup management scripts, not Docker or systemd.apptype means no product filter; explicit apptype remains an exact filter.direct_reply; any answer requiring new numeric facts must retain the existing guarded Skill/SQL execution path.| Error | Attempt | Resolution |
|---|---|---|
| SOCKS proxy extras missing in the isolated venv | 1 | Added httpx[socks] and requests[socks] dependencies. |
| Feishu SDK INFO log included ephemeral WebSocket query credentials | 1 | Switched SDK logging to ERROR, deleted the affected log, and verified the replacement log contains no access key or ticket. |
OpenRouter returned 401 User not found |
1 | Found a stale shell OPENROUTER_API_KEY overriding the valid project .env; changed project config to prefer .env and added a regression test. |
| Initial result-publishing refactor referenced pre-refactor local variables | 1 | Replaced them with the method arguments and derived run directory before running tests. |
OpenRouter rejected the nested Skill routing schema because additionalProperties: false was absent |
1 | Set all structured-output Pydantic models to forbid extra properties, producing a strict compatible schema. |
| Enabling read-only file tools could expose project credential files | 1 | Replaced the broad read-only sandbox preset with a least-privilege permission profile that denies root, .env*, runtime, logs, and Git while allowing read-only Skill workspace access. |
| Repeated standalone multi-case SDK probes completed without forwarding Python stdout | 3 | Stopped repeating the wrapper probe; inspect the generated Codex session record and rely on the service/doctor path for integration validation. |
| Git diff/status checks failed because the project is not a Git repository | 1 | Switched final validation to compilation, tests, configuration/doctor checks, and a secret scan excluding the expected local .env. |
Diagnostic shell used reserved zsh variable status after reproducing the formatter traceback |
1 | The traceback was captured successfully; avoid that variable name in subsequent commands. |
| First real-plan probe had invalid nested shell quoting | 1 | Removed the embedded single-quoted JSON-path literal and changed the assertion to safe SQL substrings. |
nohup service process was reaped when the tool command ended |
1 | Removed the stale PID and launched the service in a persistent foreground exec session; PID and WebSocket startup were verified. |
Conversation diagnostic queried a nonexistent updated_at column |
1 | Inspect the SQLite schema first and query only the actual conversation columns. |
Planned cleanup patch no longer matched sql_guard.py |
1 | Detected a concurrent 15:39 Skill/guard update, re-read the changed files, and preserved the newer business-field validation instead of overwriting it. |
A diagnostic rg pattern used backticks inside double quotes, causing zsh command substitution |
1 | The file output was still obtained; use single-quoted search patterns or plain terms for future shell searches. |
| First fresh-plan assertion command had unmatched nested shell quotes | 1 | Switch to a quoted Python heredoc so SQL literals are not interpreted by zsh. |
Product-efficiency repair added video_action_log_applet.business='applet' |
1 | Diagnosed that product-efficiency SQL must not filter business at all; the host metadata guard incorrectly required every reported partition column instead of accepting the Skill's verified dt-only offline predicate. |