Skip to content

Conversation

@brandonkachen
Copy link
Collaborator

No description provided.

codebuff-team and others added 8 commits October 21, 2025 14:23
Replaced all lodash functions with native JavaScript equivalents:
- compact/flattenDeep → custom buildArray with manual flattening
- isEqual → JSON.stringify comparison
- cloneDeep → JSON.parse(JSON.stringify())
- shuffle → Fisher-Yates algorithm
- uniq → Array.from(new Set())
- sortBy → native .sort() with comparator
- sumBy → .reduce() with accumulator
- mapValues → Object.fromEntries() + .map()
- union → Array.from(new Set([...arr1, ...arr2]))
- partition → custom implementation with type guards
- has → 'key' in obj checks
- isError → instanceof Error
- range → Array.from({ length }, (_, i) => i)

Removed lodash and @types/lodash from all package.json files.
All tests passing for modified packages.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…le to reduce duplication and standardize usage across backend, sdk, and tooling code.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Created common/src/util/lodash-replacements.ts as a shared module
containing all lodash replacement functions (cloneDeep, isEqual,
shuffle, range, sumBy, mapValues, union, partition).

Updated 13 files to import from shared module instead of duplicating:
- common/src/util/{array,object,string,messages}.ts
- backend/src/{run-agent-step,run-programmatic-step}.ts
- backend/src/tools/{stream-parser,tool-executor}.ts
- packages/agent-runtime/src/util/{messages,simplify-tool-results}.ts
- packages/agent-runtime/src/tools/handlers/tool/write-file.ts
- packages/agent-runtime/src/find-files/request-files-prompt.ts
- sdk/src/{run,run-state}.ts
- evals/git-evals/run-git-evals.ts
- scripts/analyze-edit-blocks.ts

Removed ~150 lines of duplicated code.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…ss codebase

Centralizes array dedup using a new uniq() function to replace scattered Set-based patterns and prepare groundwork for removing lodash replacements.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
- Merged origin/main into remove-lodash-comments branch with no conflicts
- Added native debounce function to common/src/util/lodash-replacements.ts
- Replaced lodash/debounce imports in web hooks with shared utility
- All typechecks pass successfully
…ate-ci-env.js

Node.js in CI cannot load .ts files directly. Replaced the import from
lodash-replacements.ts with an inline native uniq implementation.
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.

3 participants