-
Notifications
You must be signed in to change notification settings - Fork 575
Feature: Add Gemini and Z.ai (GLM) usage tracking. Improve task recovery and remove unused variables #773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Add Gemini and Z.ai (GLM) usage tracking. Improve task recovery and remove unused variables #773
Changes from all commits
7765a12
7d5bc72
ac2e8cf
bea26a6
8bb1063
de021f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -69,6 +69,7 @@ interface CursorToolHandler<TArgs = unknown, TResult = unknown> { | |||||||||||||
| * Registry of Cursor tool handlers | ||||||||||||||
| * Each handler knows how to normalize its specific tool call type | ||||||||||||||
| */ | ||||||||||||||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any -- handler registry stores heterogeneous tool type parameters | ||||||||||||||
| const CURSOR_TOOL_HANDLERS: Record<string, CursorToolHandler<any, any>> = { | ||||||||||||||
| readToolCall: { | ||||||||||||||
| name: 'Read', | ||||||||||||||
|
|
@@ -878,7 +879,7 @@ export class CursorProvider extends CliProvider { | |||||||||||||
| logger.debug(`CursorProvider.executeQuery called with model: "${options.model}"`); | ||||||||||||||
|
|
||||||||||||||
| // Get effective permissions for this project | ||||||||||||||
| const effectivePermissions = await getEffectivePermissions(options.cwd || process.cwd()); | ||||||||||||||
| await getEffectivePermissions(options.cwd || process.cwd()); | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dead I/O —
The variable was removed as "unused", but that points to one of two problems:
🐛 Option A — remove the dead call (if permissions are not yet implemented)- // Get effective permissions for this project
- await getEffectivePermissions(options.cwd || process.cwd());
-
// Debug: log raw events when AUTOMAKER_DEBUG_RAW_OUTPUT is enabledAlso remove the -import { getEffectivePermissions } from '../services/cursor-config-service.js';🛡️ Option B — wire up permissions enforcement (if this is the intended behaviour)- await getEffectivePermissions(options.cwd || process.cwd());
+ const permissions = await getEffectivePermissions(options.cwd || process.cwd());
+ if (permissions) {
+ // TODO: enforce permissions before spawning subprocess
+ // e.g. reject write/shell tool calls when not allowed
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| // Debug: log raw events when AUTOMAKER_DEBUG_RAW_OUTPUT is enabled | ||||||||||||||
| const debugRawEvents = | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: AutoMaker-Org/automaker
Length of output: 9614
🏁 Script executed:
Repository: AutoMaker-Org/automaker
Length of output: 49
🏁 Script executed:
Repository: AutoMaker-Org/automaker
Length of output: 1872
🏁 Script executed:
Repository: AutoMaker-Org/automaker
Length of output: 198
Export
CursorToolCallor move it to@automaker/typesThe
CursorToolCallinterface is used as a parameter type in two exported functions (checkToolCallPermissionandlogPermissionViolation) but is not itself exported. This creates an ergonomic gap: callers cannot explicitly annotate variables with the type without importing it, though TypeScript's structural typing allows passing compatible objects.More importantly, per coding guidelines ("Core TypeScript definitions with no dependencies should be isolated in the automaker/types package"), this interface should be defined in
@automaker/typesrather than locally. WhileCursorToolCallEventalready exists in the types package, the minimal shape defined here is specific to permission checking and should be extracted there and imported.Minimal fix: Export the interface in this file, then refactor to move it to
@automaker/typesand import it for consistency with project conventions.The all-optional design (allowing all three sub-call properties simultaneously) is not ideal semantically—a discriminated union would prevent invalid states—but behavior is currently correct due to priority-order checks in the implementation.
🤖 Prompt for AI Agents