Repository: microsoft/RD-Agent
File: rdagent/scenarios/data_science/scen/__init__.py (Python)

Code before:
            * min(
                DS_RD_SETTING.coder_longer_timeout_multiplier_upper,
                self.timeout_increase_count * DS_RD_SETTING.coder_timeout_increase_stage + 1,
            )
            if self.coder_longer_time_limit_required
            else DS_RD_SETTING.debug_timeout
        )

    def recommend_debug_timeout(self):
        return DS_RD_SETTING.debug_recommend_timeout

    def real_full_timeout(self):
        remain_time = RD_Agent_TIMER_wrapper.timer.remain_time()
        all_duration = RD_Agent_TIMER_wrapper.timer.all_duration
        remain_percent = remain_time / all_duration

        if remain_percent * 100 < 100 - DS_RD_SETTING.ratio_merge_or_ensemble:
            return DS_RD_SETTING.full_timeout * DS_RD_SETTING.runner_longer_timeout_multiplier_upper

        return (
            DS_RD_SETTING.full_timeout
            * min(
                DS_RD_SETTING.runner_longer_timeout_multiplier_upper,
                self.timeout_increase_count
                * DS_RD_SETTING.runner_timeout_increase_stage
                // DS_RD_SETTING.runner_patience
                + 1,
            )
            if self.runner_longer_time_limit_required
            else DS_RD_SETTING.full_timeout
        )

    def recommend_full_timeout(self):
        return DS_RD_SETTING.full_recommend_timeout

    def increase_timeout(self):
        """Increase the timeout multiplier for the scenario."""
        self.timeout_increase_count += 1

    @property
    def background(self) -> str:
        background_template = T(".prompts:competition_background")
        background_prompt = background_template.r(
            task_type=self.task_type,
            data_type=self.data_type,
            brief_description=self.brief_description,
            dataset_description=self.dataset_description,
            model_output_channel=self.model_output_channel,
            metric_description=self.metric_description,
        )
        return background_prompt

Review comment (suggestion):
- every runner_patience_count, increase runner_patience_count,

DS_RD_SETTING.runner_patience_hour, every runner_patience_hour accumulation, then increase 1 full_timeout


```
old: self.timeout_increase_count * DS_RD_SETTING.runner_timeout_increase_stage // 2 + 1
= DS_RD_SETTING.runner_timeout_increase_stage = 0.3


new:
- DS_RD_SETTING.runner_timeout_increase_stage = 0.15
- runner_timeout_increase_stage_patience = 7

step,  old,  new(patience)
0,          0, 0
1, 0.3 // 2=0, 0
2,   0.6 // 2, 0
3,   0.9 // 2, 0
....
7, 2.1 // 2= 1,7 * 0.15 = 1.05
```

Code after:
            * min(
                DS_RD_SETTING.coder_longer_timeout_multiplier_upper,
                self.timeout_increase_count * DS_RD_SETTING.coder_timeout_increase_stage + 1,
            )
            if self.coder_longer_time_limit_required
            else DS_RD_SETTING.debug_timeout
        )

    def recommend_debug_timeout(self):
        return DS_RD_SETTING.debug_recommend_timeout

    def real_full_timeout(self):
        remain_time = RD_Agent_TIMER_wrapper.timer.remain_time()
        all_duration = RD_Agent_TIMER_wrapper.timer.all_duration
        remain_percent = remain_time / all_duration

        if remain_percent * 100 < 100 - DS_RD_SETTING.ratio_merge_or_ensemble:
            return DS_RD_SETTING.full_timeout * DS_RD_SETTING.runner_longer_timeout_multiplier_upper

        # Every 'patience' failures, move to next timeout level
        # Each level adds 'runner_timeout_increase_stage' multiplier to timeout
        # Capped by upper limit to prevent infinite growth
        return (
            DS_RD_SETTING.full_timeout
            * min(
                DS_RD_SETTING.runner_longer_timeout_multiplier_upper,
                self.timeout_increase_count
                // DS_RD_SETTING.runner_timeout_increase_stage_patience
                * DS_RD_SETTING.runner_timeout_increase_stage
                + 1,
            )
            if self.runner_longer_time_limit_required
            else DS_RD_SETTING.full_timeout
        )

    def recommend_full_timeout(self):
        return DS_RD_SETTING.full_recommend_timeout

    def increase_timeout(self):
        """Increase the timeout multiplier for the scenario."""
        self.timeout_increase_count += 1

    @property
    def background(self) -> str:
        background_template = T(".prompts:competition_background")
        background_prompt = background_template.r(
            task_type=self.task_type,
            data_type=self.data_type,
            brief_description=self.brief_description,
            dataset_description=self.dataset_description,
            model_output_channel=self.model_output_channel,