Skip to content

harden: extend webpack fallbacks and add server-only guards#6

Merged
seanebones-lang merged 1 commit into
mainfrom
claude/enhance-system-agents-lk66U
Mar 17, 2026
Merged

harden: extend webpack fallbacks and add server-only guards#6
seanebones-lang merged 1 commit into
mainfrom
claude/enhance-system-agents-lk66U

Conversation

@seanebones-lang
Copy link
Copy Markdown
Owner

  1. next.config.js: Add webpack fallbacks for child_process, net, os in addition to existing fs and path — prevents future build failures if any server module leaks into a client import chain.

  2. Add import 'server-only' to modules that must never be client-bundled:

    • tool-executor.ts (uses child_process, fs, path)
    • rag-system.ts (uses persistence/fs)
    • ml-learning-system.ts (uses persistence/fs)
    • knowledge-graph.ts (uses persistence/fs)
    • agent-precision-system.ts (uses persistence/fs)

    This gives a compile-time error if anyone accidentally imports
    these from a 'use client' component.

  3. Simplify agent-memory.ts lazy require type signature.

https://claude.ai/code/session_01EgmjHaEN3MdD47o3BgynKV

1. next.config.js: Add webpack fallbacks for child_process, net, os
   in addition to existing fs and path — prevents future build failures
   if any server module leaks into a client import chain.

2. Add `import 'server-only'` to modules that must never be client-bundled:
   - tool-executor.ts (uses child_process, fs, path)
   - rag-system.ts (uses persistence/fs)
   - ml-learning-system.ts (uses persistence/fs)
   - knowledge-graph.ts (uses persistence/fs)
   - agent-precision-system.ts (uses persistence/fs)

   This gives a compile-time error if anyone accidentally imports
   these from a 'use client' component.

3. Simplify agent-memory.ts lazy require type signature.

https://claude.ai/code/session_01EgmjHaEN3MdD47o3BgynKV
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grokcode Ready Ready Preview, Comment Mar 17, 2026 11:57pm

Request Review

@seanebones-lang seanebones-lang merged commit ca4c89f into main Mar 17, 2026
2 checks passed
@seanebones-lang seanebones-lang deleted the claude/enhance-system-agents-lk66U branch March 17, 2026 23:57
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