fork of prime agent with changes i want but are not upstreamable probqbly (and some fixes)

feat(agent): resolve the loop model before each provider request master

AgentLoopConfig.getModel lets a caller retarget a loop that is already running. Agent now passes its live state model, so an extension that changes the model during a turn affects the next request instead of waiting for the next run.