AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents — ThinkLLM