Transcription: OpenAgents Episode 136 - Teams
June 9, 2026 ยท View on GitHub
Source: https://x.com/OpenAgentsInc/status/1852031199750811916 Wiki source: https://raw.githubusercontent.com/wiki/OpenAgentsInc/openagents/Video-Series.md Media title: OpenAgents - Episode 136: Teams Speaking of ancient bloated enterprise slop, let'... Upload date: 20241031 Transcription model: gpt-4o-mini-transcribe Generated at: 2026-06-01T15:35:22Z
Machine-generated transcript. Review speaker labels and wording before using this as quote-grade source material.
[00:00] Speaker: So before we go much further on our CRM, I wanna get teams working. So the idea is that any individual can have an account, personal account, and then you can have one or more teams that you own or are part of. You can create teams also. And each team will have its own data. So when I change team, I should see the team's chats over on the left, and it should be easy to toggle between different teams. So we have some of that code in place. We'll try to basically get it all connected in this episode. Should be kind of a basic episode, but a nice morning coding session. Okay, so let's see what we have so far. We have a little bit of team code already. So the CRM stuff added, some stuff, just kind of inferring from the other backend stuff that we had. So like CRM tag belongs to a team, contact can belong to a team. We wanna think through if that's like all the right structure, but we'll just kind of maybe focus on getting this stuff connected to the UI. So the basics of a team, team can have many users, a user can be a member of multiple teams, a team has many projects, a team has many threads through projects. Okay, a user can have a current team, a team can have many users with it as their current team. That's the core stuff. And then thread can belong to a team through a project. That's fine. And then on the user model, user can belong to multiple teams, user can have a current team, user can have a null current team for personal context, user can have projects through the current team. Okay. So I just kind of pasted in this team switcher component from the Shad UI kind of example stuff. And I don't know that that will be the final place for that. I might combine it with this menu down here, but who cares? So my goal for this episode is to, I guess, be able to create a team and be able to switch and then see the data of the team. So I think instead of relying on seeders to get seed teams going, I just wanna like, let's maybe build the create team page. So let's make a new test, a new feature test for create teams. And maybe instead of doing any coding, maybe if I, I'm gonna just try to do everything through the open agents UI. So the first thing I'm gonna do, I need to automate this later. Getting the test results there. So it knows what we have already. Okay, so let's do this. Read this. Write a doc slash teams.md with all that info. We now need to drive out the, let's also have it look at the team switcher. I want one definitive doc explaining the team's integration for future agents. Easy reference. Let's also have it read the readme. We next need to drive out the create team functionality, but first make that doc. Then look at a test or two for teams and write a create team test feature test. Ah, now here's where I could just go get some coffee. So yeah, like these agents have kind of an average lifespan of 60 seconds or so. And then in the version three interface, I'll be adding more kind of Devin style, um, asynchronous job processing. So you can give it a higher level task and kind of walk away and just get the updates. Now that I've like worked with this method of kind of steering the agents myself for, you know, a number of months, I've got like a lot better idea of kind of how to start extricating myself from the process and what the higher level plans need to look like for it to be able to chunk up things effectively. All right, so it created us a team doc. Let's just see what that looks like. OpenAgent implements a team-based collaboration system that allows users to work together on projects and share resources. This document outlines how teams are implemented and used. Yep, yep, yep, yep. Team model, user model, team switching, front-end implementation, blah, blah, blah. Yeah, that's perfect. Yeah, that's amazing. All right. I've created the doc and the test. Let's check out the test. All right, create team test. And for now, I'll just kind of like paste this in test results. This is another thing I'll definitely be automating is having the agent easily continue based on automated test results. Yes, look at boom to see the failing tests. Look at routes.web.php and look in the controllers folder to see what we got and add everything appropriate. Make sure to use routes similar to ones we have, like don't use API if not elsewhere, etc. And update tests as needed. Ah. So our last tweet talked shit about Salesforce. I think this tweet will talk shit about Microsoft Teams. Why use bloated, no, ancient bloated enterprise slop like Salesforce? Yeah, yeah, yeah. So this tweet, what will this be like? Speaking of ancient bloated enterprise slop, let's replace Microsoft Teams while we're at it. Yeah, same idea as the last time. Like let's deliver 80% of the functionality for 20% of the price and like pain in the ass. Okay, I've created a team controller with two main actions. Store creates a new team and assigns a current user. Switch team switches the current user's team context, blah, blah, blah. Updated the feature tests. Are we green is the question. Nope. Teams has no column named name. Oh. Edit. Boom. Probably also have to update the team factory and edit this. Yeah, it took me a while to like figure out how I wanted to do the interface and the text doc and get the streaming working and wrangle the bedrock API. And then do the tools. All that stuff is done now and everything aside from it is just basic CRUD. Create, read, update, delete. And then interfacing with third-party APIs like emails and stuff. Table team user already exists. I don't know why I have it in the users table. For some reason, I have team user also defined here. Maybe edit that to remove it, but consolidate as appropriate. Ooh, I don't think I gave it the delete file. Okay, let's make sure, double sure we got everything. All right. Look again at boom and fix those. Yeah, Claude knows Laravel quite well. It's been around for like a decade. The patterns haven't had like crazy API changes for the most part, so you can move pretty quickly with it. But. I see the issue. Let me fix the team controller again. The main issues were blah, blah, blah. Uh-oh. Same issue. And sometimes it'll get stuck and I got to drop down and like use my human brain to help it out. But that's all right. Okay. Add logging if you need to help debug it. I have a CL alias to delete my current log file. Let's start by just running this one. We're using where has incorrectly. Yeah, sometimes just having to take a second look at it. And it's good if within the training data set of Claude, it's like it's got the right answer in there. Sometimes you just got to re-prompt it, which is good because the re-prompting can be done in a non-human involved way. Agents can do all that themselves. Have like a verifier agent. And then worst case, if it comes up with a solution, that's fucked. Then maybe we need to drop in the relevant documentation. There we go. Okay, what was the other one? Oh, now they all pass. Banger. Okay, so let's start a new chat. And we'll say, we'll just have it read Docs teams. Now we need a screen for creating a team and to link to it from the team switcher. Look at boom for an example form using Shad components and make the create form similarly hitting that create endpoint. Do you think it'll work? Just make double check our team's test pass. Create team. Nice. That didn't work.
[19:59] Speaker: Oh, to make this work, you'll need to. You add the route and you check team controller giving me work to do. I don't think so. Just a couple more things we need to pull over from V2 into the V3 interface where I'll be using V3 to build V3. A couple of annoyances from V2 that I never fixed, like if it gets too long, it'll just crap out. But it'll be easier to add different condensing that doesn't happen. All right, let's see if this works. Ooh. Well, I kind of want to go inside of my main layouts. Let's just do this. Create main layout. All right, moment of truth. Testo team. Well, I never migrated. So let's do migrations from scratch because we made some changes there. Ooh, do I want to wipe out all my chats? Yes, I do. Login. I think I disabled the register routes. No, I didn't. OK. OK, let's create a team. Testo team. OK, so let's check our database. OK, we created it. Now, we don't have any roles associated with it. So that's just something we can add test for separately because like there's no way to know who created it. That's a simple change. I don't care right now. I just want to kind of get this thing working here. So thanks. That works. Team is created, but now we need to show the users teams in the team switcher connecting that to the switch team route. I want the team information passed to every page. I want the team info passed to every page and then edit team switcher to use huge Inertia's use page props to get the teams and list them there linking to switch team route for each. Let's try that. Hell yeah. OK, there's our team and it's selected. And I can switch. Look at that. Look at that. Oh, yeah. Oh, yeah. OK, so it looks like team switching is working just fine, but now I need the threads to. I should probably drive that out via test, but let me just just because we're on a roll here. Thanks, except for now in the threads there. Don't show all threads belonging to the user. Make it belonging to the user or team depending on if current team thing is null or not. If I were like writing a communication to a human, I would not have horrendous typos just out of respect. But like, I don't need to respect this little agent. Sorry, agent. I mean, you get what I'm saying. It's fuzzy. It's fuzzy. It's good. You'll need to make sure your thread model has both user ID and team ID. I think that's already in place. Let's see what this does. So Testo team. I can't tell if that's working or not. Let's make a few of these. So Testo team. And I noticed this seems like a greeting, but I don't have enough. OK, so if I switch to personal, I need this to update. OK, so I have all that already, but the problem now is when I switch the team context. Well, it must not be working because I still see. Or I didn't pull the. OK, so Christopher David. OK, OK, so Testo team. Well, I hang on. Making this on Testo team. The first thing I do, I guess it was on my personal. So if I refresh. No, I should see that on the sidebar. Let me take a look at the database here. Oh, I don't have new threads being associated with the team. OK, that might be worth writing a test for. Because right now it's all showing up as a user, but at least at least we can confirm that because we're also see with the user. If I'm in my team context, they don't show up over here, but we also do need to enforce that here. So we'll do that and then that'll be mission accomplished for this video. And let's try making this in the same. Now we need to ensure that new threads respect the current user context. Write a new thread permissions test or thread ownership test. Past feature test. First look at this. Because right now all threads are being owned by the user, even if there is a selected team and we need to fix that. Testing the proper functionality. Don't make it pass yet. Oops. I see that the chat controller currently only considers user ID when creating and managing threads. Let's write a test that verifies proper thread ownership based on team context. You know what we could do is like go use or harvest code from JetStream, for example. JetStream is one of the Laravel like boilerplates that you can start with. We started with just Breeze, which has just the basic authentication. JetStream has the like other stuff like teams already out of the box, which is nice. But I found that when using it, I kept needing to like drop down to the actual code to figure out like how they implemented stuff. And it was never exactly what I wanted. And so, you know, it doesn't, it's all just basic crud stuff. So it's really not difficult to implement it yourself, particularly using agent stuff. And if we ever want to like go and look at more of what the best practices are for certain things, we can go evaluate the JetStream code. But I just want kind of an MVP right now. So comprehensive test suite that verifies blah, blah, blah. Let's first take a look at the file. Wow. PF thread ownership. Okay. Would you like me to implement the changes to make these tests pass? Yes. Add team ID to threads table. So I don't know if it's respecting this. Look at boom and boom. Threads belong to teams through projects, not directly. Let me revise the chat controller. Do I even want to do that? We haven't really specced out projects yet. Maybe we'll do that in the next video. Six of eight passed. Look at boom and then make any needed changes. First exploring our existing models migrations if needed to learn more about what we have already. Yeah. So any given team should have multiple projects organizing files and stuff per project. That seems to make sense. I'm really excited for this because I've got a bunch of projects that I want to be sorting different ideas, files, notes, contacts, follow-ups into and being able to have agents help me organize all that and take action on all that. It's like, I don't need to give up my side project anymore. I can just create little Ingress, create little projects and open agents and have stuff work on it. How's that for like a marketing angle? Don't abandon your side projects. Complete your long abandoned side projects. Those old domains that you haven't done anything with. Open agents plus open press. I like that. All right. Looks like this is too long. Crapping out. Thread user ID. That doesn't seem right. So out of curiosity, let me just see what this does. Test high. So if I make a thread that's owned by project, but not team ID. Does thread have... Yeah, thread doesn't have a fillable of team ID. Although I don't know if that's appropriate. Okay, I'm not going to think about it. I'm just going to make it fix it. Let's try this again. Go here. Read test results and... Read test results in teams. Fix those tests. Look at any files needed. Yeah, so any given team should have multiple projects organizing files and stuff per project. That seems to make sense. I'm really excited for this because I've got a bunch of projects that I want to be sorting different ideas, files, notes, contacts, followups into and being able to have agents help me organize all that and take action on all that. It's like, I don't need to give up my side project anymore. I can just create little Ingress, create little projects and open agents and have stuff work on it. How's that for like a marketing angle? Don't abandon your side projects. Complete your long abandoned side projects. Those old domains that you haven't done anything with. Open agents plus open press. I like that. All right, looks like this is too long. Crapping out. Thread user ID. That doesn't seem right. So out of curiosity, let me just see what this does. Test high. So if I make a thread that's owned by project, but not team ID. Does thread have... Yeah, thread doesn't have a fillable of team ID. Although I don't know if that's appropriate. Okay, I'm not going to think about it. I'm just going to make it fix it. Let's try this again. Go here. Read test results and... Read test results in teams. Fix those tests. Look at any files needed. Yeah, so any given team should have multiple projects organizing files and stuff per project. That seems to make sense. I'm really excited for this because I've got a bunch of projects that I want to be sorting different ideas, files, notes, contacts, followups into. And being able to have agents help me organize all that and take action on all that. It's like, I don't need to give up my side project anymore. I can just create little Ingress, create little projects and open agents and have stuff work on it. How's that for like a marketing angle? Don't abandon your side projects. Complete your long abandoned side projects. Those old domains that you haven't done anything with. Open agents plus open press. I like that. All right, looks like this is too long. Crapping out. Thread user ID. That doesn't seem right. So out of curiosity, let me just see what this does. Test high. So if I make a thread that's owned by project but not team ID. Oops, does thread have... Yeah, thread doesn't have a fillable of team ID. Although I don't know if that's appropriate. Okay, I'm not going to think about it. I'm just going to make it
[39:59] Speaker: These two fail, fix it. Oh no, we're getting tagged in some bullshit. The route is defined as get. Oh, because that was the view. Blah, blah, blah, blah, blah, blah, blah. Let's see if it passes. It does. Okay, the test passed, but does it, like, work? So I'm in testo teams, so if I do new, now boom, gives 404. Did you mess with my create, get route that shows the form? Fix it. Oh yes, I changed the route, but didn't consider the front end needs a get route to show the form. Let's fix that by having both routes. Well, thank you. Takes like five to 10 seconds to do these edits sometimes because it's like regenerating the entire file. Room for optimization there. It's not done, but let's see if those tests pass. Yes, they do. Oh look, switch, switch, nice, very nice. Oh, I see, it was trying to update chat controller. Oh, there we go. Do the tests pass? The tests pass. Can I create a chat? I did give it the wrong thing. I think I said team switcher, but I should have said new chat. Link href equals slash chat slash create. Show create chat create. Oh. Yeah, I meant create. Okay. I made it change the wrong thing. Ah, fucked it up. Almost there. Git status. Git log. Okay, so switch, switch, that's good. And then the create route. Oh, that should just be a get. There we go. Now, new chat. Oh, again, wipe the database. Let's save this. Edit route, blah, blah, blah. All right, let's try this one last time. PHP artisan. Migrate fresh. Hi. No teams. Let's create a team. Testo team. I don't see the chats over there for the personal. Hi, Testo team. And I will switch to personal. Fuck. Didn't create it in the right thing. Let's take a look at the database. Yeah, I think it's getting confused with the projects thing. We're almost there. Let's check the chat controller to make sure it's properly handling team context when creating new threads. You're checking the models. That's interesting. It said it was going to check the chat controller, but it checked this other stuff instead. Instead, it already feeded. Okay. Well, it's pretty cool that it can intelligently search through 15 different files and diagnose an issue and make changes that hopefully work. Those tests pass. All right, we'll pause there. We've got the ability to create teams and switch between them. It shows the right chats over there. Some of the kind of weird permissions issues with projects, we're going to fix in the next video as we build out the projects because the teams have multiple projects and users can create chats in projects owned by teams. So, projects next. See you soon.