Skip to content
4 changes: 2 additions & 2 deletions captures/ghzinga-issue-88499/large/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "openai-responses provider: 404 on previous_response_id when store=false (default)",
"mode": "issue",
"binary": "target/debug/gzg",
"git_commit": "1f9c11df009706d744e6c810d50bb886d8bebc9a",
"git_commit": "79b504ea6e2ab4d768a3abf0aed9ab4903057f46",
"config_path": "captures/ghzinga-issue-88499/capture-empty-config.toml",
"requested_columns": 160,
"requested_rows": 50,
Expand Down Expand Up @@ -113,5 +113,5 @@
}
],
"actual_tmux_size": "160x50",
"app_tree_hash": "0bb55716541e219b88eda9e1305244258debfd2a90d5e6d65b0958aafbe4840d"
"app_tree_hash": "3d0ff248f59a801cfca8d8049b68091d5ade6f392d024eb3cb07ec1ffd4fd358"
}
4 changes: 2 additions & 2 deletions captures/ghzinga-issue-88499/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "openai-responses provider: 404 on previous_response_id when store=false (default)",
"mode": "issue",
"binary": "target/debug/gzg",
"git_commit": "1f9c11df009706d744e6c810d50bb886d8bebc9a",
"git_commit": "79b504ea6e2ab4d768a3abf0aed9ab4903057f46",
"config_path": "captures/ghzinga-issue-88499/capture-empty-config.toml",
"offline_fixture": "fixtures/issue-88499.json",
"offline_resource_fixtures": [],
Expand All @@ -24,5 +24,5 @@
"rows": 50
}
],
"app_tree_hash": "0bb55716541e219b88eda9e1305244258debfd2a90d5e6d65b0958aafbe4840d"
"app_tree_hash": "3d0ff248f59a801cfca8d8049b68091d5ade6f392d024eb3cb07ec1ffd4fd358"
}
4 changes: 2 additions & 2 deletions captures/ghzinga-issue-88499/medium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "openai-responses provider: 404 on previous_response_id when store=false (default)",
"mode": "issue",
"binary": "target/debug/gzg",
"git_commit": "1f9c11df009706d744e6c810d50bb886d8bebc9a",
"git_commit": "79b504ea6e2ab4d768a3abf0aed9ab4903057f46",
"config_path": "captures/ghzinga-issue-88499/capture-empty-config.toml",
"requested_columns": 120,
"requested_rows": 36,
Expand Down Expand Up @@ -113,5 +113,5 @@
}
],
"actual_tmux_size": "120x36",
"app_tree_hash": "0bb55716541e219b88eda9e1305244258debfd2a90d5e6d65b0958aafbe4840d"
"app_tree_hash": "3d0ff248f59a801cfca8d8049b68091d5ade6f392d024eb3cb07ec1ffd4fd358"
}
4 changes: 2 additions & 2 deletions captures/ghzinga-issue-88499/mouse-smoke/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"fixtures/issue-66943.json"
],
"binary": "target/debug/gzg",
"git_commit": "1f9c11df009706d744e6c810d50bb886d8bebc9a",
"git_commit": "79b504ea6e2ab4d768a3abf0aed9ab4903057f46",
"config_path": "captures/ghzinga-issue-88499/mouse-smoke/capture-empty-config.toml",
"command": "cd . && TERM=xterm-256color GZG_CONFIG_PATH=./captures/ghzinga-issue-88499/mouse-smoke/capture-empty-config.toml GZG_STATE_HOME=./captures/ghzinga-issue-88499/mouse-smoke/.capture-state GZG_CACHE_HOME=./captures/ghzinga-issue-88499/mouse-smoke/.capture-cache BROWSER=./captures/ghzinga-issue-88499/mouse-smoke/capture-open-url.sh GZG_COPY_COMMAND=./captures/ghzinga-issue-88499/mouse-smoke/capture-copy-url.sh ./target/debug/gzg https://github.com/openclaw/openclaw/issues/88499 --offline-fixture ./captures/ghzinga-issue-88499/mouse-smoke/navigation-fixture.json --offline-resource-fixture ./fixtures/issue-66943.json --no-restore --refresh-seconds 0",
"actual_tmux_size": "120x36",
Expand Down Expand Up @@ -120,5 +120,5 @@
"ansi": "70_mouse_quit_confirm.ansi"
}
],
"app_tree_hash": "0bb55716541e219b88eda9e1305244258debfd2a90d5e6d65b0958aafbe4840d"
"app_tree_hash": "3d0ff248f59a801cfca8d8049b68091d5ade6f392d024eb3cb07ec1ffd4fd358"
}
4 changes: 2 additions & 2 deletions captures/ghzinga-issue-88499/narrow/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "openai-responses provider: 404 on previous_response_id when store=false (default)",
"mode": "issue",
"binary": "target/debug/gzg",
"git_commit": "1f9c11df009706d744e6c810d50bb886d8bebc9a",
"git_commit": "79b504ea6e2ab4d768a3abf0aed9ab4903057f46",
"config_path": "captures/ghzinga-issue-88499/capture-empty-config.toml",
"requested_columns": 80,
"requested_rows": 24,
Expand Down Expand Up @@ -113,5 +113,5 @@
}
],
"actual_tmux_size": "80x24",
"app_tree_hash": "0bb55716541e219b88eda9e1305244258debfd2a90d5e6d65b0958aafbe4840d"
"app_tree_hash": "3d0ff248f59a801cfca8d8049b68091d5ade6f392d024eb3cb07ec1ffd4fd358"
}
4 changes: 2 additions & 2 deletions captures/ghzinga-pr-81834/large/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "feat(senseaudio): add SenseAudio TTS provider",
"mode": "pr",
"binary": "target/debug/gzg",
"git_commit": "1f9c11df009706d744e6c810d50bb886d8bebc9a",
"git_commit": "79b504ea6e2ab4d768a3abf0aed9ab4903057f46",
"config_path": "captures/ghzinga-pr-81834/capture-empty-config.toml",
"requested_columns": 160,
"requested_rows": 50,
Expand Down Expand Up @@ -183,5 +183,5 @@
}
],
"actual_tmux_size": "160x50",
"app_tree_hash": "0bb55716541e219b88eda9e1305244258debfd2a90d5e6d65b0958aafbe4840d"
"app_tree_hash": "3d0ff248f59a801cfca8d8049b68091d5ade6f392d024eb3cb07ec1ffd4fd358"
}
4 changes: 2 additions & 2 deletions captures/ghzinga-pr-81834/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "feat(senseaudio): add SenseAudio TTS provider",
"mode": "pr",
"binary": "target/debug/gzg",
"git_commit": "1f9c11df009706d744e6c810d50bb886d8bebc9a",
"git_commit": "79b504ea6e2ab4d768a3abf0aed9ab4903057f46",
"config_path": "captures/ghzinga-pr-81834/capture-empty-config.toml",
"offline_fixture": null,
"offline_resource_fixtures": [],
Expand All @@ -24,5 +24,5 @@
"rows": 50
}
],
"app_tree_hash": "0bb55716541e219b88eda9e1305244258debfd2a90d5e6d65b0958aafbe4840d"
"app_tree_hash": "3d0ff248f59a801cfca8d8049b68091d5ade6f392d024eb3cb07ec1ffd4fd358"
}
4 changes: 2 additions & 2 deletions captures/ghzinga-pr-81834/medium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "feat(senseaudio): add SenseAudio TTS provider",
"mode": "pr",
"binary": "target/debug/gzg",
"git_commit": "1f9c11df009706d744e6c810d50bb886d8bebc9a",
"git_commit": "79b504ea6e2ab4d768a3abf0aed9ab4903057f46",
"config_path": "captures/ghzinga-pr-81834/capture-empty-config.toml",
"requested_columns": 120,
"requested_rows": 36,
Expand Down Expand Up @@ -183,5 +183,5 @@
}
],
"actual_tmux_size": "120x36",
"app_tree_hash": "0bb55716541e219b88eda9e1305244258debfd2a90d5e6d65b0958aafbe4840d"
"app_tree_hash": "3d0ff248f59a801cfca8d8049b68091d5ade6f392d024eb3cb07ec1ffd4fd358"
}
4 changes: 2 additions & 2 deletions captures/ghzinga-pr-81834/mouse-smoke/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"fixtures/issue-66943.json"
],
"binary": "target/debug/gzg",
"git_commit": "1f9c11df009706d744e6c810d50bb886d8bebc9a",
"git_commit": "79b504ea6e2ab4d768a3abf0aed9ab4903057f46",
"config_path": "captures/ghzinga-pr-81834/mouse-smoke/capture-empty-config.toml",
"command": "cd . && TERM=xterm-256color GZG_CONFIG_PATH=./captures/ghzinga-pr-81834/mouse-smoke/capture-empty-config.toml GZG_STATE_HOME=./captures/ghzinga-pr-81834/mouse-smoke/.capture-state GZG_CACHE_HOME=./captures/ghzinga-pr-81834/mouse-smoke/.capture-cache BROWSER=./captures/ghzinga-pr-81834/mouse-smoke/capture-open-url.sh GZG_COPY_COMMAND=./captures/ghzinga-pr-81834/mouse-smoke/capture-copy-url.sh ./target/debug/gzg 'openclaw/openclaw#81834' --offline-fixture ./captures/ghzinga-pr-81834/mouse-smoke/navigation-fixture.json --offline-resource-fixture ./fixtures/issue-66943.json --no-restore --refresh-seconds 0",
"actual_tmux_size": "120x36",
Expand Down Expand Up @@ -240,5 +240,5 @@
],
"load_full_fixture": "captures/ghzinga-pr-81834/mouse-smoke/load-full-fixture.json",
"load_full_command": "cd . && TERM=xterm-256color GZG_CONFIG_PATH=./captures/ghzinga-pr-81834/mouse-smoke/capture-empty-config.toml GZG_STATE_HOME=./captures/ghzinga-pr-81834/mouse-smoke/.capture-state GZG_CACHE_HOME=./captures/ghzinga-pr-81834/mouse-smoke/.capture-cache ./target/debug/gzg 'openclaw/openclaw#81834' --offline-fixture ./captures/ghzinga-pr-81834/mouse-smoke/load-full-fixture.json --no-restore --refresh-seconds 0",
"app_tree_hash": "0bb55716541e219b88eda9e1305244258debfd2a90d5e6d65b0958aafbe4840d"
"app_tree_hash": "3d0ff248f59a801cfca8d8049b68091d5ade6f392d024eb3cb07ec1ffd4fd358"
}
4 changes: 2 additions & 2 deletions captures/ghzinga-pr-81834/narrow/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "feat(senseaudio): add SenseAudio TTS provider",
"mode": "pr",
"binary": "target/debug/gzg",
"git_commit": "1f9c11df009706d744e6c810d50bb886d8bebc9a",
"git_commit": "79b504ea6e2ab4d768a3abf0aed9ab4903057f46",
"config_path": "captures/ghzinga-pr-81834/capture-empty-config.toml",
"requested_columns": 80,
"requested_rows": 24,
Expand Down Expand Up @@ -183,5 +183,5 @@
}
],
"actual_tmux_size": "80x24",
"app_tree_hash": "0bb55716541e219b88eda9e1305244258debfd2a90d5e6d65b0958aafbe4840d"
"app_tree_hash": "3d0ff248f59a801cfca8d8049b68091d5ade6f392d024eb3cb07ec1ffd4fd358"
}
20 changes: 11 additions & 9 deletions src/domain/resource.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
use std::{collections::HashMap, fmt};
use std::{collections::HashMap, fmt, sync::LazyLock};

use regex::Regex;
use serde::{Deserialize, Serialize};
use thiserror::Error;

pub const FULL_DEPTH_WARNING_HINT: &str = "set --api-depth full or GZG_API_DEPTH=full";

static GITHUB_RESOURCE_URL_RE: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(r"^https://github\.com/([^/\s]+)/([^/\s]+)/(pull|issues)/([0-9]+)(?:[/?#].*)?$")
.expect("valid GitHub URL regex")
});
static OWNER_REPO_HASH_RE: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(r"^([^/\s#]+)/([^/\s#]+)#([0-9]+)$").expect("valid owner repo hash regex")
});

#[derive(Debug, Error, PartialEq, Eq)]
pub enum ResourceIdError {
#[error("expected a GitHub PR/issue URL, owner/repo#number, or owner/repo number")]
Expand Down Expand Up @@ -107,11 +115,7 @@ impl ResourceId {
}

fn parse_url(input: &str) -> Result<Option<Self>, ResourceIdError> {
let re = Regex::new(
r"^https://github\.com/([^/\s]+)/([^/\s]+)/(pull|issues)/([0-9]+)(?:[/?#].*)?$",
)
.expect("valid GitHub URL regex");
let Some(caps) = re.captures(input) else {
let Some(caps) = GITHUB_RESOURCE_URL_RE.captures(input) else {
return Ok(None);
};
let kind_hint = match &caps[3] {
Expand All @@ -128,9 +132,7 @@ impl ResourceId {
}

fn parse_owner_repo_hash(input: &str) -> Result<Option<Self>, ResourceIdError> {
let re =
Regex::new(r"^([^/\s#]+)/([^/\s#]+)#([0-9]+)$").expect("valid owner repo hash regex");
let Some(caps) = re.captures(input) else {
let Some(caps) = OWNER_REPO_HASH_RE.captures(input) else {
return Ok(None);
};
Ok(Some(Self {
Expand Down
Loading