2025-06-24 recall - session #6

Ben Fisher troubleshoots a synchronization daemon resending duplicate messages to Addio. The core issues: multiple processes restarting unexpectedly, deduplication failing due to timestamp and timezone problems, and API filters being misused (lastinteraction vs. interactedat). He requests code refactors, better logging, and deployment guidance for Docker and environment variables.
Chapters
Well, that was. That was. That was fun. I just restarted my computer to stop. So this was. Yeah, so I just went in and I disabled. Luckily, restarting my machine stopped the daemon from running and restarting. Although that also means that the code that was supposed to automatically launch it on login work. Although I think at one point among the many things I tried was removing that. So actually it might have just been. Maybe it didn't happen because we removed it. All right, so please commit those changes and adjust the changes related to disabling the auto restart. That was a mess. That. All right, now we need to investigate why it was sending the same emails over and over again. Not only was it not catching the deduplication, but it was. It looked like it was starting all over again over and over again going through the same emails. Take a inspect our logs can't tell. Is there a way to ensure that there's only one sync process running now? I say I don't know if there's a way to have it ensure there's only one process running. Man, why did it stop at 700 tokens? That was really annoying. Yeah, but they should have also already. Man, this is so obnoxious. But those messages had already been forwarded, so why was it still not detecting it within audio that they had already. The interactions already existed? Those shouldn't have been sent in the first place. They had already been sent many hours ago. I think you're looking at. Make sure you're normalizing the time zones because we should be looking at the time like it shouldn't matter because the time zones which should be normalized, but they should be con. All time zones should be converted using the same time zone because right now I'm in Pst my thoughts. Oh my God. This is really obnoxious. I don't know if that's. I don't think it's a critical issue because it's been fine up until now. No, that's not right. You're completely screwing this up, man. You should be looking at the timestamp of the text messages happening because that's also the same time that we're sending to Adios. And that time like so the timestamps should be for match not of the time we sent it, but of the time that the events happened, meaning the the time that the text message was received or sent. I feel like this is just. This is turning into a mess. This is not. This has been fine up until now. This might not be the most effective way of talking to an LLM it everything should be normalized around the timestamp of the message. What? Oh my God. The messages. Reader time conversion. How the heck me so confused. How? What are you telling me? You sure? I have very little confidence right now. I mean, you sure about that? That's bizarre. Seems unlikely. Okay, six, we're just gonna do. Man, none of these should. That's right. None of the things that just synced were new interactions. So I think you just messed up the time zone. Check. Check our logs. None of those are new interactions. All of those already existed on adio. I know for a fact. Jeez. How does that even happen? Oh my gosh. This is maddening. So now you at least get to participate in someone losing their mind with circular stupid problems that AI is making. That's not what. That's not true. Yes they are. It must mean that you're doing a wrong. Buddy. That's not true. Addie does in fact have a way for you to filter. I have provided you previously that documentation. It is perfectly documented. This is ridiculous. This is insane. This has previously been working fine. This is insane. I know for a fact this work. This doesn't seem. This was previously working. Earlier today it was correctly detecting duplicates. Please analyze the git history and see what changed because it previously was working fine. This is freaking ridiculous. I might need to take a break. It. No, it's not. And no. Adio is correctly showing it as the time stamp that's spoofed in the body of the email. I can see it. Ridiculous. Driving me insane. Yeah, I can see. I've confirmed that even when we were sending those duplicate emails, Adio is correctly attributing them to the date of the timestamp that we spoofed in what was forwarded. It's ridiculous. That makes no sense. That doesn't make any sense. The time zone should not. There should be no difference. There should be no inconsistency at all because we're using the exact time. We're. We're spoofing the exact times that the messages were received. There should be no discrepancy whatsoever. If there was a 1.2 second difference, what's that have to do with a 10 minute difference? How is there a 10 minute difference if you said it's a 1 second difference? 1 second difference makes sense. A 10 minute difference makes absolutely no sense. Where are you seeing a 10 minute difference? Gosh it. So you're saying it's providing a full list of all of the emails we got? If so, we need to have our own logic to parse through them to check the times rather than relying on Addio to filter them. That doesn't even make sense to me. It seems like Adeo should be fixing it, so it might be worth you investigating a bit further to see how we might be able to accurately use their filters because their API indicates there is a way to do. I think you're not supposed to provide a time zone if you look at their example. It's just. My guess is it's not expecting a string, it's expecting a date in that format and when you're including the time zone in the actual time, it's breaking it. If that's in fact what's going on, I'm going to lose my mind. I can't tell if this is because it's doing Sonnet or if it's in fact just stupid. Where's the line? What? What code? And what. How is this working before. Okay, proceed with fixing it. This is insane. I also have no idea where it's doing this. It must be. Oh no, it's right there. Interacting app does any of these posts not get? This is mind blowing. I don't really trust this. Again, that was really frustrating and kind of scary around. I don't. I didn't catch that change and it's when I went from using post to get at one point. Why did it that even happen? Jeez man. Why are we doing first and last? I guess it's looking for that time frame. How is that? 5:55. This makes no sense. All right, so we just ran one 1, 2, 3, 4, 5, 6. Seems like it's going circularly tested. There were nine that are synced. Let's see. 1, 2, 3, 4th, 5, 8. That's right. Analyze the logs. I'm concerned because the nine interactions that it synced had already been synced to Addio. I'm going to run it again just to see. This is not true. In fact I just ran this again and it again is saying this is a new interaction even though we just synced it a few minutes ago. So angry. 508, 555. Doesn't make sense. That doesn't make sense though. It's not right. That's not accurate. I'm looking at the emails list within Adio and it shows the timestamp of the email that we spoofed. Look at this. Try querying all of the messages from Bazak and see what the timestamps are it. This is driving me crazy man. This is Madden. Convert that to 303 that would be 7:03pm this is insane. I don't even think there are any 703 the. You mean 803. This is insane. Right? 803. 16 it generate a list of the email interactions with the timestamp and the subject lines and I don't even think there are any 703 the. You mean 803 and the first 20 characters of each message so that we can compare what you're comparing. What I want to see what emails you're saying or at what time. And we should be able to use this if we to query any person. I do feel like you get into situations like this where you start kind of spiraling it. 803. 16 it generate a list of the email interactions with the timestamp and the subject lines and the first 20 characters of each message so that we can compare what you're comparing what I want to see what emails you're saying or at what time. And we should be able to use this if we. To query any person. It. I do feel like getting to situations like this where you start kind of spiraling It. Those are from notes. It I'm just asking for all of the interaction data, not the notes. Query all of the interactions that are returned for that user. This is it. This is just showing first email interaction and last email interaction. I'm asking for all interactions. Shouldn't there be a. You're only showing me first and last. We'll only guess a list of all interactions if we want. If we do a search. Is there a way to use the search to get all interactions? This is insane. This. I think what's crazy too is it gives you this weird false sense of deduplication. System is working perfectly. It's absolutely not. None of this has been working perfectly, which is not surprising. But man, it. This is insane. I would have figured this out in two seconds if I was actually coding this. All right. So far to rethink this a bit. It doesn't actually necessarily matter that we track every text message. What matters more is have you recently communicated this person? In which case is the mess text message more than 30 minutes after the last message and maybe that's sufficient. We're not doing anything around LLMs parsing the meaning of the messages. But from a technical requirement perspective, this is very confusing because I could have sworn we had the sworn. Okay. I'm confused though because this documentation indicates there's filtering abilities. So try passing a filter here for interactions. Let's Try these docks are really bad it Here are the docs and make sure you do in the correct ISO format. What we want to test is using this timestamp and seeing if we can get what when we use this as the filter or as the interacted app. Try greater than and see what comes up as as an as a solution is an answer response. Can't even talk anymore. This is an example where I want to start using the API now. Sonic. Guess what I should have done? Just use the freaking API and stop using the max. This is infuriating. It. That's not. I wish it would just shut up. Wait. People with last interaction. Aren't you doing it for a specific. What in the actual hell It. This is a mess. All right. We're modifying our logic here. I don't know how this happened and I swear this was working earlier. I. I'm honestly. All right. We're changing our strategy here. We're gonna get. We're only going to create the last interaction at for the person. Wait. Let me just find this here. Are you saying the only way to use the interaction API where we're providing a filter for the time that we interacted is it doesn't let you specify the person that we're looking at interactions for. You can just provide the time filter and it won't let you specify also the person. That doesn't seem right. But that was also not obvious. That's what they're saying. That doesn't make sense. No. It says last email. I'm asking you how are you using the API? Aren't you? When you're doing the filter for last interaction, are you also providing the person id? This is insane. This is insane. I can't believe we're having this conversation right now. Dude. We had this from the beginning. What are you doing? Yes. Do you not currently have this implemented? Watch out. I'm going to start swearing at it. This is insane. You found the solution. You created the problem. This is insane. This is not. I. How do I test this? Update our query person's emails script to use the filter that enables us to provide a timestamp property to filter the interaction at date. And I want you to do this for Zach. We're just going to statically test this and I'm going to try some different pass some different dates and you're going to output what the results are. This is insane. And to be clear, you're going to be using the person query as well as the interaction at filter where we can specify a time and we'll do greater than or equals to. This does not prove anything. Provide me the script to run myself the command. Sam. I understand it. 30639 maybe it's only looking at the last time they were active. So maybe it's looking at only people whose last interaction was in that time frame. This is insane. Actually, I guess I could try. I'll save that. But that's. No, you just. You just contradicted message. Oh my God. You're filtering last interaction. You know the time Fin, how do I filter? I also think that I'm so confused. Yeah, that's looking at la only last interaction. So. So this is not going to work. So the only. If you want to do every action interaction it has to be through notes so we don't have to rethink this. All right, so don't simplify. All right. There was a misunderstanding how their API works. So we need to make a modification where we will only. Okay, new update for every person whose message we analyze. Okay, I'm sure this down. We are going to make an adjustment to our logic of which events we send to Addio. Here's the new logic. Okay. We run a query that looks for messages created in X minutes. We loop through every message. We figure out who they are. We figure out who the. We identify who the contact is. We query Addio and find the last interactedat date. That was painful and much simpler. I'm also scared about a lot of stuff. My God, that was bad. I mean we could still accomplish the original intent of what I was going to do around every message, but we would do that through notes. Man, that was painful. Great. That is one the challenges of this is sometimes you won't read the documentation or API docs as closely. Like if I had been implementing this, I probably would have caught the nuance of the. I would have caught the nuance of that where it's filters first interaction. Or you could do less interaction and then within that is interacted at. I was focused on interacted at in the filter in that I was overlooking the property that was above it. So that was stupid. That was on my. That was my fault. Still annoying. But. But yeah, that's on me, man. Okay. Doesn't make sense. That doesn't make sense. We'll still do a 10 minute threshold because I'm positive only sync it if the new message is more than 30 minutes after. I mean I could even do only sync it if the new message is at least an hour after or is at least 10 minutes after the last one. There we go. That'll be fine. For testing purposes. That was painful. No, the amount of time should be a constant variable. It should not be hard coded. It should be a environment variable that I guess one question I have is does it make sense have as an environment variable or just a constant set within the class? Let's do it as a constant set in the class or set within the index js Basically we want to set the constant at the root of the project where all of our constants will be. Jesus, that was confusing. Oh my God. I can't believe this is happening. Are there analyze our code? Is there any other properties that should be refactored to be constants like that? Jesus. Analyze our JavaScript code. There you go. That's right. For those constants please define succinctly as a comment what it controls. If it's not obvious like I'm not sure what it means by sync hours or whatnot, Please have very succinct explanations of what each constant represents. Like I don't know what core date to epoch means actually actually do but that was really painful. Who did it just sync analyze the logs what were the messages that we just sank? Actually I can just check emails that were just sent Jesus, this is really annoying infuriating it and now my monitor's not working great. This is insane. This is not good. 8:30 why did we just send this message? It says from null that shouldn't happen right? So if we don't have an email address for the person in my contacts should make a log of it and skip them right? This should be added to our validation Also also we just sent one that check to see the most recent what was the most was the last email interaction date for D because we had already synced the 8:30pm text message it have you recently communicated this person in which case is the mess text message more than 30 minutes after the last message and maybe that's it. Yeah pretty something does not seem to be to lead a no does not seem to be in the no sufficient we're not doing anything around LLMs parsing the meaning of the messages but from a technical requirement perspective this is very confusing because I could have sworn we had not seem to be deleting it. Well regardless it says 32 notes CME that's 31 notes 30 notes it is showing the number of notes changing I just don't see it 26 I get wise because these are all the same freaking note. It's funny the sworn very confusing funny just an Example where I'm doing stuff like this, I'm just gonna do a little clicky click. And yeah, I could have written a script to do this, but frankly, this will be faster. Okay, I'm confused though, because this documentation indicates there's filtering abilities. So try passing a filter here for interactions. It Try this again. Again. Sa the logs are really hard to decipher. What's going on. Ultimately, what I want is a succinct summary of what we did and didn't do and who the contact is. It's really hard looking at our logs to decipher what actually happened. The summary at the end is good, but all of the logging leading up to it needs to be a lot more intuitive and easier to read. Is there a way to do this as a table? Although that might not make sense because it's technically logs, it's not designed to just be. And we really need to be able to interpret it as logs. But what can we do to make this much easier to read? These docks are really bad it ma'. Am. I mean, I can't imagine who's watching this, but if you are, now I get to see what coding is really like. Certainly a version of coding. I think what all this makes me really frankly want to do is invest more in like document based coding. That's even the right term. My brain's not even working. All right, let's see. Much better. Much better. Man, this is infuriating. We just sent a bunch of emails that were already synced. Had later interactions. The heck, man? Oh no, I lied. He just texted me. That's hilarious. Wait, actually no, see, I hate when it just agrees with you. Actually, no, Mike literally just texted me. That's so that was actually correct. That was new. Here are the docs and make sure you do it in the correct ISO format. What we want. I think what confused me a little bit though. When a test is using this time ST and seeing if we can get noise. Yeah. Because the whole point of this was most recent interaction. Not. Not every interaction. Yeah, we kind of got sidetracked from the most recent. The purpose of the thing which can happen what when we use this as the filter or as the interacted at try greater than I think this is query interactions not necessary. That's necessary anymore. Okay. Okay. Interactively commit our changes based off what makes sense. I mean that's something. That's the most ridiculous command to an AI someone could ever give. But the next thing I want to try. Although at this point I don't freaking trust Anything is to start that. That's crazy. The instructions to have this auto start on computer login computer start didn't seem to work. I'm trying to follow the instructions. Oh, okay. Read the readme and have it. So the launched service file starts on computer launch. Ridiculous. And have it. Well, we don't want it to auto restart because we led to an issue where we couldn't stop it. If it's set to auto restart, how could we terminate it? Also, is there a way to ensure there's only ever one process because we had an issue where a bunch of them respond it. It's funny, I'm texting my buddy Mike said he asked me how. He asked how it was going. I was like, well, in front of all of the people I just spawned dozens of replica processes and I ultimately had to resort to restarting my computer and I wasted three and a half hours because of the first slash last interaction misunderstanding around that API endpoint. This is the real. The real shit, guys. Is the cron job set up? How is it managed? And if we were to just to manually run this script with the cron job still run itself. Okay, provide that process locking safeguard stuff, all that and all these emergency commands, they should all be in the README. It also have it check every 15 minutes, not every hour. I think that's probably just assume it's in the process. I mean the constants, what's the difference number and where's the cron time period even set? I don't see it under constants. What a pain in the ass. Excuse me. French, analyze all of our JavaScript files closely and see if any other variables should be refactored to be constants should not be hard coded. Also, what happens if we update the cron period? Do we have to restart the demon or. Or will it automatically pick up on the different on the cron period? Oh, it just kind of answered my own in some ways this really is like having a savant Internet. Also, the cron is set based off the constant variable but you've hard coded the times in the synchron schedule. 25 new constants. Jesus Christ. Fine. Some of these are ridiculous. Tunnel. These are good. Should have had everything in the made no sense that it was extracted. Okay. Grab some water. It huh? Why wasn't. Why did they remove it, man? I feel like we lost. We just lost something that was actually working and I don't know now why it wasn't working. Why did they remove it, man? I feel like we lost. We just lost them it that was actually working and I don't know now why it wasn't working. Yeah. I'm skeptical how we lost that ability to do phone versus text commit our changes. Yeah, it should have asked me changes. And the other thing would be to have this run in a Docker instance rather than directly in a MA machine. That would have been the lesson. Also for the CRON stuff add a task to have this code run in a Docker instance as opposed to directly on a machine. That's not as relevant because this is actually a no, that actually won't work because it's supposed to access. It needs to have access to my chat database. Oh yeah. Right. So that won't work. Research whether it's even if there's a version of this even possible doing it through Docker. My assumption is not actually since in this particular situation we actually do need it to run as a as a script on my computer. It's just generally you don't want this stuff running directly on your computer. Yeah. Could also have it log out and probably into the API calls now rather than using Max. How often does it check? Why does it say unknown checks logs. I just checked the status of the demon. Where's the Cron do five minutes and then it should do. Let's see. I'm with Joel. He and I've been texting much more recently. That makes sense. 20 makes no sense. What the heck? It last activity was the 23rd but the last email. So how do I know? Is there any way for the status to say what the CRON interval is? Great. Exactly what I want it. Cool. Why do we not? Seems like I don't have to restart the demon in order for the CRON to take effect because I just changed it did Cron did the status of the demon and it shows that the intervals now every minute. But I didn't restart the demon. Don't we have to restart the demon for take effect? Or is that Will it do it automatically dynamically? That was a mouthful. It sa yeah, I'm skeptical how we lost that ability to do phone versus text. Makes sense. It how do we restart commit our changes? Yeah, it should have asked me changes. And the other thing would be to have this run in a Docker instance rather than directly on a machine. That would have been the lesson. Also for the CRON stuff, add a task to have this code run in a Docker instance as opposed to directly on a machine. Although that's not as relevant because this is actually a no, that actually won't work. Because it's supposed to access. It needs to have access to my chat database. Oh yeah, right. So that won't work. Research whether it's Even if there's a version of this even possible doing it through Docker. My assumption is not actually. Since in this particular situation we actually do need it to run as a. As a script on my computer. It's just generally you don't want this stuff running directly on your computer. Yeah. Could also have it log out and probably into the API calls now rather than using max. How often does it check? Why does it say unknown Checks logs? I just checked the status of the demon. Where's the Cron? Let's do five minutes and then it should do. Didn't work. It said that it wasn't running. I assume that's because we're running as a background process, not through node. So how would I restart this? And I don't see it in the readme? Why does it still say actual prime times are 0, 15, 30 if I change the time frame? Oh, he might have been texting much more recently. 21st makes no sense. What the heck? It last activity was the 23rd, but the last email. Oh, how do I know? Is there any way for the status to say what The Cron interval is great. Exactly what I want. Cool. Why do we not? Seems like I don't have to restart the demon in order for the Quran to take effect. Because I just changed it did Cron did the status of the demon and it shows that the intervals now every minute. But I didn't restart the demon. Don't we have to restart the demon for take effect the actual Cron job period? Jesus Christ. Jesus man. That's freaking ridiculous. Ridiculous man. That is you useless remove. Because that's absolutely useless. No, I think you just remove it. Stop. This is where I start feeling like I'm having an existential conversation with AI. Fine. Also your order of the Elsa should be ascending. You should go 1, 2, 15, not 115 2. You can custom write the ifs for 1, 2, 15, 30 and hourly. Ridiculous. It. Where is that? I will just do this myself. Sure. Is that. Will it do it automatically dynamically? That was a mouthful. Sa. How do we restart it? Didn't work. It said that it wasn't running. I assume that's because we're running as a background process, not through node. So how would I restart this? And I don't see it in the readme. Why does it still say actual prawn times are 0, 15, 30 if I change the Time frame it. That schedule should not be hard coded. Don't have anything hard coded around that. It's a dynamic value. Why do you have it hard coded? The mile that's being written should not be hard coded at 15 minutes. It should take into account consistency every. Every time the Cron job runs. How far back does it go in terms of looking back for messages? Never mind. I see the answer to that. It's 24 hours. Believe it's 24 hours under default sync hours when the daemon first starts. It should also look back 24 hours. Not one hour. I mean, really. It should. All right, Commit our changes. See if it actually asks me for permission to change. Man, that's not good. You just. The duplicate stuff. The duplicate threshold is not working. It just sent two messages to Joel that have the exact same. Well, wait, a few minutes ago it sent one that had already been sent out earlier. What I should really do is look in the past. Just restart. Restart the demon again. This is driving me freaking nuts. This should. I don't understand why this isn't being solved through tests. It's nuts. Restart the Demon again. I'm super frustrated because I can see that in the last couple minutes it resynced a message that we had already synced two minutes before that and had also synced a few minutes before that. And the actual message happened 35 minutes ago. This was for. I think when we get Sonnet. See here. And the reason I'm doing this is I want to back Go back to song. What this is not telling us is is it using Sonnet or is it using op It Right. Curious to see it see which J I. I barely rarely use this within what it. This is when you should stop working. You can't even find the headphones that are the case is right in front of you. All right, if I have multiple models set up within cursor models, how can I specify I now want it Just using Gemini for now. Like, how do I determine which one it's using? Determine or control? How do I change? There we go. Gemini. Analyze the logic to detect which messages to sync for Skip to audio. See here. Even if it's being re run, it should still recognize it was already sent and skip it. It wouldn't send it back to Adio. It should detect because it's looking at the timestamp of the most recent last interaction that's been logged for that contact and it will not. Our logic should Please verify that. Our logic does not send or forward messages to Addio if they're not only before the most the last interaction date, it needs to be greater than the last interaction date by at least whatever the threshold is that we've specified. That was a mouthful. Oh my God. A it I think when we get Sonnet see here it's not set and the reason I'm doing this is I want to back go back to Sonic. What this is not telling us is is it using Sonnet or is it using op it curious to see.






