Skip to content

fix(lint): guard dotted launch environment reads - #1634

Merged
SaulMoro merged 1 commit into
Tencent:mainfrom
huong8373tt-beep:fix/launch-env-dot-access
Oct 31, 2026
Merged

SaulMoro merged 1 commit into
Tencent:mainfrom
huong8373tt-beep:fix/launch-env-dot-access

Conversation

@huong8373tt-beep

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the maintainer feedback on #1607 after #1630 merged the broader launch-env migration.

teamai/launch-env already rejects quoted literals, no-expression templates, and computed process.env['TEAMAI_MODE'] spellings. This PR adds the missing static guard for direct property reads such as process.env.TEAMAI_MODE, process.env.TEAMAI_LAUNCHED_BY, and process.env.TEAMAI_WORKFLOW_ATTEMPT.

The canonical owner remains src/launch-context.ts; tests and imported constants remain allowed.

Verification

  • focused launch-env tests: 10 passed
  • npm run typecheck: passed
  • targeted oxlint probe: 0 warnings / 0 errors
  • git diff --check: passed

Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.

Closes #1607

@SaulMoro SaulMoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This was generated by AI during triage.

Approving. teamai/launch-env now flags dotted process.env.TEAMAI_MODE, TEAMAI_LAUNCHED_BY and TEAMAI_WORKFLOW_ATTEMPT reads outside src/launch-context.ts, which closes the gap left when the old scan moved into lint. The plugin flags the pattern on this head and not on main, the repository has no existing hits, and lint is green.

  • [P3 nit] Destructuring and alias reads (const env = process.env; env.TEAMAI_MODE) still pass. Nothing in the code does that today.
  • [P3 nit] oxlint-plugin-teamai/README.md still describes launch-env as catching literals only.

@SaulMoro
SaulMoro merged commit 0d89cd7 into Tencent:main Oct 31, 2026
16 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
teamai/launch-env also rejects dotted process.env reads of TEAMAI_MODE, TEAMAI_LAUNCHED_BY and TEAMAI_WORKFLOW_ATTEMPT outside src/launch-context.ts.

Closes Tencent#1607
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.

2 participants