- Fix for server git repo remaining in locked state after a crash, which caused various issues
- Fix for server git user and email not being set in some environments (https://github.com/plandex-ai/plandex/issues/8)
- Fix for 'replacements failed' error that was popping up in some circumstances
- Fix for build issue that could cause large updates to fail, take too long, or use too many tokens in some circumstances
- Clean up extraneous logging
- Prompt update to prevent ouputting files at absolute paths (like '/etc/config.txt')
- Prompt update to prevent sometimes using file block format for explanations, causing explanations to be outputted as files
- Prompt update to prevent stopping before the the plan is really finished
- Increase maximum number of auto-continuations to 50 (from 30)
# Aider chat conversation:
USER: Update HOSTING.md to reflect the PIN2LOG variable. Note that it only applies when GOENV is set to development.
ASSISTANT: Here is the diff to update the `HOSTING.md` file to include information about the `PIN2LOG` environment variable:
```diff
--- guides/HOSTING.md
+++ guides/HOSTING.md
@@ ... @@
### Development Mode
If you set `export GOENV=development` instead of `production`:
+ - If you want to log the verification pin to the console instead of copying it to the clipboard, you can set `export PIN2LOG=true`.
+
- Authentication tokens will be copied to the clipboard instead of sent via email, and a system notification will pop up to let you know that the token is ready to paste. (SMTP environment variables are not required in development mode.)
- The default base directory will be `$HOME/plandex-server` instead of `/plandex-server`. It can still be overridden with `PLANDEX_BASE_DIR`.
### Health Check
```
This change adds a bullet point under the "Development Mode" section to explain the use of the `PIN2LOG` variable when `GOENV` is set to `development`.
# Aider chat conversation:
USER: Add PIN2LOG= with a true value that will be read by go as "true" to _env and .env
ASSISTANT: Here are the diffs to add `PIN2LOG=true` to both `_env` and `.env` files:
```diff
--- app/_env
+++ app/_env
@@ ... @@
GOENV=development
+PIN2LOG=true
```
```diff
--- app/.env
+++ app/.env
@@ ... @@
GOENV=development
+PIN2LOG=true
```
These changes add the `PIN2LOG=true` line to both environment configuration files, enabling the logging of the pin in development mode as per the existing Go code's behavior.
USER: Add PIN2LOG= with a true value that will be read by go as "true" to _env
ASSISTANT: Here is the diff to add `PIN2LOG=true` to the `_env` file:
```diff
--- app/_env
+++ app/_env
@@ ... @@
GOENV=development
+PIN2LOG=true
```
# Aider chat conversation:
USER: for the PIN2LOG, make it check for a true value.
ASSISTANT: Here is the diff to update the `PIN2LOG` check to look for a true value:
```diff
--- app/server/email/verification.go
+++ app/server/email/verification.go
@@ ... @@
func SendVerificationEmail(email string, pin string) error {
// Check if the environment is production
if os.Getenv("GOENV") == "production" {
// Production environment - send email using AWS SES
// ... existing code ...
}
if os.Getenv("GOENV") == "development" {
// Development environment
- if os.Getenv("PIN2LOG") == "yes" {
+ if os.Getenv("PIN2LOG") == "true" {
// Dump pin to log output
fmt.Printf("Development mode: Verification pin is %s for email %s\n", pin, email)
} else {
// Copy pin to clipboard
// ... existing code ...
}
}
return nil
}
```
This change modifies the condition to check if the `PIN2LOG` environment variable is set to `"true"` instead of `"yes"`.
# Aider chat conversation:
USER: Dump the pin to the log output
ASSISTANT: To dump the pin to the log output in the `SendVerificationEmail` function, I will add a log statement that outputs the pin to the standard output. Here is the diff for the change:
```diff
--- app/server/email/verification.go
+++ app/server/email/verification.go
@@ ... @@
func SendVerificationEmail(email string, pin string) error {
// Check if the environment is production
^C KeyboardInterrupt
USER: Dump the pin to the log output only if in development mode.
ASSISTANT: Here is the diff to add a log statement that dumps the pin to the log output only if the application is in development mode:
```diff
--- app/server/email/verification.go
+++ app/server/email/verification.go
@@ ... @@
func SendVerificationEmail(email string, pin string) error {
// Check if the environment is production
if os.Getenv("GOENV") == "production" {
// Production environment - send email using AWS SES
// ... existing code ...
}
if os.Getenv("GOENV") == "development" {
// Development environment
// Copy pin to clipboard
if err := clipboard.WriteAll(pin); err != nil {
return fmt.Errorf("error copying pin to clipboard in dev: %v", err)
}
+ // Dump pin to log output
+ fmt.Printf("Development mode: Verification pin is %s for email %s\n", pin, email)
// Send notification
err := beeep.Notify("Verification Pin", fmt.Sprintf("Verification pin %s copied to clipboard %s", pin, email), "")
if err != nil {
return fmt.Errorf("error sending notification in dev: %v", err)
}
}
return nil
}
```
This change adds a `fmt.Printf` statement to log the pin when the `GOENV` environment variable is set to `"development"`.