Skip to content
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

Error on claudesync push #94

Closed
kodiex opened this issue Nov 28, 2024 · 2 comments · Fixed by #96
Closed

Error on claudesync push #94

kodiex opened this issue Nov 28, 2024 · 2 comments · Fixed by #96
Labels
bug Something isn't working

Comments

@kodiex
Copy link

kodiex commented Nov 28, 2024

Operating System

Windows11 WSL2

Python Version

3.10.1

ClaudeSync Version

0.6.4

Installation Type

New

Configuration

{
"active_organization_id": "4e3712b1-ea00-4de4-bd22-ede6fa466fe8",
"active_project_id": "4d4efde7-e91c-4d92-9540-55e6d202c06f",
"active_project_name": "PalantirClaude",
"active_provider": "claude.ai",
"claude_api_url": "https://api.claude.ai/api",
"compression_algorithm": "none",
"file_categories": {
"all_files": {
"description": "All files not ignored",
"patterns": [
""
]
},
"all_source_code": {
"description": "All source code files",
"patterns": [
"
.java",
".py",
"
.js",
".ts",
"
.c",
".cpp",
"
.h",
".hpp",
"
.go",
".rs"
]
},
"build_config": {
"description": "Build configuration files",
"patterns": [
"/pom.xml",
"
/build.gradle",
"/package.json",
"
/setup.py",
"/Cargo.toml",
"
/go.mod",
"/pyproject.toml",
"
/requirements.txt",
"**/
.tf",
"/*.yaml",
"
/.yml",
"**/
.properties"
]
},
"production_code": {
"description": "Production source code",
"patterns": [
"/src//.java",
"**/
.py",
"/*.js",
"
/.ts",
"**/
.vue"
]
},
"test_code": {
"description": "Test source code",
"patterns": [
"/test//.java",
"/tests//
.py",
"/test_*.py",
"
/Test.java"
]
},
"uberproject_java": {
"description": "Uberproject Java + Javascript",
"patterns": [
"/src//
.java",
"/*.py",
"
/.js",
"**/
.ts",
"/*.vue",
"
/pom.xml",
"/build.gradle",
"
/package.json",
"/setup.py",
"
/Cargo.toml",
"/go.mod",
"
/pyproject.toml",
"/requirements.txt",
"
/.tf",
"**/
.yaml",
"/*.yml",
"
/*.properties"
]
}
},
"local_path": "C:\PalantirProject\PalantirClaude",
"log_level": "INFO",
"max_file_size": 32768,
"prune_remote_files": true,
"submodule_detect_filenames": [
"pom.xml",
"build.gradle",
"package.json",
"setup.py",
"Cargo.toml",
"go.mod"
],
"two_way_sync": false,
"upload_delay": 0.5
}

Steps to Reproduce

create a project
claudesync push

Description

got an error on claudesync push

Logs

Traceback (most recent call last):
  File "/home/marco/tensorflow_env/bin/claudesync", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/click/decorators.py", line 45, in new_func
    return f(get_current_context().obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/claudesync/utils.py", line 263, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/claudesync/cli/main.py", line 157, in push
    sync_manager = SyncManager(provider, config, config.get_local_path())
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/claudesync/syncmanager.py", line 58, in __init__
    self.anthropic_client = Anthropic()
                            ^^^^^^^^^^^
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/anthropic/_client.py", line 122, in __init__
    super().__init__(
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/anthropic/_base_client.py", line 856, in __init__
    self._client = http_client or SyncHttpxClientWrapper(
                                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marco/tensorflow_env/lib/python3.12/site-packages/anthropic/_base_client.py", line 754, in __init__
    super().__init__(**kwargs)
TypeError: Client.__init__() got an unexpected keyword argument 'proxies'
@kodiex kodiex added the bug Something isn't working label Nov 28, 2024
@jahwag
Copy link
Owner

jahwag commented Nov 30, 2024

It seems you're encountering an issue with the Anthropic library used for token counting. This library relies on a deprecated approach, as Anthropic has transitioned to a paid API model.

As a workaround, you might consider upgrading to a more recent version of Python, which could help resolve compatibility issues.

@jahwag jahwag linked a pull request Nov 30, 2024 that will close this issue
@gabriel-henriq
Copy link

Instead of losing the pretty feature of counting the tokens we could use the tiktoken for counting the tokens.

tiktoken>=0.8.0

import tiktoken

self.tokenizer = tiktoken.get_encoding("cl100k_base")

def count_tokens_for_file(self, file_path):
    full_path = os.path.join(self.local_path, file_path)
    with open(full_path, "r", encoding="utf-8", errors="ignore") as file:
        content = file.read()
    token_count = len(self.tokenizer.encode(content))
    self.synced_files[file_path] = token_count

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants