bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 16쪽 중 14쪽
https://1034405018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcazOdplbOmP4R0T7sG8%2Fuploads%2FAO4yEX51A9Kaj6WjGa9T%2Fcodeassist_Terminal.png?alt=media&token=cd06594f-efda-42f6-a4c5-1bc6dc3139e2" alt=""><figcaption></figcaption></figure></div>
When the web UI loads, you'll see the **Login Modal.** 
<div data-with-frame="true"><figure><img src="https://1034405018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcazOdplbOmP4R0T7sG8%2Fuploads%2FadSCbc8JHlPqyy2rtemf%2Fcodeassist_login_modal.png?alt=media&token=692c7a03-7073-4b14-b37f-1ab8df45db3b" alt=""><figcaption></figcaption></figure></div>
Here, you can log in with email, or with Google. Logging in with email will send a one-time passcode (OTP) to your email. 
{% hint style="info" %}
Once you've logged in for the first time, a file called `persistent-data/auth/userKeyMap.json` will be generated, which stores your local credentials. 
{% endhint %}
#### Selecting a Problem
From the **Problems Sidebar** on the left-hand side, you can choose **Easy, Medium** or **Hard** problems. 
By default, you will have landed on a randomly-selected problem. 
If you want to change your problem, you can select the difficulty level from the dropdown to be assigned a new problem in that difficulty, or click the **Shuffle** button to get a *new* problem within your selected difficulty. 
<div data-with-frame="true"><figure><img src="https://1034405018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcazOdplbOmP4R0T7sG8%2Fuploads%2F25VZML0KMXlfDuOUNWvO%2Fcodeassist_selecting_different_problems.gif?alt=media&token=8f2b8927-1278-48a0-8179-758957e02fbd" alt=""><figcaption></figcaption></figure></div>
### Recording an Episode
Every time you run the launch command and open up CodeAssist in your browser, CodeAssist begins **recording an episode.** 
Each click, keyboard stroke, edit, acceptance, or deletion is logged as training feedback. 
> This is how the model trains once recording is finished: it examines *every action you took,* then trains in an attempt to emulate *you.* 
In that light, it is extremely important to work with the assistant patiently. Finishing solutions to LeetCode problems too quickly, or deleting everything the assistant adds to the `.txt` file immediately post-generation can neutralizing effects on the efficacy of that episode's training. 
{% hint style="danger" %}
In other words, rushing the model and aggressively correcting won't give it the chance to learn. 
{% endhint %}
### Coding with CodeAssist
When you stop typing, CodeAssist may begin typing for you. It doesn’t ask for confirmation. Instead, it acts directly in your file.
<div data-with-frame="true"><figure><img src="https://1034405018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcazOdplbOmP4R0T7sG8%2Fuploads%2FeMuEcTTvyZN60YUojn5x%2Fcodeassist_correct_code_insertion.gif?alt=media&token=280fdd76-61ee-4c44-811b-021463ccc62e" alt=""><figcaption></figcaption></figure></div>
At this point, when the assistant has generated code or made changes, you can:
* Let its code stay
* Edit or refine its generation
* Delete entire lines
* Rearrange code or fix indentation
Each of these choices then becomes a training signal post-recording. 
#### Rewards & Timing
| Your Action | Interpreted Signal |
| -------------------------------------- | -------------------------- |
| Leave the assistant's code untouched | *Positive* reward |
| Edit it after a short delay | *Moderate* positive reward |
| Delete it after working around it | *Mild* negative reward |
| Delete it immediately after it appears | *Harsh* negative penalty |
If you delete everything it writes right away, you’re essentially teaching it to stop acting altogether.
{% hint style="warning" %}
Sometimes it’s better to let a generation live briefly, let it try one more move, and then delete or fix it to teach *gradual correction* and not *total rejection.*
{% endhint %}
#### Pausing
You can press `shift + space` or click the **Pause Assistant** button to temporarily stop the assistant. Typing anything (or even a space or cursor click) after pausing will **unpause it.** 
<div data-with-frame="true"><figure><img src="https://1034405018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcazOdplbOmP4R0T7sG8%2Fuploads%2F74AdDF56xEO9xlxC6JM1%2Fcodeassist_pausing_assistance.gif?alt=media&token=5e0c9d2a-4372-4c0a-a45b-b0f8c0acb0c7" alt=""><figcaption></figcaption></figure></div>
#### No-Ops
When the assistant produces a **No-Op**, as in it does *nothing,* it's waiting for you. This is intentional. **No-Op** means the assistant is not confident enough to act. Make an an edit or press a key to resume.
{% hint style="info" %}
This is not a bug, it's a feature signaling that it's *your turn.* 
{% endhint %}
#### Cursor Awareness
CodeAssist inserts code relative to your current cursor position. If your cursor sits at the bottom of the file and isn’t indented, new code may appear misaligned.
Keep your cursor near the section you’re working on. If something looks misplaced, re-indent with `tab` and `shift tab` or move your cursor before letting the assistant act.
#### Context 
Each LeetCode problem has the actual written problem on the left side, with the text field on the right. 
There's also a starter function. However, the starter function and imports are *masked* (read-only) to prevent the assistant from editing them.
<div data-with-frame="true"><figure><img src="https://1034405018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcazOdplbOmP4R0T7sG8%2Fuploads%2Fb76XWJbZycoE0W8Gxedn%2Fcodeassist_default_view.png?alt=media&token=1e180451-ef00-4061-a980-326905c14ed9" alt=""><figcaption></figcaption></figure></div>
If you want to modify those lines, make a small manual edit, even a space, to unlock them.
{% hint style="warning" %}
Unlocking (unmasking) the initial solution shell *will* open up that starting function to the assistant, which means it will gain context to the problem's solution, but can also change that starter function. 
{% endhint %}
#### Keyboard Shortcuts & Controls
If you're relatively new to coding, there are several common keyboard shortcuts and controls commonly used when editing code in development tools that are handy to learn.
| Action | Shortcut |
| ------------------------------ | -------------------------- |
| Pause / Resume | `shift + space` |
| Undo | `ctrl/command + z` |
| Redo | `ctrl/command + shift + z` |
| Indent / Outdent selected code | `tab / shift + tab` |
| Stop recording (end episode) | `ctrl + c` |
#### Testing your Solution
When you're ready to test your code, click **Submit Solution.** 
* If your solution is incorrect, you will see a modal pop up that prompts you to return to the problem and try again. 
Then, you will also see the **Test Case** section, which is a solution tester, containing **Tests Passed, Error(s) Found In Case,** and **Cases Pending** section. 
This is a standardized solution tester which will contain `input`, `stdout`, and `output`, expected results, and any relevant errors (such as tracebacks) including the line the error was found on.
* If your solution is correct, you will be prompted with a different modal to return the problem *or* proceed to a new one. Congratulations!
{% columns %}
{% column %}
<figure><img src="https://1034405018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcazOdplbOmP4R0T7sG8%2Fuploads%2FxRcxPeqfed77Eewc3R8O%2Fcodeassist_problem_not_solved.png?alt=media&token=973270d8-4326-4221-aaf3-517b3ce147ab" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% column %}
<figure><img src="https://1034405018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcazOdplbOmP4R0T7sG8%2Fuploads%2FtATjDQSjz15boxXQCcOP%2Fcodeassist_problem_solved_successfully.png?alt=media&token=3130b811-5a3f-4a37-8ebd-30516218cbca" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}
### Completing an Episode & Training your Model
Once you're done coding, you can complete the episode recording and train the model. To do this, return to your terminal (or IDE, if running CodeAssist from within a developer tool like Cursor or VS Code) and input `ctrl + c`. 
{% hint style="success" %}
You do **not** need to successfully solve a LeetCode problem to train the model. At any point, once the CodeAssist web UI is running in your browser, you can stop training with `ctrl + c`. 
{% endhint %}
During training, CodeAssist will:
* Compare your edits to the assistants actions
* Calculate rewards and penalties based on your reaction to the assistant's code generations 
* Updates your local model checkpoint
* Take a few minutes (depending on your system specifications) and store new model weights under `~/.codeassist/models`
* Upload your trained model to Hugging Face [using your previously-set Hugging Face token](/testnet/codeassist/hugging-face-guide)
<div data-with-frame="true"><figure><img src="https://1034405018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcazOdplbOmP4R0T7sG8%2Fuploads%2FFqFefR6yswAr4Qpm3N1u%2Fcodeassist_successful_training_session.gif?alt=media&token=1f33aad3-de09-4ea6-abef-c09b463e06e6" alt=""><figcaption></figcaption></figure></div>
At this point, you can <mark style="color:$success;">restart CodeAssist to use your updated model</mark> trained on your most recent episode. 
### Best Practices for Effective Training
Every user starts with a pre-trained baseline model tuned to generic behavior. As such, your first few episodes may feel inconsistent. This is normal.
#### Expectations
Early on, the model may feel 'too quiet' or 'too confident.' After 1-2 training runs, the model's performance can also *regress* as it begins calibrating to your coding habits. 
Improvement becomes more and more clear after a minimum of **4-5 episodes of training.** 
{% columns %}
{% column %}
#### Do
* Treat CodeAssist as a collaborator, not an agent or an autocomplete tool. 
* Keep coding normally and let it naturally interject code. 
* Reward 'good enough' behavior by keeping useful code around for a minute before editing or removing. 
* Relax! This is *experimental research,* not an interview environment. 
* Record multiple varied problems to diversify its learning signals. 
{% endcolumn %}
{% column %}
#### Don't 
* Expect it to solve problems end-to-end. 
* Delete every generation instantly, even if its wrong, as this will encourage 'passivity.'
* Sit back and wait for it to code everything for you. 
* Panic when it begins typing unexpectedly or indenting pieces of code. Give it a moment to figure things out and patiently guide it towards outputting code that you want!
{% endcolumn %}
{% endcolumns %}
### Iterating & Improving
After you've finished training, you can restart and rerun CodeAssist using the command below:
```bash
uv run run.py
```
This will reopen the web UI, and you can select a new problem and begin coding again. 
At this point, especially after 4-5 training runs, notice subtle changes in how CodeAssist acts: timing, confidence, where it chooses the help, how much code it generates and where, and especially any stylistic peculiarities it has when generating code comments. 
Continue recording and training to refine your assistant over time!
***
### Next Steps
CodeAssist is designed to explore what *personalized assistance learning* looks like, and a machine learning (ML) model that adapts to individuals through the curation of a 'dataset' containing one user's training data, not a general, globally-available dataset. 
Visit the [Troubleshooting](/testnet/codeassist/troubleshooting) page if you're having any issues with running or installing CodeAssist, setting up dependencies (like Docker) or running into problems training your model.
{% hint style="success" %}
If you need additional support, you can [open a ticket](https://github.com/gensyn-ai/codeassist/issues) or [visit our Discord.](https://discord.com/invite/gensyn)
{% endhint %}
# Hugging Face Guide
Follow this quick tutorial to sign up for Hugging Face and generate a private token for use with CodeAssist.
## Getting Tokens for CodeAssist
CodeAssist uses Hugging Face to securely host and share AI models, linking them to your Gensyn Testnet account. Hugging Face ensures models are accessible, auditable, and reusable within the AI ecosystem.
#### Step 1 — Sign Up 
Go to [Hugging Face](https://huggingface.co/login) and click **Sign Up** in the top right to create a free account. 
* You can sign up with email/password, or through Google or GitHub
* Already have an account? Click **Sign In.** 
{% hint style="success" %}
If you have trouble signing up, try a different browser or disable ad blockers.
{% endhint %}
#### Step 3 — Verify your Email (required)
After signing up, check your inbox for a Hugging Face verification email. Then, click the link in the email to verify your address.
This step is required before you can create tokens or upload anything.
{% hint style="warning" %}
Can't find it? Check your spam folder. or log in and click **“Resend Verification”.**
{% endhint %}
#### Step 3 — Generate a New Access Token
This token allows the game to upload a model to your Hugging Face account.
1. Once signed in, click your **profile icon** (top right corner).
2. Select **“Access Tokens”** from the dropdown.
3. Click **“New token”.**
* **Name:** something like “CodeAssist”.
* **Role:** choose **Write.**
4. Click **“Create”.**
5. **Copy the token immediately,** as you won’t be able to see it again.
{% hint style="info" %}
When prompted to paste the token, be aware that the token will be **invisible** when pasted, so you won't see it entered into the terminal. Simply paste, then hit `enter` (Windows/Linux) or `return` (macOS).
{% endhint %}
### Common Issues
Here's some common blockers and quick fixes if you encounter any problems regarding Hugging Face:
| Issue | Solution |
| ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Not seeing "Access Tokens" menu | Make sure you’re logged in and your email is verified. |
| Copied the token, but didn't save it | Delete the lost token and generate a new one. Be sure to save it! |
| 403 Client Error: Forbidden | Your token might not have *Write* permissions, or may have expired. Generate a new token with Write access. |
| Uploaded model doesn't appear on Hugging Face | Refresh your Hugging Face profile and check under Repositories → Models and confirm you’re logged into the same Hugging Face account that owns the token. |
| Multiple tokens created, not sure which is active | Delete unused tokens in Settings → Access Tokens. Keep only the one you use for CodeAssist to avoid confusion. |
### Using your New Token with CodeAssist
You're ready to go! 
Paste your token during CodeAssist setup, [which you can read about here](/testnet/blockassist/using-blockassist), and start training models and contributing to the Gensyn Testnet. 
{% hint style="success" %}
If you need additional support, you can [open a ticket](https://github.com/gensyn-ai/codeassist/issues) or [visit our Discord.](https://discord.com/invite/gensyn) 
{% endhint %}
# Troubleshooting
Stuck? Get unblocked with CodeAssist on Windows (WSL 2), Linux, or macOS, or reach out to support for more help.
## Overview
This page helps you diagnose and resolve common issues encountered while running or using CodeAssist. It covers both runtime behaviors (inside the CodeAssist UI) and system errors (Docker or environment-related).
### Environment & Docker Errors
These issues occur before or during CodeAssist startup.
#### Exception: Container is unhealthy
This can occur when a Docker container fails to start properly. 
1. Check container logs:
```bash
docker logs <container-name>
```
2. Review the output for startup errors. 
3. Restart Docker and rerun CodeAssist:
```bash
sudo systelctl restart docker
uv run run.py
```
#### Error connecting to Docker daemon
If Docker isn't running, or your user lacks permission to access it, you may encounter an error that looks much like this one:
```bash
2025-09-04 15:03:47,975 - ERROR - Error connecting to Docker daemon:
Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
2025-09-04 15:03:47,976 - ERROR - Please ensure Docker is installed and running.
```
1. Ensure Docker desktop (macOS and Windows) or Docker Engine (Linux) is open and running. 
2. You may need to restart Docker. If so, use this command:
```bash
sudo systemctl restart docker
```
3. Then, test your connection to Docker:
```bash
docker ps
```
4. If you still see the error, verify your user is in the `docker` group using this command:
```bash
sudo usermod -aG docker $USER
```
5. Log out and log back in.
{% hint style="info" %}
If CodeAssist crashes and Docker containers aren't shutting down correctly, use `docker stop $(docker ps -q)` to kill and restart all containers. 
{% endhint %}
#### Bind for 0.0.0.0:3000 failed: port is already allocated
This is a common issue you might experience if already running other Gensyn products, like [BlockAssist](/testnet/blockassist) or [RL Swarm.](/testnet/rl-swarm)
If a container, such as another Gensyn service, is already using `port:3000`, then the Docker containers will refuse to open. \
\
You have two options:
1. Stop the other service that is using the port (e.g., if you're running RL Swarm)
2. Run CodeAssist on a different port using the following `--port` argument:
```bash
uv run run.py --port 3001
```
When choosing a new port, please avoid `8000`, `8080`, `8001`, `8008`, `3003`, and `11434`, as they are reserved for other CodeAssist services.
{% hint style="info" %}
To check what containers are currently running, you can use the `docker ps` command or use the Docker Desktop UI. 
{% endhint %}
***
### Common Runtime Behaviors
These are expected or semi-expected quirks of the current CodeAssist prototype. They are **not necessarily bugs**, but knowing what they mean can save you time.
#### No-Ops (Assistant Stops Typing)
Sometimes, the assistant can enter a “no-operation” state. It’s unsure what to do next.
To fix this, simply move your cursor, add a space, or make any small edit. This resumes generation immediately.
{% hint style="info" %}
A **No-Op** is intentional. It signals when it is 'your turn.'
{% endhint %}
#### Broken Constraints in Problems
Some imported LeetCode problems include invalid or computationally infeasible test cases. You may encounter test cases that hang or never complete, and inputs that do not match the problem's listed constraints. 
{% hint style="danger" %}
This is due to the publicly-available, 3rd party LeetCode problem/solution dataset used within CodeAssist.
{% endhint %}
To fix this, choose a new problem from the sidebar and continue training. The issue is dataset-specific, not user-specific. 
#### "Wandering" Behavior
Rarely, the assistant will overwrite the starter function or switch to solving a different problem. 
To fix this:
1. Pause with `shift + space` or the UI button
2. Save your work by copying & pasting it elsewhere (if needed)
3. Restart CodeAssist (`ctrl + c`) then rerun with `uv run run.py`
#### Non-Linear Learning
After your first or second training run, performance may actually *degrade* before it shows signs of improvement. 프로젝트로 돌아가기