I think we can assume that the Rivian charging system us going to be at least as sophisticated as the Tesla's meaning that we should be able to set the charging rate and time in the car. The R1T is going to have something like 400 mi range with a 185 kWh battery implying 462 W/mi which seems highish but sticking with it that means that charging at a 1 kW rate will add about 1000/462 = 2.16 mi per hour of charging at that rate. It seems you have a pretty substantial solar setup. Given that you have battery capacity of 40 kWh with average insolation of 5 kWh/m^2/da and that systems are generally designed to be able to charge the battery bank in a single sunny day I'm guessing that your panels are rated around 8 kW which sort of aligns with average electrical consumption for a house in the US and implies about 32 panels and is consistent with your comment in the OP. In any case a strategy for charging the vehicle that minimizes discharge of the batteries is to do the charging when the sun is up and the other electrical loads are low. In the worst (most annoying) case, you sit in the car with your cell phone and monitor consumption and generation riding the car's current draw control to keep production higher than consumption. In a more reasonable approach you set the timer in the car to start charging at a predetermined rate after the sun is well up and minimize the use of dishwashers, clothes dryers etc. on the mornings you are charging.
What you do will change with season's of course. Where I live in Northern Virginia, as an example, June days begin with sunshine and it's cool so air conditioners are not running and, of course, lights are off and the TV's aren't on. In the afternoon the house has heated up and the air conditioners come on about the time clouds start to roll in. Thus I charge the car in the morning and not in the afternoon or night if I wish to prevent the car from drawing down the "battery" (which in this case is the utility - I'm not off grid and the motivation is to be able to claim that I charge the car exclusively from the sun). For example, if you set the truck to take 4 kW for 3 hours starting at, say 11 AM, would add 3*4*2.16 = 26 miles each day you did that.
I assume you have some means of monitoring production and consumption. If you don't you will really need something (e.g. an eGauge) to let you do that. The picture below is taken from an eGauge page for a typical June day as described. There is no car charging going on in this picture but to get the idea you can assume that the baseline load of about 1.8 kW is going to a BEV. The green curve is production and the red consumption. When production exceeds consumption the screen is green and in the opposite case, pink. Pink indicates the battery is discharging. The object is to set the BEV charging demand as high as possible without too many pink bits. If you get occasional pink as at just after 8 AM and 9 AM in this example, that's nothing to worry about. The goal is to minimize pink overall in the picture. Note that green in this example goes to charge the infinite capacity battery represented by the utility. In an off grid system it would represent energy going to charge the battery until the battery is full at which time the charge controller would reduce production to match load. With experience you should be able to figure how high you can set the truck's charging rate while keeping pink reasonable. Note also that the time shifting aspect of this approach applies to any load - not just the truck. If you run the clothes dryer when solar production is high it won't discharge the battery.
As for giving most of energy to the truck and using the truck to store it: yes that would spare the AGM's some charge/discharge cycling but think about the efficiency aspect of this. The following conversions would take place (from the panel inverter output):
1. AC to DC in the vehicle
2. DC to AC in the vehicle 120V inverter
3. AC to DC in the AGM battery charger
4. DC to AC when the energy is used to operate an appliance.
Assuming that each of those conversions is 85% efficient only 100*0.85^4 = 52.4% of the energy stored in this way would ultimately wind up serving a load.