-
Notifications
You must be signed in to change notification settings - Fork 16
BeeOS integration follow-ups and rollout lifecycle hardening #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
fe4ab38
47b2926
99c1f23
f66263f
2c53632
4b4de07
9179d7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -235,8 +235,15 @@ impl App { | |
| } | ||
|
|
||
| fn client() -> reqwest::Client { | ||
| let mut headers = reqwest::header::HeaderMap::new(); | ||
| if let Ok(key) = std::env::var("AGENTOS_API_KEY") { | ||
| if let Ok(val) = reqwest::header::HeaderValue::from_str(&format!("Bearer {}", key)) { | ||
| headers.insert(reqwest::header::AUTHORIZATION, val); | ||
| } | ||
| } | ||
| reqwest::Client::builder() | ||
| .timeout(std::time::Duration::from_secs(5)) | ||
| .default_headers(headers) | ||
| .build() | ||
| .unwrap_or_default() | ||
| } | ||
|
|
@@ -525,7 +532,7 @@ impl App { | |
| let agent_id = if self.chat_agent.is_empty() { | ||
| self.agents.first() | ||
| .and_then(|a| a["id"].as_str().or(a["name"].as_str())) | ||
| .unwrap_or("default") | ||
| .unwrap_or("brain") | ||
| .to_string() | ||
| } else { | ||
| self.chat_agent.clone() | ||
|
|
@@ -1276,7 +1283,7 @@ fn draw_chat(f: &mut Frame, app: &App, area: Rect) { | |
| let agent_label = if app.chat_agent.is_empty() { | ||
| app.agents.first() | ||
| .and_then(|a| a["name"].as_str()) | ||
| .unwrap_or("default") | ||
| .unwrap_or("brain") | ||
| } else { | ||
|
Comment on lines
1283
to
1287
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Align chat title target resolution with send path. Line 1284 through Line 1286 resolve only Proposed fix let agent_label = if app.chat_agent.is_empty() {
app.agents.first()
- .and_then(|a| a["name"].as_str())
+ .and_then(|a| a["name"].as_str().or(a["id"].as_str()))
.unwrap_or("brain")
} else {
&app.chat_agent
};🤖 Prompt for AI Agents |
||
| &app.chat_agent | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Sentrux Review Report | ||
|
|
||
| - Actor: `codex` | ||
| - Scope: `agentos-tsc-cleanup` | ||
| - Timestamp: `2026-04-04T02:26:09+07:00` | ||
| - Worktree: `/home/wunitb/unitb_labs/wunb-agentos-beeos/.worktrees/agentos-beeos-main-runtime` | ||
| - Base commit: `4b4de07e2603d71f87bee17a91a8185dcb82e6a7` | ||
|
|
||
| ## Commands Used | ||
|
|
||
| ```text | ||
| npx tsc -p tsconfig.json --noEmit --pretty false | ||
| npm test -- src/__tests__/mcp-client.test.ts src/__tests__/security-headers.test.ts src/__tests__/skillkit-bridge.test.ts src/__tests__/streaming.test.ts src/__tests__/llm-router.test.ts src/__tests__/session-lifecycle.test.ts src/__tests__/cron.test.ts src/__tests__/api.test.ts | ||
| git diff --check | ||
| Sentrux scan: /home/wunitb/unitb_labs/wunb-agentos-beeos/.worktrees/agentos-beeos-main-runtime | ||
|
Comment on lines
+6
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scrub machine-local paths before committing this report. The 🤖 Prompt for AI Agents |
||
| Sentrux check_rules | ||
| ``` | ||
|
|
||
| ## Findings | ||
|
|
||
| - Severity: medium | ||
| - Area: TypeScript compile hygiene and iii-sdk contract drift | ||
| - Evidence: `tsc` initially failed on test mock signatures, `request_format`/`response_format` shape in `src/api.ts`, `unknown` state-list returns in `src/context-cache.ts`, `src/cron.ts`, and `src/session-lifecycle.ts`, plus drift around `agentTier`, `function_id`, and `globalThis.vitest`. | ||
| - Recommended change: align local typings with current iii-sdk schema contract, keep request/response schemas wrapped in a top-level object format node, and prefer explicit narrowing/casts at `state::*` boundaries instead of relying on `any`. | ||
|
|
||
| ## Handoff For Dev Session | ||
|
|
||
| - Files likely affected: | ||
| `src/api.ts`, `src/llm-router.ts`, `src/types.ts`, `src/context-cache.ts`, `src/cron.ts`, `src/session-lifecycle.ts`, `src/shared/metrics.ts`, `src/evolve.ts`, targeted test files. | ||
| - First fix to attempt: | ||
| Re-run `tsc` first whenever `iii-sdk` is upgraded, because compile errors clearly expose contract drift before runtime. | ||
| - Verification expected after fix: | ||
| `npx tsc -p tsconfig.json --noEmit --pretty false` exits 0 and the targeted vitest slice above stays green. | ||
|
|
||
| ## MegaMemory Update | ||
|
|
||
| - Created concept: `agentos-runtime-typescript-contract-cleanup` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -239,6 +239,68 @@ describe("eval::suite", () => { | |
| call("eval::suite", authReq({ suiteId: "nope" })), | ||
| ).rejects.toThrow("Suite not found"); | ||
| }); | ||
|
|
||
| it("returns suite metadata and baseline comparison context BeeOS can display", async () => { | ||
| seedKv("eval_suites", "suite-routing", { | ||
| suiteId: "suite-routing", | ||
| name: "Routing Suite", | ||
| functionId: "test::double", | ||
| metadata: { | ||
| candidateClass: "routing", | ||
| baselineFunctionId: "beeos::route-task-baseline", | ||
| }, | ||
| testCases: [ | ||
| { | ||
| input: { value: 2 }, | ||
| expected: { result: 4 }, | ||
| scorer: "exact_match", | ||
| }, | ||
| ], | ||
| }); | ||
|
|
||
| const result = await call( | ||
| "eval::suite", | ||
| authReq({ suiteId: "suite-routing" }), | ||
| ); | ||
|
|
||
| expect(result.metadata).toEqual({ | ||
| candidateClass: "routing", | ||
| baselineFunctionId: "beeos::route-task-baseline", | ||
| baselineAggregate: expect.objectContaining({ | ||
| testCount: 1, | ||
| }), | ||
| }); | ||
|
Comment on lines
+243
to
+272
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This BeeOS regression test doesn't actually execute the BeeOS baseline path.
🤖 Prompt for AI Agents |
||
| }); | ||
|
|
||
| it("preserves weighted aggregation for candidate suite results", async () => { | ||
| seedKv("eval_suites", "weighted-suite", { | ||
| suiteId: "weighted-suite", | ||
| name: "Weighted Suite", | ||
| functionId: "test::double", | ||
| testCases: [ | ||
| { | ||
| input: { value: 2 }, | ||
| expected: { result: 999 }, | ||
| scorer: "exact_match", | ||
| weight: 1, | ||
| }, | ||
| { | ||
| input: { value: 5 }, | ||
| expected: { result: 10 }, | ||
| scorer: "exact_match", | ||
| weight: 3, | ||
| }, | ||
| ], | ||
| }); | ||
|
|
||
| const result = await call( | ||
| "eval::suite", | ||
| authReq({ suiteId: "weighted-suite" }), | ||
| ); | ||
|
|
||
| expect(result.aggregate.correctness).toBe(0.75); | ||
| expect(result.aggregate.passRate).toBe(0.5); | ||
| }); | ||
| }); | ||
|
|
||
| describe("eval::history", () => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make fallback agent configurable to avoid cross-surface regressions.
Line 535 hardcodes
"brain"when no agent is selected.src/streaming.tsstill defaults missing agent context to"default"(Line 24 and Line 29 in the provided snippet), so this creates fallback drift and can break chat in environments that don’t provision abrainagent.Proposed fix
🤖 Prompt for AI Agents