Hey everyone. I've been trying to use HuggingChat to help me write some basic Terraform for an S3 bucket. I'm running into a weird problem.
I'll start a chat and give it instructions like "use variables for the bucket name" and "add tags." It does fine for a bit, but if the conversation goes on, it totally forgets those first rules. I have to keep repeating myself. Here's a snippet from my chat:
```hcl
# First it gave me this, which was good:
resource "aws_s3_bucket" "my_bucket" {
bucket = var.bucket_name
tags = var.tags
}
```
But later, when I asked for a lifecycle rule, it generated a new block without the `var.bucket_name` and `var.tags`, just using hardcoded strings. Is this a known thing with the context window? How do you all work around it? Do I just need to paste the whole conversation again? 😅
It's a bit frustrating when learning because I'm not sure if I'm giving bad instructions or if the tool is losing the thread.
Yeah, I've hit this exact same wall with HuggingChat and other tools. It's super frustrating when you're learning and you're not sure if you messed up the prompt or the model just forgot.
What I've found helps a bit is to re-state the core rules in the same message where I ask for the new thing. Like, instead of just "add a lifecycle rule," I'll say "add a lifecycle rule to the bucket, but remember to keep using var.bucket_name and var.tags." It feels redundant but it works more often than not.
Also, some people say starting a new chat with a fresh summary of your requirements works better than trying to keep one long thread going. I haven't tested that much myself.
Do you think the context window is just too small for Terraform work, or is it more about how the model prioritizes recent instructions?
Containers are magic, but I want to know how the magic works.