[Bug] Anthropic API Error: Usage Policy Violation on LayerCanvasView Query

Resolved ๐Ÿ’ฌ 3 comments Opened Nov 14, 2025 by macOS26 Closed Jan 13, 2026

Bug Description

NOPE ๐Ÿ”ท Spatial index rebuild: 16.4ms for 1 layer(s), 1825 total objects

LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[0]: rendering 1 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[1]: rendering 1 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[2]: rendering 2 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[3]: rendering 71 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[4]: rendering 194 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[5]: rendering 670 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[6]: rendering 195 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[7]: rendering 175 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[8]: rendering 25 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[9]: rendering 65 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[10]: rendering 44 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[12]: rendering 254 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[13]: rendering 27 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[14]: rendering 92 objects
LayerCanvasView: @self changed.
๐Ÿ“Š LayerCanvasView Layer[15]: rendering 9 objects

โบ The issue is that LayerCanvasView has selectedObjectIDs as a parameter in its Equatable implementation, so when that changes, ALL LayerCanvasView instances see themselves as changed even though we're triggering layer-specific updates.

Let me check how LayerCanvasView is receiving selectedObjectIDs:

โบ Read(logos inkpen.io/Views/DrawingCanvas/UnifiedObjectView.swift)
โŽฟ ย Read 60 lines
โŽฟ ย Interrupted ยท What should Claude do instead?

also the last layer here is the first layer, Layer 1.. the selection is on that layer[Image #1]

โŽฟ API Error: Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code to assist with a different task. If
you are seeing this refusal repeatedly, try running /model claude-sonnet-4-20250514 to switch models.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.0.37
  • Feedback ID: d5c2c96e-8851-4d68-9834-6040da2d6c4a

Errors

[{"error":"Error: 500 {\"type\":\"error\",\"error\":{\"type\":\"api_error\",\"message\":\"Internal server error\"},\"request_id\":null}\n    at $4.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:231:83308)\n    at q_.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:716:2117)\n    at q_.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:716:5341)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Qs2.xnA.model (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3534:15306)\n    at async xnA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1833:39781)\n    at async Qs2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3534:15460)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3534:8933\n    at async w00 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3534:1970)\n    at async S8A (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3534:8903)","timestamp":"2025-11-14T00:10:40.245Z"},{"error":"Error: 500 {\"type\":\"error\",\"error\":{\"type\":\"api_error\",\"message\":\"Internal server error\"},\"request_id\":null}\n    at $4.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:231:83308)\n    at q_.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:716:2117)\n    at q_.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:716:5341)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Qs2.xnA.model (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3534:15306)\n    at async xnA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1833:39781)\n    at async Qs2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3534:15460)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3534:8933\n    at async w00 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3534:1970)\n    at async S8A (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3534:8903)","timestamp":"2025-11-14T00:10:50.895Z"},{"error":"Error: Language not supported while highlighting 

Note: Error logs were truncated.

View original on GitHub โ†—

This issue has 3 comments on GitHub. Read the full discussion on GitHub โ†—