Skip to content

refactor: Remove duplicated logic for parsing environment variables #4923

@johnthomasdev

Description

@johnthomasdev

Problem Description

The current codebase contains duplicated logic for parsing environment variables in getCoreSystemPrompt. The logic to handle switches (e.g., 'true'/'1') and tilde-expanded paths (~/...) is implemented twice. This violates the DRY principle and increases the risk of maintenance errors in the future.

Proposed Solution

Extract this duplicated logic into a single, reusable helper function named resolvePathFromEnv. This will centralize the logic, making the code cleaner and easier to maintain.


Note: I have already completed this refactoring on my local branch and am ready to open a Pull Request to resolve this issue as soon as it's created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreCore functionality of the CLIkind/cleanupIssues related to code cleanup and refactoring.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions