Skip to content

[term-challenge harness] container_ip.clone().unwrap() can panic in external_agent.rs #32

@InverseAltruism

Description

@InverseAltruism

Project

cortex

Description

src/bench/external_agent.rs lines 405 and 513 use state.container_ip.clone().unwrap() which will panic if container_ip is None.

Should use .ok_or_else() to return a proper error instead of crashing.

Error Message

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/bench/external_agent.rs:405:42

Debug Logs

N/A - issue is visible in source code

System Information

term-challenge commit: bdb9b05 (latest main)
Rust: stable
OS: Linux 6.8.0-90-generic (Ubuntu 24.04.3 LTS)

Screenshots

N/A - issue is visible in source code

Steps to Reproduce

  1. Open src/bench/external_agent.rs
  2. Go to line 405
  3. See: state.container_ip.clone().unwrap()
  4. Same at line 513

Expected Behavior

Use .ok_or_else() to return graceful error if container_ip is None.

Actual Behavior

unwrap() panics and crashes the harness if container_ip is None.

Additional Context

container_id is properly handled with if let Some(ref id) but container_ip uses raw unwrap().

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions