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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ The service validates its environment on start (`apps/service/src/env.ts`) and e
| `HANSI_VERIFY_MODEL` | review model | The verifier's model, as `provider:model` with the review model's provider. |
| `HANSI_REVIEW_REASONING` | provider's | The reviewer's reasoning effort: `none`, `minimal`, `low`, `medium`, `high`, `xhigh` or `max`. |
| `HANSI_VERIFY_REASONING` | review effort | The verifier's reasoning effort. |
| `HANSI_SUBAGENTS` | `enabled` | `disabled` stops the reviewer from handing parts of a review to subagents. |
| `HANSI_AI_SECRET` | | The provider's key. Required except for `openai-compatible`. See [Models](#models). |
| `HANSI_AI_REGION` | | AWS region. Required for `bedrock`. |
| `HANSI_AI_BASE_URL` | provider's | The provider's API, instead of its default. Required for `openai-compatible`. |
Expand Down
6 changes: 6 additions & 0 deletions apps/service/src/env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ describe('parseEnv', () => {
expect(env.HANSI_JOBS_PORT).toBe(8081);
expect(env.HANSI_CONSUMER_COMMAND).toBeUndefined();
expect(env.HANSI_SANDBOX_RUNTIME_CLASS).toBe('gvisor');
expect(env.HANSI_SUBAGENTS).toBe('enabled');
});

test('turns subagents off, and takes enabled or disabled only', () => {
expect(parseEnv({ ...required, HANSI_SUBAGENTS: 'disabled' }).HANSI_SUBAGENTS).toBe('disabled');
expect(() => parseEnv({ ...required, HANSI_SUBAGENTS: 'off' })).toThrow(/HANSI_SUBAGENTS/);
});

test('takes a known sandbox isolation tier only', () => {
Expand Down
5 changes: 5 additions & 0 deletions apps/service/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ const schema = z
* Appwrite takes over model choice once it serves keys and models.
*/
HANSI_REVIEW_MODEL: modelId,
/**
* Whether the reviewer may hand parts of a review to subagents that run in parallel. Off, one
* agent reviews the whole change: slower on large pull requests, but fewer model calls.
*/
HANSI_SUBAGENTS: z.enum(['enabled', 'disabled']).default('enabled'),
/** The verifier's model. Defaults to the reviewer's, and uses the same provider. */
HANSI_VERIFY_MODEL: modelId.optional(),
/** Reasoning effort per model. Unset leaves the provider's default. */
Expand Down
7 changes: 6 additions & 1 deletion apps/service/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ await clearWorkdir(undefined);
const models = createModels(env);
// Without a verify model the engine verifies with the review model; measured as verification.
const verify = models.verify ?? models.review;
const context = { github, sandboxes, results: sink };
const context = {
github,
sandboxes,
results: sink,
subagents: env.HANSI_SUBAGENTS === 'enabled'
};
const handlers = createHandlers(
{
...context,
Expand Down