Skip to content

feat: missing tools + scoped approval system#18

Merged
MarcelRoozekrans merged 74 commits intomainfrom
fix/duplicate-notification
Mar 25, 2026
Merged

feat: missing tools + scoped approval system#18
MarcelRoozekrans merged 74 commits intomainfrom
fix/duplicate-notification

Conversation

@MarcelRoozekrans
Copy link
Copy Markdown
Contributor

@MarcelRoozekrans MarcelRoozekrans commented Mar 23, 2026

Summary

  • Add 5 new AI tools: write_file, delete_file, run_terminal_command, list_directory, create_directory — bringing Lucent Code to feature parity with Cursor/Copilot/Cline
  • Add read_file tool with start/end line pagination for large files
  • Add scoped approval system for destructive tools: Deny / Once / This workspace / Always — persisted to .lucent/config.json or ~/.lucent/config.json
  • Fix: tab × close button leaving old chat messages visible
  • Fix: no tabs showing for newly created conversations
  • Fix: AI returning 400 error when asked to read local files (now uses read_file tool)

Test Plan

  • Ask the AI to create a new file — approval card appears with 4 buttons; clicking "Once" lets it proceed and re-prompts next session
  • Click "This workspace" — subsequent calls to the same tool in the same project skip the approval card
  • Click "Always" — same tool is auto-approved globally across all projects
  • Enable autonomous mode (⊙) — destructive tools run without prompting
  • Ask the AI to read a large file — content is returned in pages with a continuation hint
  • Close a conversation tab via × — new chat starts with empty messages (no old content reappears)
  • Send a message in a new chat — tab appears immediately in the tab bar
  • Run npm test — 426/426 tests pass

🤖 Generated with Claude Code

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 23, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
lucent-code 3aeebef Commit Preview URL

Branch Preview URL
Mar 25 2026, 10:35 AM

@MarcelRoozekrans MarcelRoozekrans changed the title fix: OAuth callback path, app name, status bar alignment feat: missing tools + scoped approval system Mar 23, 2026
@MarcelRoozekrans MarcelRoozekrans force-pushed the fix/duplicate-notification branch from 2be7159 to 40a2aa3 Compare March 25, 2026 09:51
MarcelRoozekrans and others added 27 commits March 25, 2026 11:21
…us bar to right

- Use startsWith('/oauth-callback') to handle VS Code windowId suffix
- Add app_name: 'Lucent Code' to OAuth authorization URL
- Log response body on token exchange failure for better debugging
- Move auth/skills/indexer status bar items to right alignment
- Remove scm/inputBox menu contribution to avoid proposed API error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mmands, improve UX

- Remove code_challenge/code_verifier — OpenRouter returns 400 Invalid code_challenge_method
- Remove Set API Key and Sign Out from command palette, keep only Manage Authentication
- Notification for missing API key: info instead of error, OAuth as primary action
- Move status bar items to right alignment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements session, workspace (.lucent/config.json), and global (~/.lucent/config.json) approval
scopes with deduplication and .gitignore management.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…directory, create_directory

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- readFile: replace inline path-resolution with resolveUri helper, keeping the no-workspace guard
for relative paths
- listDirectory: use vscode.FileType.Directory bitmask check instead of magic number 2 (fixes
symlinked dirs)
- writeFile: report actual encoded byte count via TextEncoder instead of content.length
- runTerminalCommand: rename SETTLE_MS to TERMINAL_SETTLE_MS and update tool description to reflect
8-second wait with potentially incomplete output
- Add describe blocks for read_file and run_terminal_command with full test coverage (fake timers
used for terminal tests)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the 2-button Allow/Deny layout with Deny / Once / This workspace / Always, wiring
ApprovalScope through onRespond, the tool-approval custom event, resolveToolApproval, and
postMessage to the extension host.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… type, add scope tests

- Rename CSS modifier classes on approval buttons: --once→--allow, --workspace→--allow-workspace,
--always→--allow-global
- Add ApprovalScope type to src/shared/types.ts and use it in toolApprovalResponse
- Remove duplicate local ApprovalScope in ToolCallCard.tsx; re-export it from @shared
- Update chat.ts resolveToolApproval signature to use shared ApprovalScope
- Add three scope-persistence tests to message-handler.test.ts covering workspace, global, and
once/absent scopes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MarcelRoozekrans and others added 25 commits March 25, 2026 11:21
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ersation history

Adds a /compact skill that intercepts the send handler, makes a non-streaming summarization call,
replaces conversationMessages with a compact summary, and posts a visual compaction divider into the
webview message list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use `satisfies ChatMessage` in handleConversationCompacted and access
`props.message.isCompactionDivider` directly since the property is
already declared on the ChatMessage interface.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Narrows string|ContentPart[] assignment in compactConversation, removes
invalid id/timestamp fields from the divider ChatMessage, guards compact
dispatch behind a model-selection check, and adds a history-replacement
assertion to the compact happy-path test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…injection

Implements @file mention picker that lists workspace files via extension host,
reads selected file content, and injects it as a text attachment into the chat.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e file search

- Detect binary files via null-byte probe in readFileForAttachment and return a typed error instead
of silently corrupting the content
- Route fileAttachment errors to a new pendingFileAttachmentError signal and surface them as error
chips in ChatInput, matching the existing oversized-file UX
- Replace case-sensitive glob in listFiles with a fetch-500-then-JS-filter approach for reliable
case-insensitive substring matching on all platforms

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ent dedup

- Use bytes.subarray() instead of new Uint8Array(bytes.buffer, ...) for binary probe to correctly
handle pooled buffer views
- Use path.relative() + normalize separators to '/' instead of fragile String.replace for listFiles
path stripping
- Move listFiles and readFileForAttachment describe blocks out of compactConversation nesting — each
is now a top-level describe with its own beforeEach setup
- Fix attachment deduplication in ChatInput to check both name and data content, not just name

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add CSS for .compaction-divider, __label, __summary
- Update docs/features.md: @file mention, /compact command, 10 built-in skills, drop @test reference

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove unreachable case 'test' from handleResolveMention in App.tsx
- Add tests for binary file rejection and 5 MB limit in readFileForAttachment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers site architecture (docs-site/ at repo root), Docusaurus 3.x
setup, brand token mapping from marketing design system, full content
outline for user guide and developer reference, and Cloudflare Pages
deployment config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8-task plan covering: Docusaurus scaffold, brand styling, home page,
all 7 user guide pages (full content), all 6 developer reference pages
(full content), and Cloudflare Pages deployment config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy icon SVG to static/img, add custom.css with IFM token overrides
(dark-navy background, indigo/purple/cyan palette, Syne+DM Sans fonts),
and create the index.tsx home page with gradient hero layout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… items

- Add collapsible section headers for non-builtin skill groups (claude,
  github, npm, etc.) with a chevron toggle and item count badge
- Default the claude group to collapsed to keep the dropdown compact
- Indent items under collapsible groups for visual hierarchy
- Add max-height + scroll to the skills dropdown so it never overflows
- Sort skills alphabetically within each non-builtin group

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Component renders "Smart skills" not "Skills system" — test was stale
after the feature card copy was updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MarcelRoozekrans MarcelRoozekrans force-pushed the fix/duplicate-notification branch from 3eba256 to 14a6100 Compare March 25, 2026 10:22
MarcelRoozekrans and others added 2 commits March 25, 2026 11:26
- Revert notifications.ts to use lucentCode.startOAuth instead of
  lucentCode.authMenu — wrong command was introduced during refactor
- Add scheme: 'file' to uri mocks in context-builder.test.ts to match
  the uri.scheme guard added to ContextBuilder.buildContext()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… files

Missing .md files referenced by builtin/index.ts — fixes build error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MarcelRoozekrans MarcelRoozekrans merged commit 26489aa into main Mar 25, 2026
3 checks passed
@MarcelRoozekrans MarcelRoozekrans deleted the fix/duplicate-notification branch March 26, 2026 19:22
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.

1 participant