Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Security and behavior changes

## Unreleased — bounded context reuse and review efficiency
## 0.1.2 — bounded context reuse and review efficiency

- Reuse verified source without spending another distinct-path lookup; separate 24 uncached snapshot/path lookups from a hard 100 total context-request cap. Preserve all GitHub API, byte, integrity, authorization and inference limits. Missing evidence and resource exhaustion remain non-approving, with fixed error reasons.
- Avoid retransmitting full modified old files alongside complete patches/current source; all base/head files remain independently hash-verified and available read-only.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codexbot",
"version": "0.1.1",
"version": "0.1.2",
"private": true,
"description": "Self-hostable GitHub App for isolated Codex pull request reviews",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/runner/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function runCodex(snapshot: RequestSnapshot, manifest: string, plan
let timedOut = false;
const timer = setTimeout(() => { timedOut = true; child.kill('SIGKILL'); }, 20 * 60_000);
try {
await rpc.request('initialize', { clientInfo: { name: 'CodexBot', title: 'CodexBot', version: '0.1.1' } });
await rpc.request('initialize', { clientInfo: { name: 'CodexBot', title: 'CodexBot', version: '0.1.2' } });
rpc.notify('initialized');
const models: Record<string, unknown>[] = [];
let cursor: string | null = null;
Expand Down
2 changes: 1 addition & 1 deletion src/runner/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export async function inferenceProxy(request: IncomingMessage, response: ServerR
stage = 'transport';
deadline = AbortSignal.timeout(20 * 60_000);
const upstream = await fetcher('https://api.openai.com/v1/responses', {
method: 'POST', headers: { Authorization: 'Bearer '+token, 'Content-Type': 'application/json', 'User-Agent': 'CodexBot/0.1.1',
method: 'POST', headers: { Authorization: 'Bearer '+token, 'Content-Type': 'application/json', 'User-Agent': 'CodexBot/0.1.2',
...(typeof request.headers['originator'] === 'string' && request.headers['originator'] === 'CodexBot' ? { originator: 'CodexBot' } : {}) },
body: JSON.stringify(body), redirect: 'error', signal: AbortSignal.any([deadline, disconnected.signal])
});
Expand Down
2 changes: 1 addition & 1 deletion src/worker/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function appClient(env: GitHubCredentials): Promise<Octokit> {
}
export function client(token: string): Octokit {
// Request errors can contain authorization headers: callers never log raw errors.
return new Octokit({ auth: token, log: { debug() {}, info() {}, warn() {}, error() {} }, request: { timeout: 20_000 }, userAgent: 'CodexBot/0.1.1' });
return new Octokit({ auth: token, log: { debug() {}, info() {}, warn() {}, error() {} }, request: { timeout: 20_000 }, userAgent: 'CodexBot/0.1.2' });
}
export async function installationClient(env: GitHubCredentials, installation: number, repositoryId: number, permissions: { contents?: 'read' | 'write'; pull_requests?: 'read' | 'write'; actions?: 'read' | 'write'; workflows?: 'write'; checks?: 'write'; administration?: 'read' }): Promise<{ github: Octokit; token: string }> {
const app = await appClient(env);
Expand Down
2 changes: 1 addition & 1 deletion src/worker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function route(request: Request, env: Env): Promise<Response> {
requireCondition(publicPage || url.origin === canonical, 'non_canonical_backend_origin', 421);
const origin = request.headers.get('origin');
requireCondition(!origin || origin === canonical, 'cross_origin_request_denied', 403);
if (url.pathname === '/health' && request.method === 'GET') return Response.json({ status: 'ok', version: '0.1.1' });
if (url.pathname === '/health' && request.method === 'GET') return Response.json({ status: 'ok', version: '0.1.2' });
if (url.pathname === '/' && request.method === 'GET') return onboarding(env);
const web = await webRoute(request, env); if (web) return web;
if (url.pathname === '/v1/workload/check' && request.method === 'POST') {
Expand Down
2 changes: 1 addition & 1 deletion tests/backend.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ await test('hosted config, manifest and generated callers agree on Workers.dev w
assert.equal(DEFAULT_BACKEND, 'https://codexbot.appsolves.workers.dev');
const config = JSON.parse(await readFile('wrangler.jsonc', 'utf8'));
assert.equal(config.name, 'codexbot'); assert.equal(config.workers_dev, true); assert.equal(config.preview_urls, false);
assert.equal(config.vars.PUBLIC_URL, DEFAULT_BACKEND); assert.equal(config.vars.MERGE_DEPLOYMENT_AUTHORIZED, 'true');
assert.equal(config.vars.PUBLIC_URL, DEFAULT_BACKEND); assert.equal(config.vars.MERGE_DEPLOYMENT_AUTHORIZED, 'false');
assert.equal(config.vars.TRUSTED_WORKFLOW, 'AppSolves/codexbot/.github/workflows/review.yml@bf0510ed98ad2bb7a3798ad9fd3d1ae1286954a2');
assert.equal(config.vars.WEB_ENABLED,'false');assert.equal(config.vars.OPENAI_HOSTED_INFERENCE_AUTHORIZED,'false');
assert.equal(config.vars.ACCEPTANCE_USER_PER_DAY,'');assert.equal(config.vars.MERGE_ACCEPTANCE_REPOSITORY_ID,'');assert.equal(config.vars.MERGE_ACCEPTANCE_INSTALLATION_ID,'');
Expand Down
2 changes: 1 addition & 1 deletion wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"GITHUB_APP_SLUG": "codexbot-review",
"TRUSTED_WORKFLOW": "AppSolves/codexbot/.github/workflows/review.yml@bf0510ed98ad2bb7a3798ad9fd3d1ae1286954a2",
"CHATGPT_DEPLOYMENT_AUTHORIZED": "true",
"MERGE_DEPLOYMENT_AUTHORIZED": "true",
"MERGE_DEPLOYMENT_AUTHORIZED": "false",
"MERGE_ACCEPTANCE_REPOSITORY_ID": "",
"MERGE_ACCEPTANCE_INSTALLATION_ID": "",
"ACCEPTANCE_USER_PER_DAY": "",
Expand Down