Skip to content

improvement(workflow-code): remove agent traps from table keys, Function results, resume ids and builder names - #10336

Open
waleedlatif1 wants to merge 2 commits into
stagingfrom
improvement/workflow-code-agent-traps
Open

waleedlatif1 wants to merge 2 commits into
stagingfrom
improvement/workflow-code-agent-traps

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Table keys keep underscores: a table named daily_totals is keyed daily_totals, not daily-totals, so the key an agent types matches the name. Persisted keys are never recomputed, so existing workspaces round-trip unchanged; a collision after slugging still gets a -2 suffix.
  • A whole Function result in a JSON field is now inferred from its returns (string or not), and catalog outputs whose runtime value can be text (Function result, api.data, other any outputs) warn W_JSON_REF_UNTYPED unless inferred. Print and compile share the same rule.
  • Paused sim workflows run / runs get output gains an additive next field with the exact sim workflows runs resume <id> --workflow <wf> --context <ctx> command.
  • Builder lookups suggest the right spelling (humanInTheLoop -> human, snake_case, display names, legacy block types) in source params and compile; a bare unknown call is E_UNKNOWN_BUILDER.

Type of Change

  • Improvement

Testing

  • New and updated tests in workflow-code, sim-cli, workflow-sdk and resource-keys (unit and integration against Postgres); each fails when its source change is reverted.
  • Local gate: package typechecks, every workspace suite, apps/sim unit and integration suites, check:workflow-code-golden, check:audits, check:test-types, check:migrations, docs compatibility, lint:check, root type-check, block-registry check against staging.
  • The realtime file-doc-capabilities afterAll hook timeout appeared once in the full realtime run (nothing in apps/realtime changed) and passes when run alone.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 23, 2026 4:35pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 2/5

[Medium impact] The changes affect workflow authoring and workflow-run output, plus resource keys across workspace resources.

Fix the resume-link search before merging; it can suggest unsafe shell commands and commands that cannot resume parallel pauses.

Findings

  1. P1 Security Workflow data becomes shell code ▶
  2. P1 Parallel pauses lose their context ▶

Summary

The PR keeps underscores in newly allocated resource keys, infers whole Function results for JSON fields, improves builder-name hints, and adds resume commands to paused CLI results.

  • New resource keys keep underscores from resource names.
  • JSON fields use clearer types for Function and other text-capable outputs.
  • Builder lookups suggest SDK names for alternate spellings.
  • Paused workflow runs show the command that resumes them.

Reviews (1) · Last reviewed commit: "improvement(workflow-code): remove agent..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 23 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

This branch was previously deployed

1 inactive deployment
Preview — edd1b40f Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant