Open kgilpin opened 1 month ago
Title: Ensure User-Specified Token Limit Overrides Environment Variable
Problem: The user-specified token limit (/tokenlimit=8000
) is not overriding the environment variable APPMAP_NAVIE_TOKEN_LIMIT
as expected. The logs indicate that the token limit utilized by the application is still taken from the environment variable rather than the user input.
Analysis: Typically, in a configuration setting where both environment variables and user inputs are involved, the hierarchy of precedence generally gives higher priority to user inputs. The issue here suggests that the overriding logic might not be functioning correctly. A review of the logic handling the token limit could reveal if the user input value is appropriately captured and takes precedence over the environment variable.
The OPTION_SETTERS
object in navie-local.ts
indicates where settings like tokenLimit
are configured. It's crucial to ensure that when a token limit is specified by the user, it should be properly parsed and assigned, surpassing any associated value set by environment variables.
Proposed Changes:
File: packages/cli/src/rpc/explain/navie/navie-local.ts
OPTION_SETTERS
for tokenLimit
, ensure there's logic in place that checks if a user input value (/tokenlimit
) exists and override the environment-based value. Confirm that this setter is correctly invoked when a user specification is present and parsed before the environment variable setting.File: packages/client/src/loadConfiguration.ts
APPMAP_NAVIE_TOKEN_LIMIT
influences other areas affecting token limit, ensure the logic accounts for user-provided values as a possible override.Testing Workflow:
/tokenlimit
user input and reflects it in processing metrics and output.Reviewing the current setup and ensuring a robust precedence rule for configuration values will provide a reliable override mechanism for user-specified settings.
I am asking:
The token limit is set in the environment as:
In the log, I am observing:
So it appears that the /tokenlimit override is not being applied correctly.