fix: default task root#196
Open
darklight3it wants to merge 1 commit into
Open
Conversation
maxday
reviewed
Jun 12, 2026
| if (!handlerString) { | ||
| throw new PlatformError("_HANDLER environment variable is not set"); | ||
| } | ||
| if (!taskRoot) { |
Member
There was a problem hiding this comment.
I think we should still check that it's not empty
Author
There was a problem hiding this comment.
Yes! I was super undecided for this.
You are right to be suspicious. However, I don't know if process.cwd() could ever be undefined or even string.empty, by definition a process should start somewhere on the filesystem.
And on the practical side the result would be the same as putting the handler in the wrong folder.
There was a problem hiding this comment.
process.cwd() would never be empty isn't it?
Author
There was a problem hiding this comment.
process.cwd() would never be empty isn't it?
exactly
maxday
reviewed
Jun 12, 2026
benrkia
reviewed
Jun 12, 2026
d6dd716 to
731a2d8
Compare
731a2d8 to
9b9bca3
Compare
benrkia
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Restore
LAMBDA_TASK_ROOTfallback toprocess.cwd()for OCI runtime image customers.The RIC 4.x refactoring introduced a hard requirement on the
LAMBDA_TASK_ROOTenvironment variable, throwing aPlatformErrorwhen it's not set. This is a regression fromRIC 3.xbehavior whereprocess.cwd()was used as the function root directory.LAMBDA_TASK_ROOTis a restricted environment variable set by lambda worker environment to/var/task. Customers building custom runtime images via OCI cannot change this value, but were previously free to place their handler anywhere and rely on the working directory. The new strict check forces them to explicitly setLAMBDA_TASK_ROOT.Changes
Testing
Target (OCI, Managed Runtime, both): both
#184
Checklist
npm installto generate thepackage-lock.jsoncorrectly and included it in the PR.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.