Skip to content

Commit 42bb000

Browse files
dogzzdogzzclaude
andcommitted
Merge origin/main (v0.7.5) into feat/slack-adapter
Resolve conflicts: - format.rs: keep shorten_thread_name (ours), remove truncate_chars (upstream removed it in favor of tail-priority truncation) - adapter.rs: replace truncate_chars with tail-priority truncation (keep last N chars during streaming, matching upstream's approach) - discord.rs: keep our refactored DiscordAdapter version (upstream changes to compose_display/tool collapse are in their monolithic discord.rs which we replaced) - Dockerfiles: upstream merged our openabdev#335 fix + added procps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 parents cd9ea56 + fbb265d commit 42bb000

14 files changed

Lines changed: 1085 additions & 27 deletions
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Close Stale closing-soon PRs
2+
3+
on:
4+
schedule:
5+
- cron: '0 9 * * *' # daily at 09:00 UTC
6+
workflow_dispatch:
7+
8+
jobs:
9+
close-stale:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: write
13+
issues: write
14+
steps:
15+
- uses: actions/github-script@v7
16+
with:
17+
script: |
18+
const label = 'closing-soon';
19+
const staleDays = 3;
20+
const cutoff = new Date(Date.now() - staleDays * 24 * 60 * 60 * 1000);
21+
22+
const prs = await github.rest.pulls.list({
23+
...context.repo,
24+
state: 'open',
25+
per_page: 100
26+
});
27+
28+
for (const pr of prs.data) {
29+
if (!pr.labels.some(l => l.name === label)) continue;
30+
31+
// Find when the label was added
32+
const events = await github.rest.issues.listEvents({
33+
...context.repo,
34+
issue_number: pr.number,
35+
per_page: 100
36+
});
37+
38+
const labelEvent = events.data
39+
.filter(e => e.event === 'labeled' && e.label?.name === label)
40+
.pop();
41+
42+
if (!labelEvent) continue;
43+
44+
const labeledAt = new Date(labelEvent.created_at);
45+
if (labeledAt > cutoff) continue;
46+
47+
await github.rest.issues.createComment({
48+
...context.repo,
49+
issue_number: pr.number,
50+
body: `🔒 Auto-closing: this PR has had the \`${label}\` label for more than ${staleDays} days without a Discord Discussion URL being added.\n\nFeel free to reopen after adding the discussion link to the PR body.`
51+
});
52+
53+
await github.rest.pulls.update({
54+
...context.repo,
55+
pull_number: pr.number,
56+
state: 'closed'
57+
});
58+
59+
console.log(`Closed PR #${pr.number} (labeled ${labeledAt.toISOString()})`);
60+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Docker Smoke Test
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'Dockerfile*'
7+
- 'src/**'
8+
- 'Cargo.*'
9+
10+
jobs:
11+
smoke-test:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
variant:
16+
- { dockerfile: Dockerfile, suffix: "", agent: "kiro-cli", agent_args: "acp --trust-all-tools" }
17+
- { dockerfile: Dockerfile.claude, suffix: "-claude", agent: "claude-agent-acp", agent_args: "" }
18+
- { dockerfile: Dockerfile.codex, suffix: "-codex", agent: "codex-acp", agent_args: "" }
19+
- { dockerfile: Dockerfile.gemini, suffix: "-gemini", agent: "gemini", agent_args: "--acp" }
20+
- { dockerfile: Dockerfile.copilot, suffix: "-copilot", agent: "copilot", agent_args: "--acp" }
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v6
24+
25+
- name: Build image
26+
run: docker build -t openab-test${{ matrix.variant.suffix }} -f ${{ matrix.variant.dockerfile }} .
27+
28+
- name: Verify openab CMD does not crash
29+
run: |
30+
OUTPUT=$(docker run --rm openab-test${{ matrix.variant.suffix }} 2>&1 || true)
31+
if echo "$OUTPUT" | grep -q "unrecognized subcommand"; then
32+
echo "❌ CMD regression: $OUTPUT"
33+
exit 1
34+
fi
35+
echo "✅ openab CMD ok"
36+
37+
- name: Verify agent CLI exists
38+
run: docker run --rm --entrypoint which openab-test${{ matrix.variant.suffix }} ${{ matrix.variant.agent }}
39+
40+
- name: ACP initialize handshake
41+
run: |
42+
INIT='{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{},"clientInfo":{"name":"ci-test","version":"0.0.1"}}}'
43+
44+
RESPONSE=$(echo "$INIT" | timeout 30 docker run --rm -i \
45+
--entrypoint ${{ matrix.variant.agent }} \
46+
openab-test${{ matrix.variant.suffix }} \
47+
${{ matrix.variant.agent_args }} 2>/dev/null | head -1)
48+
49+
echo "Response: $RESPONSE"
50+
51+
if ! echo "$RESPONSE" | jq -e '.result.agentInfo.name' > /dev/null 2>&1; then
52+
echo "❌ ACP initialize failed — no agentInfo in response"
53+
exit 1
54+
fi
55+
56+
AGENT_NAME=$(echo "$RESPONSE" | jq -r '.result.agentInfo.name')
57+
echo "✅ ACP handshake ok — agent=$AGENT_NAME"
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: PR Discussion URL Check
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, synchronize]
6+
7+
concurrency:
8+
group: pr-discussion-${{ github.event.pull_request.number }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: write
16+
issues: write
17+
steps:
18+
- uses: actions/github-script@v7
19+
with:
20+
script: |
21+
const pr = context.payload.pull_request;
22+
const body = pr.body || '';
23+
const labels = pr.labels.map(l => l.name);
24+
const marker = '<!-- openab-pr-discussion-check -->';
25+
const label = 'closing-soon';
26+
27+
// Exempt bot-authored PRs (e.g. openab-app release PRs)
28+
if (pr.user.type === 'Bot') {
29+
console.log(`Skipping discussion check for bot PR by ${pr.user.login}`);
30+
if (old) {
31+
await github.rest.issues.deleteComment({ ...context.repo, comment_id: old.id });
32+
}
33+
if (labels.includes(label)) {
34+
try { await github.rest.issues.removeLabel({ ...context.repo, issue_number: pr.number, name: label }); } catch (e) { if (e.status !== 404) throw e; }
35+
}
36+
return;
37+
}
38+
39+
const hasDiscordUrl = /https:\/\/discord\.com\/channels\/\d+\/\d+/.test(body);
40+
41+
const comments = await github.rest.issues.listComments({
42+
...context.repo,
43+
issue_number: pr.number
44+
});
45+
const old = comments.data.find(c => c.body.includes(marker));
46+
47+
if (!hasDiscordUrl) {
48+
if (!labels.includes(label)) {
49+
await github.rest.issues.addLabels({
50+
...context.repo,
51+
issue_number: pr.number,
52+
labels: [label]
53+
});
54+
}
55+
56+
const msg = [
57+
marker,
58+
'⚠️ This PR is missing a **Discord Discussion URL** in the body.',
59+
'',
60+
'All PRs must reference a prior Discord discussion to ensure community alignment before implementation.',
61+
'',
62+
'Please edit the PR description to include a link like:',
63+
'```',
64+
'Discord Discussion URL: https://discord.com/channels/...',
65+
'```',
66+
'',
67+
`This PR will be **automatically closed in 3 days** if the link is not added.`
68+
].join('\n');
69+
70+
if (!old) {
71+
await github.rest.issues.createComment({
72+
...context.repo,
73+
issue_number: pr.number,
74+
body: msg
75+
});
76+
}
77+
} else {
78+
// URL found — remove label and comment if present
79+
if (labels.includes(label)) {
80+
try {
81+
await github.rest.issues.removeLabel({
82+
...context.repo,
83+
issue_number: pr.number,
84+
name: label
85+
});
86+
} catch (e) {
87+
if (e.status !== 404) throw e;
88+
}
89+
}
90+
if (old) {
91+
await github.rest.issues.deleteComment({
92+
...context.repo,
93+
comment_id: old.id
94+
});
95+
}
96+
}

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "openab"
3-
version = "0.7.4"
3+
version = "0.7.5"
44
edition = "2021"
55

66
[dependencies]

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN touch src/main.rs && cargo build --release
88

99
# --- Runtime stage ---
1010
FROM debian:bookworm-slim
11-
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl unzip && rm -rf /var/lib/apt/lists/*
11+
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl procps unzip && rm -rf /var/lib/apt/lists/*
1212

1313
# Install kiro-cli (auto-detect arch, copy binary directly)
1414
ARG KIRO_CLI_VERSION=2.0.0
@@ -41,4 +41,4 @@ USER agent
4141
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
4242
CMD pgrep -x openab || exit 1
4343
ENTRYPOINT ["openab"]
44-
CMD ["/etc/openab/config.toml"]
44+
CMD ["run", "/etc/openab/config.toml"]

Dockerfile.claude

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ RUN touch src/main.rs && cargo build --release
88

99
# --- Runtime stage ---
1010
FROM node:22-bookworm-slim
11-
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
11+
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl procps && rm -rf /var/lib/apt/lists/*
1212

1313
# Install claude-agent-acp adapter and Claude Code CLI
14-
ARG CLAUDE_CODE_VERSION=2.1.107
14+
ARG CLAUDE_CODE_VERSION=2.1.104
1515
RUN npm install -g @agentclientprotocol/claude-agent-acp@0.25.0 @anthropic-ai/claude-code@${CLAUDE_CODE_VERSION} --retry 3
1616

1717
# Install gh CLI
@@ -31,4 +31,4 @@ USER node
3131
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
3232
CMD pgrep -x openab || exit 1
3333
ENTRYPOINT ["openab"]
34-
CMD ["/etc/openab/config.toml"]
34+
CMD ["run", "/etc/openab/config.toml"]

Dockerfile.codex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN touch src/main.rs && cargo build --release
88

99
# --- Runtime stage ---
1010
FROM node:22-bookworm-slim
11-
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
11+
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl procps && rm -rf /var/lib/apt/lists/*
1212

1313
# Pre-install codex-acp and codex CLI globally
1414
ARG CODEX_VERSION=0.120.0
@@ -31,4 +31,4 @@ USER node
3131
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
3232
CMD pgrep -x openab || exit 1
3333
ENTRYPOINT ["openab"]
34-
CMD ["/etc/openab/config.toml"]
34+
CMD ["run", "/etc/openab/config.toml"]

Dockerfile.copilot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN touch src/main.rs && cargo build --release
88

99
# --- Runtime stage ---
1010
FROM node:22-bookworm-slim
11-
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
11+
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl procps && rm -rf /var/lib/apt/lists/*
1212

1313
# Install GitHub Copilot CLI via npm (pinned version)
1414
ARG COPILOT_VERSION=1.0.25
@@ -31,4 +31,4 @@ USER node
3131
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
3232
CMD pgrep -x openab || exit 1
3333
ENTRYPOINT ["openab"]
34-
CMD ["/etc/openab/config.toml"]
34+
CMD ["run", "/etc/openab/config.toml"]

Dockerfile.gemini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN touch src/main.rs && cargo build --release
88

99
# --- Runtime stage ---
1010
FROM node:22-bookworm-slim
11-
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
11+
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl procps && rm -rf /var/lib/apt/lists/*
1212

1313
# Install Gemini CLI (native ACP support via --acp)
1414
ARG GEMINI_CLI_VERSION=0.37.2
@@ -31,4 +31,4 @@ USER node
3131
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
3232
CMD pgrep -x openab || exit 1
3333
ENTRYPOINT ["openab"]
34-
CMD ["/etc/openab/config.toml"]
34+
CMD ["run", "/etc/openab/config.toml"]

0 commit comments

Comments
 (0)