Skip to content

Fix automation exporter escaping for reliable Python/Node output#103

Merged
TopProjectsCreator merged 1 commit into
mainfrom
codex/fix-code-exporter-in-automations-pane/2026-04-18
Apr 18, 2026
Merged

Fix automation exporter escaping for reliable Python/Node output#103
TopProjectsCreator merged 1 commit into
mainfrom
codex/fix-code-exporter-in-automations-pane/2026-04-18

Conversation

@TopProjectsCreator
Copy link
Copy Markdown
Owner

Motivation

  • The automation pane generated Python/Node snippets by interpolating raw config values, which produced invalid code when users supplied quotes or special characters.
  • Generated exporter snippets need to reliably serialize user-provided strings to avoid runtime/parsing errors in exported scripts.

Description

  • Hardened code generation in src/components/ide/AutomationTemplatePane.tsx by replacing fragile direct interpolations with safe serialized literals using JSON.stringify for Python and Node snippets.
  • Escaped provider-specific fields (models, email addresses, channels, chat IDs, repo/table names, voice IDs, currency, URLs) so generated code remains syntactically valid with arbitrary config values.
  • Improved GitHub Node snippet by introducing owner/repo constants and encodeURIComponent use to avoid malformed request URLs for special-character names.
  • Fixed a parsing error introduced during editing and ensured generator sets nodeCode/pythonCode correctly for the UI display.

Testing

  • Ran npx eslint src/components/ide/AutomationTemplatePane.tsx which returned no parsing errors and only a few repo warnings in that file.
  • Ran npm run test -- src/test/languageTemplates.test.ts and the test suite passed (1 file, 4 tests all passed).
  • Ran npm run lint which shows pre-existing repo warnings but no new parsing errors introduced by this change.

Codex Task

@TopProjectsCreator TopProjectsCreator added the codex This has been or will be assigned to codex for development label Apr 18, 2026 — with ChatGPT Codex Connector
@TopProjectsCreator TopProjectsCreator merged commit 0fccdeb into main Apr 18, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex This has been or will be assigned to codex for development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant